Exemple #1
0
def build_postgresql_storage(
        data_source: DataSource) -> Callable[[], TopicDataStorageSPI]:
    from watchmen_storage_postgresql import StoragePostgreSQLConfiguration, PostgreSQLDataSourceParams
    configuration = StoragePostgreSQLConfiguration(
        data_source,
        PostgreSQLDataSourceParams(echo=ask_storage_echo_enabled()))
    return lambda: configuration.create_topic_data_storage()
Exemple #2
0
def build_s3_storage(
        data_source: DataSource) -> Callable[[], TopicDataStorageSPI]:
    from watchmen_storage_s3 import StorageS3Configuration, S3DataSourceParams
    configuration = StorageS3Configuration(
        data_source, S3DataSourceParams(echo=ask_storage_echo_enabled()))
    return lambda: configuration.create_topic_data_storage()
 def log_sql(self, sql: str):
     if ask_storage_echo_enabled():
         logger.info(f'SQL: {sql}')