mirror of
https://github.com/gryf/slack-backup.git
synced 2025-12-17 03:20:25 +01:00
added warning for in-memory db
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
"""
|
"""
|
||||||
Common db functions
|
Common db functions
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
|
|
||||||
from sqlalchemy import MetaData, create_engine
|
from sqlalchemy import MetaData, create_engine
|
||||||
from sqlalchemy.orm import sessionmaker
|
from sqlalchemy.orm import sessionmaker
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
@@ -23,6 +25,8 @@ def connect(filename=None):
|
|||||||
global DbFilename
|
global DbFilename
|
||||||
|
|
||||||
if not filename:
|
if not filename:
|
||||||
|
logging.warning('Using in-memory database. Will disappear after '
|
||||||
|
'program ends. This is probably not what you expect.')
|
||||||
filename = ':memory:'
|
filename = ':memory:'
|
||||||
|
|
||||||
DbFilename = filename
|
DbFilename = filename
|
||||||
|
|||||||
Reference in New Issue
Block a user