PostgresDatasource
class great_expectations.datasource.fluent.PostgresDatasource(*, type: Literal['postgres'] = 'postgres', name: str, id: Optional[uuid.UUID] = None, assets: List[Union[great_expectations.datasource.fluent.sql_datasource.TableAsset, great_expectations.datasource.fluent.sql_datasource.QueryAsset]] = [], connection_string: Union[great_expectations.datasource.fluent.config_str.ConfigStr, pydantic.v1.networks.PostgresDsn], create_temp_table: bool = False, kwargs: Dict[str, Union[great_expectations.datasource.fluent.config_str.ConfigStr, Any]] = )#
Adds a postgres datasource to the data context.
- Parameters
name – The name of this postgres datasource.
connection_string – The SQLAlchemy connection string used to connect to the postgres database. For example: “postgresql+psycopg2://postgres:@localhost/test_database”
assets – An optional dictionary whose keys are TableAsset or QueryAsset names and whose values are TableAsset or QueryAsset objects.
add_query_asset(name: str, query: str, order_by: Optional[SortersDefinition] = None, batch_metadata: Optional[BatchMetadata] = None)