normlite.sql.ddl¶
Module Contents¶
- class normlite.sql.ddl._ColumnMetadata[source]¶
Lightweight view over one DBAPI column metadata row.
- type_code: Any¶
- value: Any¶
- classmethod from_row(row: tuple[Any, Ellipsis]) _ColumnMetadata[source]¶
- class normlite.sql.ddl.HasTableMixin[source]¶
Mixin for objects that have a
normlite.sql.schema.Tableobject.Added in version 0.8.0.
- get_table() normlite.sql.schema.Table[source]¶
- class normlite.sql.ddl.ExecutableDDLStatement[source]¶
Bases:
HasTableMixin,normlite.sql.base.ExecutableBase class for all DDL executable statements.
Added in version 0.8.0: This class is a convenient base class to set the
is_ddlfor all subclasses.- is_ddl = True¶
Trueif the executable subclass is a DDL statement.Added in version 0.8.0.
- _table = None¶
- _execute_on_connection(connection: normlite.engine.base.Connection, params: normlite.engine.interfaces._CoreAnyExecuteParams | None, *, execution_options: dict | None = None) normlite.engine.cursor.CursorResult[source]¶
- class normlite.sql.ddl.CreateTable(table: normlite.sql.schema.Table)[source]¶
Bases:
ExecutableDDLStatementRepresent a
CREATE TABLEstatement.Changed in version 0.8.0: This version runs on the new
normlite.engine.base.Connectionexecution pipeline.Added in version 0.7.0.
- __visit_name__ = 'create_table'¶
Class attribute used to denote the visit method to be called during compilation.
- _table¶
- _setup_execution(context: normlite.engine.context.ExecutionContext) None[source]¶
Per-statement internal hook to setup execution.
Subclasses shall use this hook method to prepare the execution and store execution-related data in execution context.
Added in version 0.8.0.
- _finalize_execution(context: normlite.engine.context.ExecutionContext) None[source]¶
Per-statement internal hook to finalize execution.
Subclasses shall use this hook method to finalize results and store execution-related data in execution context.
Added in version 0.8.0.
- class normlite.sql.ddl.DropTable(table: normlite.sql.schema.Table)[source]¶
Bases:
ExecutableDDLStatementRepresent a
DROP TABLEstatement.Added in version 0.8.0.
- __visit_name__ = 'drop_table'¶
Class attribute used to denote the visit method to be called during compilation.
- _table¶
- _setup_execution(context: normlite.engine.context.ExecutionContext) None[source]¶
Per-statement internal hook to setup execution.
Subclasses shall use this hook method to prepare the execution and store execution-related data in execution context.
Added in version 0.8.0.
- _handle_dbapi_error(exc: normlite.notiondbapi.dbapi2.Error, context: normlite.engine.context.ExecutionContext) NoReturn | None[source]¶
Handle the DBAPI error that may occur during execution.
- Parameters:
exc (Error) – The error to be handled
context (ExecutionContext) – The execution context in which this executables is running.
- Returns:
Nothin
- Return type:
Optional[NoReturn]
- _finalize_execution(context: normlite.engine.context.ExecutionContext) None[source]¶
Per-statement internal hook to finalize execution.
Subclasses shall use this hook method to finalize results and store execution-related data in execution context.
Added in version 0.8.0.
- class normlite.sql.ddl.ReflectTable(table: normlite.sql.schema.Table)[source]¶
Bases:
ExecutableDDLStatementRepresent a convenient pseudo DDL statement to reflect a Notion database into a Python
normlite.sql.schema.Tableobject.Added in version 0.8.0.
- __visit_name__ = 'reflect_table'¶
Class attribute used to denote the visit method to be called during compilation.
- _reflected_table¶
The
normlite.sql.schema.Tableobject to be reflected.
- _reflected_table_info = None¶
The reflected info data structure holding the reflected columns.
- _setup_execution(context: normlite.engine.context.ExecutionContext) None[source]¶
Per-statement internal hook to setup execution.
Subclasses shall use this hook method to prepare the execution and store execution-related data in execution context.
Added in version 0.8.0.
- _finalize_execution(context: normlite.engine.context.ExecutionContext) None[source]¶
Per-statement internal hook to finalize execution.
Subclasses shall use this hook method to finalize results and store execution-related data in execution context.
Added in version 0.8.0.
- get_table() normlite.sql.schema.Table[source]¶