easy_sql.sql_processor.backend.postgres
Module Contents
Classes
table_partitions_table_name; |
|
Functions
|
- class easy_sql.sql_processor.backend.postgres.PgRow(cols, values)
Bases:
easy_sql.sql_processor.backend.base.Row
- Parameters
cols (List[str]) –
values (Tuple) –
- as_dict(self)
- as_tuple(self)
- class easy_sql.sql_processor.backend.postgres.PostgresBackend(url, credentials=None, sql_expr=None, partitions_table_name='dataplat.__table_partitions__', engine=None)
Bases:
easy_sql.sql_processor.backend.base.Backend
table_partitions_table_name; means the table name which save the static partition info for all partition tables in data warehouse, for now need support backend type: [clickhouse] others backend has another method to manage static partition info or just support static partition
- Parameters
url (str) –
credentials (Optional[str]) –
sql_expr (Optional[easy_sql.sql_processor.backend.sql_dialect.SqlExpr]) –
engine (Optional[sqlalchemy.engine.base.Engine]) –
- clean(self)
- clear_cache(self)
- create_empty_table(self)
- create_table_with_data(self, full_table_name, values, schema, partitions)
- Parameters
full_table_name (str) –
values (List[List[Any]]) –
schema (List[easy_sql.sql_processor.backend.base.Col]) –
partitions (List[easy_sql.sql_processor.backend.base.Partition]) –
- create_temp_table_with_data(self, table_name, values, schema)
- Parameters
table_name (str) –
values (List[List[Any]]) –
schema (List[easy_sql.sql_processor.backend.base.Col]) –
- get_columns(self, table_name, schema=None, raw=False, **kw)
- Return type
List[Dict]
- init_udfs(self, *args, **kwargs)
- property inspector(self)
- Return type
sqlalchemy.engine.reflection.Inspector
- refresh_table_partitions(self, table)
- Parameters
- reset(self)
- save_table(self, source_table, target_table, save_mode, create_target_table)
- Parameters
source_table (easy_sql.sql_processor.backend.base.TableMeta) –
target_table (easy_sql.sql_processor.backend.base.TableMeta) –
save_mode (easy_sql.sql_processor.backend.base.SaveMode) –
create_target_table (bool) –
- save_table_sql(self, source_table, source_table_sql, target_table)
- Parameters
source_table (easy_sql.sql_processor.backend.base.TableMeta) –
source_table_sql (str) –
target_table (easy_sql.sql_processor.backend.base.TableMeta) –
- Return type
- table_exists(self, table)
- Parameters