astro.sql.table

Module Contents

Classes

Metadata

Contains additional information to access a SQL Table, which is very likely optional and, in some cases, may

Table

Withholds the information necessary to access a SQL Table.

Attributes

MAX_TABLE_NAME_LENGTH

TEMP_PREFIX

astro.sql.table.MAX_TABLE_NAME_LENGTH = 62
astro.sql.table.TEMP_PREFIX = _tmp_
class astro.sql.table.Metadata

Contains additional information to access a SQL Table, which is very likely optional and, in some cases, may be database-specific.

schema :str | None
database :str | None
is_empty()

Check if all the fields are None.

Return type

bool

class astro.sql.table.Table

Withholds the information necessary to access a SQL Table. It is agnostic to the database type. If no name is given, it auto-generates a name for the Table and considers it temporary.

Temporary tables are prefixed with the prefix TEMP_PREFIX.

template_fields = ['name']
conn_id :str =
name :str =
Return type

str

metadata :Metadata
columns :list[sqlalchemy.Column]
temp :bool = False
create_similar_table()

Create a new table with a unique name but with the same metadata.

Return type

Table

property sqlalchemy_metadata

Return the Sqlalchemy metadata for the given table.

Return type

sqlalchemy.MetaData