mirror of
https://github.com/jaypyles/Scraperr.git
synced 2025-12-12 10:45:58 +00:00
feat: replace mongodb with sqllite
This commit is contained in:
15
api/backend/database/startup.py
Normal file
15
api/backend/database/startup.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from api.backend.database.common import connect, QUERIES
|
||||
import logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def init_database():
|
||||
cursor = connect()
|
||||
|
||||
for query in QUERIES["init"].strip().split(";"):
|
||||
if query.strip():
|
||||
LOG.info(f"Executing query: {query}")
|
||||
_ = cursor.execute(query)
|
||||
|
||||
cursor.close()
|
||||
Reference in New Issue
Block a user