Spaces:
Runtime error
Runtime error
Commit
·
0a23fce
1
Parent(s):
0377dae
Create database.py
Browse files- database.py +12 -0
database.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sqlalchemy import create_engine
|
2 |
+
from sqlalchemy.ext.declarative import declarative_base
|
3 |
+
from sqlalchemy.orm import sessionmaker
|
4 |
+
|
5 |
+
# DATABASE_URL = "postgresql://tracinginsights:gabbie1972!@localhost/maindb"
|
6 |
+
DATABASE_URL = "sqlite:///./main.db"
|
7 |
+
|
8 |
+
engine = create_engine(DATABASE_URL, connect_args={"check_same_thread": False})
|
9 |
+
|
10 |
+
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
11 |
+
|
12 |
+
Base = declarative_base()
|