Skip to content

Commit

Permalink
remove example
Browse files Browse the repository at this point in the history
  • Loading branch information
dachosen1 committed Dec 4, 2023
1 parent 881677b commit e192f21
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions nearquake/app/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,3 @@ def create_schemas(engine, schema_names):
for schema_name in schema_names:
create_schema_sql = text(f"CREATE SCHEMA IF NOT EXISTS {schema_name}")
connection.execute(create_schema_sql)


if __name__ == "__main__":
# TODO: Remove
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from nearquake.config import ConnectionConfig

config = ConnectionConfig()
url = config.generate_connection_url("postgresql")

engine = create_engine(url=url)

schema_names = ["earthquake", "tweet", "tmp", "warehouse"]

# Create schemas if they don't exist
create_schemas(engine, schema_names)

# Create all tables in the engine
Base.metadata.create_all(engine)

# Create a sessionmaker, bound to our engine
Session = sessionmaker(bind=engine)
session = Session()

0 comments on commit e192f21

Please sign in to comment.