Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
stax_backend_api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aryan Noshirvani
stax_backend_api
Commits
0141119f
Commit
0141119f
authored
Aug 01, 2026
by
Aryan Noshirvani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create src.core module for database imports
parent
3add8cba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
database.py
database.py
+4
-1
__init__.py
src/core/__init__.py
+1
-0
database.py
src/core/database.py
+1
-0
No files found.
database.py
View file @
0141119f
...
@@ -3,7 +3,10 @@ from sqlalchemy import create_engine, Column, Integer, String, DateTime, Foreign
...
@@ -3,7 +3,10 @@ from sqlalchemy import create_engine, Column, Integer, String, DateTime, Foreign
from
sqlalchemy.orm
import
declarative_base
,
sessionmaker
from
sqlalchemy.orm
import
declarative_base
,
sessionmaker
from
datetime
import
datetime
,
timezone
from
datetime
import
datetime
,
timezone
DATABASE_URL
=
"sqlite:////root/antigrav-stax-audio/stax.db"
DATABASE_URL
=
os
.
getenv
(
"DATABASE_URL"
,
"sqlite:///./stax.db"
)
db_dir
=
os
.
path
.
dirname
(
DATABASE_URL
.
replace
(
"sqlite:///"
,
""
))
if
db_dir
and
not
os
.
path
.
exists
(
db_dir
):
os
.
makedirs
(
db_dir
,
exist_ok
=
True
)
engine
=
create_engine
(
DATABASE_URL
,
connect_args
=
{
"check_same_thread"
:
False
})
engine
=
create_engine
(
DATABASE_URL
,
connect_args
=
{
"check_same_thread"
:
False
})
SessionLocal
=
sessionmaker
(
autocommit
=
False
,
autoflush
=
False
,
bind
=
engine
)
SessionLocal
=
sessionmaker
(
autocommit
=
False
,
autoflush
=
False
,
bind
=
engine
)
...
...
src/core/__init__.py
0 → 100644
View file @
0141119f
# Core module package
src/core/database.py
0 → 100644
View file @
0141119f
from
database
import
*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment