make a few columns in the listing model indices to help with search
This commit is contained in:
parent
92c8403157
commit
5adffc8dcf
3 changed files with 58 additions and 5 deletions
|
|
@ -1,6 +1,10 @@
|
|||
import os
|
||||
from sqlmodel import create_engine, SQLModel
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
# PostgreSQL example (or use "sqlite:///database.db" for SQLite)
|
||||
# DATABASE_URL = "postgresql://user:password@localhost/db_name"
|
||||
|
|
@ -9,7 +13,8 @@ from sqlalchemy.orm import sessionmaker
|
|||
DATABASE_URL = os.environ["DB_CONNECTION_STRING"]
|
||||
|
||||
|
||||
engine = create_engine(DATABASE_URL, echo=False) # `echo=True` for debug logs
|
||||
debug = os.getenv("ENV", "dev") == "prod"
|
||||
engine = create_engine(DATABASE_URL, echo=debug) # `echo=True` for debug logs
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue