export script

This commit is contained in:
2026-04-13 21:10:37 -03:00
parent 9ecc341da8
commit 236ab941a5
16 changed files with 2410 additions and 158 deletions

View File

@@ -6,7 +6,7 @@ from db.models import Base, Order, OrderStatus
def get_engine():
return create_engine('postgresql+psycopg2://postgres:guardia123@192.168.1.202:5432/export-tray', echo=False)
return create_engine('postgresql+psycopg2://postgres:guardia123@192.168.1.204:5432/export-tray', echo=False)
def create_tables():
@@ -31,6 +31,8 @@ def drop_tables():
Base.metadata.drop_all(engine)
def insert_into_table(values_map, table_name):
engine = get_engine()
stmt = insert(table_name).values(values_map)
@@ -49,3 +51,4 @@ def update_record(where_map, values_map, table_name):
result = conn.execute(stmt)
print(result)
conn.commit()