Skip to content

models

MigrateConfig dataclass

Configuration for the migration tool.

Source code in src/embar/tools/models.py
 7
 8
 9
10
11
12
13
14
15
16
@dataclass
class MigrateConfig:
    """
    Configuration for the migration tool.
    """

    dialect: Literal["postgresql"]
    db_url: str
    schema_path: str
    migrations_dir: str | None = None

MigrationDiff dataclass

Represents a migration diff with compatibility information.

Source code in src/embar/tools/models.py
33
34
35
36
37
38
39
40
41
42
43
44
45
@dataclass
class MigrationDiff:
    """
    Represents a migration diff with compatibility information.
    """

    table_name: str
    old_table_name: str | None
    new_table_name: str | None
    match_type: Literal["exact", "renamed", "new", "deleted"]
    sql: str
    is_backward_compatible: bool
    explanation: str

TableMatch dataclass

Represents a match between old and new table definitions.

Source code in src/embar/tools/models.py
19
20
21
22
23
24
25
26
27
28
29
30
@dataclass
class TableMatch:
    """
    Represents a match between old and new table definitions.
    """

    old_name: str | None
    new_name: str | None
    old_ddl: Ddl | None
    new_ddl: Ddl | None
    match_type: Literal["exact", "renamed", "new", "deleted"]
    similarity_score: float = 1.0