architxt.database.export.sql#
Functions
|
Add foreign key constraints to the database schema. |
|
Create the schema for the relational database. |
|
Create a table for the given group. |
|
Create a table for the given relation. |
|
Generate the ID column for the given table. |
|
Export the data to the relational database. |
|
Export the group to the relational database. |
|
Export the relation to the relational database. |
|
Export the forest to the relational database. |
|
Export the table to the graph. |
|
Export the tree to the relational database. |
|
Get data from the relational database. |
- architxt.database.export.sql.add_foreign_keys_to_table(database_schema, relation, pk_factory)[source]#
Add foreign key constraints to the database schema.
- architxt.database.export.sql.create_schema(conn, schema, pk_factory)[source]#
Create the schema for the relational database.
- architxt.database.export.sql.create_table_for_group(group, metadata, pk_factory)[source]#
Create a table for the given group.
- architxt.database.export.sql.create_table_for_relation(database_schema, relation, metadata, pk_factory)[source]#
Create a table for the given relation.
- Parameters:
- Return type:
- architxt.database.export.sql.default_pk_factory(table_name)[source]#
Generate the ID column for the given table.
- architxt.database.export.sql.export_data(data, conn)[source]#
Export the data to the relational database.
- Parameters:
data (
dict
) – Data to export.conn (
Connection
) – Connection to the relational database.
- Return type:
- Returns:
- architxt.database.export.sql.export_group(group, data, pk_factory)[source]#
Export the group to the relational database.
- architxt.database.export.sql.export_relation(tree, data, schema, pk_factory)[source]#
Export the relation to the relational database.
- architxt.database.export.sql.export_sql(forest, conn, *, pk_factory=default_pk_factory)[source]#
Export the forest to the relational database.
- Parameters:
conn (
Connection
) – Connection to the relational database.forest (
Collection
[Tree
]) – Forest to export.pk_factory (
Callable
[str
,str
]) – A column name factory for the groups primary keys.
- Return type:
- architxt.database.export.sql.export_table_to_insert(table_to_insert, conn)[source]#
Export the table to the graph.