Functions
operation_to_sql
1
str
▼
Convert a single operation to SQL.
operation_to_sql
1
str
▼
def operation_to_sql(op: Operation) -> str
Parameters
| Name | Type | Description |
|---|---|---|
op |
Operation |
Returns
str
_next_migration_number
1
int
▼
Find the next migration number by scanning existing files.
_next_migration_number
1
int
▼
def _next_migration_number(migrations_dir: str) -> int
Parameters
| Name | Type | Description |
|---|---|---|
migrations_dir |
str |
Returns
int
_slugify
1
str
▼
Generate a slug from operations for the migration filename.
_slugify
1
str
▼
def _slugify(ops: list[Operation]) -> str
Parameters
| Name | Type | Description |
|---|---|---|
ops |
list[Operation] |
Returns
str
generate_migration
2
str | None
▼
Generate a numbered .sql migration file from operations.
Returns the path to t…
generate_migration
2
str | None
▼
def generate_migration(ops: list[Operation], migrations_dir: str = 'migrations') -> str | None
Generate a numbered .sql migration file from operations.
Returns the path to the generated file, or None if no operations.
Parameters
| Name | Type | Description |
|---|---|---|
ops |
list[Operation] |
|
migrations_dir |
str |
Default:'migrations'
|
Returns
str | None