`flask db_create` fails on sqlite
sfermigier opened this issue · 2 comments
sfermigier commented
With the default sqlite.py
config:
File "/ghq/github.com/cedricbonhomme/newspipe/newspipe/commands.py", line 35, in db_create
application.config["DB_CONFIG_DICT"],
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'DB_CONFIG_DICT'
The code in db_create()
is specific to postgres, and won't work with other databases.
def db_create(db, db_config_dict, database_name):
db_conn_format = "postgresql://{user}:{password}@{host}:{port}/{database}"
db_conn_uri_default = db_conn_format.format(database="postgres", **db_config_dict)
engine_default = create_engine(db_conn_uri_default)
conn = engine_default.connect()
conn.execute(text("COMMIT"))
conn.execute(text("CREATE DATABASE %s" % database_name))
conn.close()
sfermigier commented
A first step would be to fix the README.
cedricbonhomme commented
Indeed, I do not use this for my local instance which is using SQLite.
Thank you !