destinations.impl.sqlalchemy.db_api_client
SqlalchemyClient Objects
class SqlalchemyClient(SqlClientBase[Connection])
dbapi
type: ignore[assignment]
migrations
lazy init as needed
commit_transaction
def commit_transaction() -> None
Commits the current transaction.
rollback_transaction
def rollback_transaction() -> None
Rolls back the current transaction.
get_existing_table
def get_existing_table(table_name: str) -> Optional[sa.Table]
Get a table object from metadata if it exists
compile_column_def
def compile_column_def(column: sa.Column) -> str
Compile a column definition including type for ADD COLUMN clause
reflect_table
def reflect_table(
table_name: str,
metadata: Optional[sa.MetaData] = None,
include_columns: Optional[Sequence[str]] = None) -> Optional[sa.Table]
Reflect a table from the database and return the Table object
compare_storage_table
def compare_storage_table(
table_name: str) -> Tuple[sa.Table, List[sa.Column], bool]
Reflect the table from database and compare it with the version already in metadata. Returns a 3 part tuple:
- The current version of the table in metadata
- List of columns that are missing from the storage table (all columns if it doesn't exist in storage)
- boolean indicating whether the table exists in storage