mirror of
https://github.com/creyD/apilog.git
synced 2026-04-13 20:00:31 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d5907074c9 | |||
|
|
06e5a3af30 | ||
|
|
f42ce7abe1 | ||
|
|
a743969689 | ||
|
|
6fc6117400 | ||
|
|
d8057db909 | ||
|
|
c8872ca437 |
@@ -1,8 +0,0 @@
|
|||||||
from sqlalchemy_utils import create_database, database_exists
|
|
||||||
|
|
||||||
|
|
||||||
def create_if_not_exists(db_name: str):
|
|
||||||
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL
|
|
||||||
|
|
||||||
if not database_exists(SQLALCHEMY_DATABASE_URL + db_name):
|
|
||||||
create_database(SQLALCHEMY_DATABASE_URL + db_name)
|
|
||||||
@@ -2,6 +2,7 @@ import os
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
|
from creyPY.fastapi.db.helpers import create_if_not_exists
|
||||||
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL, get_db, name
|
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL, get_db, name
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
@@ -9,7 +10,6 @@ from alembic import command
|
|||||||
from alembic.config import Config
|
from alembic.config import Config
|
||||||
from app.models.app import Application
|
from app.models.app import Application
|
||||||
from app.models.entry import LogEntry
|
from app.models.entry import LogEntry
|
||||||
from app.services.db.session import create_if_not_exists
|
|
||||||
|
|
||||||
|
|
||||||
def delete_old_logs(sess: Session | None = None):
|
def delete_old_logs(sess: Session | None = None):
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
annotated-types==0.7.0
|
annotated-types==0.7.0
|
||||||
anyio==4.9.0
|
anyio==4.9.0
|
||||||
certifi==2025.6.15
|
certifi==2025.7.9
|
||||||
creyPY[postgres]==3.0.0
|
creyPY[postgres]==3.0.0
|
||||||
fastapi==0.115.13
|
fastapi==0.116.0
|
||||||
fastapi-pagination==0.13.3
|
fastapi-pagination==0.13.3
|
||||||
h11==0.14.0
|
h11==0.14.0
|
||||||
httpcore==1.0.8
|
httpcore==1.0.8
|
||||||
@@ -17,16 +17,16 @@ python-dotenv==1.1.1
|
|||||||
sniffio==1.3.1
|
sniffio==1.3.1
|
||||||
SQLAlchemy==2.0.41
|
SQLAlchemy==2.0.41
|
||||||
starlette==0.46.2
|
starlette==0.46.2
|
||||||
typing_extensions==4.14.0
|
typing_extensions==4.14.1
|
||||||
|
|
||||||
Mako==1.3.10 # Alembic
|
Mako==1.3.10 # Alembic
|
||||||
MarkupSafe==3.0.1 # Alembic
|
MarkupSafe==3.0.1 # Alembic
|
||||||
alembic==1.16.2 # Alembic
|
alembic==1.16.3 # Alembic
|
||||||
|
|
||||||
SQLAlchemy-Utils==0.41.2 # SQLAlchemy
|
SQLAlchemy-Utils==0.41.2 # SQLAlchemy
|
||||||
|
|
||||||
click==8.2.1 # Uvicorn
|
click==8.2.1 # Uvicorn
|
||||||
uvicorn==0.34.3 # Uvicorn
|
uvicorn==0.35.0 # Uvicorn
|
||||||
|
|
||||||
iniconfig==2.1.0 # pytest
|
iniconfig==2.1.0 # pytest
|
||||||
packaging==25.0 # pytest
|
packaging==25.0 # pytest
|
||||||
|
|||||||
Reference in New Issue
Block a user