Spaces:
No application file
No application file
Download examples/rest-api/database.py from rajesh1501/embedchain: direct link, hf CLI and curl.
- Browser
- Download file 377 Bytes
-
https://huggingface.co/spaces/rajesh1501/embedchain/resolve/main/examples/rest-api/database.py
- Command line
-
hf download hf://spaces/rajesh1501/embedchain/examples/rest-api/database.py
-
curl -L -o database.py https://huggingface.co/spaces/rajesh1501/embedchain/resolve/main/examples/rest-api/database.py
377 Bytes
| from sqlalchemy import create_engine | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker | |
| SQLALCHEMY_DATABASE_URI = "sqlite:///./app.db" | |
| engine = create_engine(SQLALCHEMY_DATABASE_URI, connect_args={"check_same_thread": False}) | |
| SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) | |
| Base = declarative_base() | |