mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 04:00:09 +00:00
update
This commit is contained in:
parent
c8a0a21ef2
commit
3f21c2b2c2
83 changed files with 6355 additions and 0 deletions
18
server/app/component/database.py
Normal file
18
server/app/component/database.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from sqlmodel import Session, create_engine
|
||||
from app.component.environment import env, env_or_fail
|
||||
|
||||
|
||||
engine = create_engine(
|
||||
env_or_fail("database_url"),
|
||||
echo=True if env("debug") == "on" else False,
|
||||
pool_size=36,
|
||||
)
|
||||
|
||||
|
||||
def session_make():
|
||||
return Session(engine)
|
||||
|
||||
|
||||
def session():
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
Loading…
Add table
Add a link
Reference in a new issue