Move database to a permanent location

master
Nikola Forró 7 years ago
parent de1e94ff0b
commit d115eb47b6

1
.gitignore vendored

@ -0,0 +1 @@
quotes.db

@ -1,3 +1,5 @@
import os
import marshmallow
import sqlalchemy
import sqlalchemy.orm
@ -6,7 +8,9 @@ import sqlalchemy.ext.declarative
from datetime import datetime
engine = sqlalchemy.create_engine('sqlite:////tmp/quotes.db') # FIXME
DB_PATH = os.path.expandvars('$HOME/quotes/quotes.db')
engine = sqlalchemy.create_engine(f'sqlite:///{DB_PATH}')
Session = sqlalchemy.orm.sessionmaker(bind=engine)
Base = sqlalchemy.ext.declarative.declarative_base()

Loading…
Cancel
Save