# `sc_crawler.alembic_helpers`

> Helpers functions for the Alembic database migrations.

# `sc_crawler.alembic_helpers`

**Functions:**

- [**alembic_cfg**](#alembic_cfg) – Loads the Alembic config and sets some dynamic attributes.
- [**get_revision**](#get_revision) – Get current revision of alembic in a database connection.

## func <code class="doc-name">alembic_cfg</code> [alembic_helpers.py:13–23](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/alembic_helpers.py#L13-L23)

```python
alembic_cfg(connection, scd=None, force_logging=True)
```

Loads the Alembic config and sets some dynamic attributes.

## func <code class="doc-name">get_revision</code> [alembic_helpers.py:26–36](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/alembic_helpers.py#L26-L36)

```python
get_revision(connection, version_table='zzz_alembic_version')
```

Get current revision of alembic in a database connection.

**Parameters:**

- **connection** ([`Connection`](https://docs.sqlalchemy.org/en/20/core/connections.html#sqlalchemy.engine.Connection)) – SQLAlchemy connection to look up revision in `version_table`
- **version_table** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – name of the table storing revision
