@@ -53,24 +53,27 @@ def dump_store_to_postgresql(
5353 selected_tables: list of tables to send
5454 fk_id: foreign key id to add to all table on all rows
5555 """
56- _c = Configuration ()
57- _c .postgres .host = postgres_host
58- _c .postgres .port = postgres_port
59- _c .postgres .db_name = postgres_db
60- _c .postgres .db_schema = postgres_schema
61- _c .postgres .user_name = postgres_user
62- _c .postgres .user_password = postgres_password
63- _c .postgres .password_encoding = force_encode
64- _c .postgres .table_prefix = table_prefix
65-
66- dump_store_to_postgresql_from_conf (
67- configuration = _c , store_folder = store_folder , replace = replace , selected_tables = selected_tables , fk_id = fk_id
56+ _c = Configuration (
57+ {
58+ "coal" : {"store" : store_folder },
59+ "postgres" : {
60+ "host" : postgres_host ,
61+ "port" : postgres_port ,
62+ "db_name" : postgres_db ,
63+ "db_schema" : postgres_schema ,
64+ "user_name" : postgres_user ,
65+ "user_password" : postgres_password ,
66+ "password_encoding" : force_encode ,
67+ "table_prefix" : table_prefix ,
68+ },
69+ }
6870 )
6971
72+ dump_store_to_postgresql_from_conf (configuration = _c , replace = replace , selected_tables = selected_tables , fk_id = fk_id )
73+
7074
7175def dump_store_to_postgresql_from_conf (
7276 configuration : Configuration ,
73- store_folder : str ,
7477 replace : bool = True ,
7578 selected_tables : list [str ] = [],
7679 fk_id : str = None ,
@@ -80,13 +83,12 @@ def dump_store_to_postgresql_from_conf(
8083
8184 Args:
8285 configuration: coal Configuration
83- store_folder: Folder containing the Store
8486 replace: Whether to replace existing tables
8587 selected_tables: list of tables to send
8688 fk_id: foreign key id to add to all table on all rows
8789 """
8890 _psql = PostgresUtils (configuration )
89- _s = Store (store_location = store_folder )
91+ _s = Store (configuration = configuration )
9092
9193 tables = list (_s .list_tables ())
9294 if selected_tables :
@@ -104,7 +106,7 @@ def dump_store_to_postgresql_from_conf(
104106 f"""
105107 ALTER TABLE { table_name }
106108 ADD csm_run_id TEXT NOT NULL
107- DEFAULT ('{ fk_id } )
109+ DEFAULT ('{ fk_id } ' )
108110 """
109111 )
110112 data = _s .get_table (table_name )
0 commit comments