snowshu.adapters.target_adapters.postgres_adapter¶
-
class
snowshu.adapters.target_adapters.postgres_adapter.postgres_adapter.PostgresAdapter(**kwargs)¶ Bases:
snowshu.adapters.target_adapters.base_target_adapter.BaseTargetAdapter-
DOCKER_IMAGE= 'postgres:12'¶
-
DOCKER_REMOUNT_DIRECTORY= 'snowshu_replica_data'¶
-
DOCKER_SNOWSHU_ENVARS= ['POSTGRES_PASSWORD', 'POSTGRES_USER', 'POSTGRES_DB']¶
-
MATERIALIZATION_MAPPINGS= {'TABLE': TABLE, 'VIEW': VIEW}¶
-
create_database_if_not_exists(database: str) → str¶ Postgres doesn’t have great CINE support.
So ask for forgiveness instead.
-
create_schema_if_not_exists(database: str, schema: str) → None¶
-
dialect= 'postgres'¶
-
static
docker_commit_changes() → str¶ To finalize the image we need to set envars for the container.
-
enable_cross_database(relations: Iterable[Relation]) → None¶ Create x-database links, if available to the target.
- Parameters
relations – an iterable of relations to collect databases and schemas from.
-
static
image_finalize_bash_commands() → List[str]¶ returns an ordered list of raw bash commands used to finalize the image.
For many target images some bash cleanup is required, such as remounting data or setting envars. This method returns the ordered commands to do this finalization.
Note
These commands will be run using bin/bash -c execution.
- Returns
a list of strings to be run against the container in order.
-
name= 'postgres'¶
-