mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-01 10:09:08 +00:00
16 lines
435 B
Python
16 lines
435 B
Python
from sqlalchemy import create_engine, Column, Integer, String
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
from sqlalchemy.orm import sessionmaker
|
|
import os
|
|
from dotenv import load_dotenv
|
|
load_dotenv()
|
|
|
|
POSTGRES_DATABASE_URL = os.environ.get("POSTGRES_DATABASE_URL")
|
|
|
|
engine = create_engine(
|
|
POSTGRES_DATABASE_URL
|
|
)
|
|
|
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|
|
|
Base = declarative_base()
|