Skip to main content
Version: devel

destinations.impl.sqlalchemy.db_api_client

SqlalchemyClient Objects

class SqlalchemyClient(SqlClientBase[Connection])

[view_source]

dbapi

type: ignore[assignment]

migrations

lazy init as needed

commit_transaction

def commit_transaction() -> None

[view_source]

Commits the current transaction.

rollback_transaction

def rollback_transaction() -> None

[view_source]

Rolls back the current transaction.

get_existing_table

def get_existing_table(table_name: str) -> Optional[sa.Table]

[view_source]

Get a table object from metadata if it exists

compile_column_def

def compile_column_def(column: sa.Column) -> str

[view_source]

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]

[view_source]

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]

[view_source]

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

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.