Improve path

This commit is contained in:
Dimitris Zlatanidis 2022-12-29 21:31:05 +02:00
parent ede8723cc1
commit 496a71c47a

View file

@ -1,6 +1,8 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
from dataclasses import dataclass
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
@ -9,10 +11,8 @@ from sqlalchemy import create_engine, Column, Integer, Text
from slpkg.configs import Configs
db_path = Configs.db_path
database = Configs.database
DATABASE_URI = os.path.join(f'sqlite:///{Configs.db_path}', Configs.database)
DATABASE_URI = f'sqlite:///{db_path}/{database}'
engine = create_engine(DATABASE_URI)
session = sessionmaker(engine)()