Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for SQLite header in database_exists #351

Merged
merged 1 commit into from Dec 4, 2018
Merged

Check for SQLite header in database_exists #351

merged 1 commit into from Dec 4, 2018

Conversation

jomasti
Copy link
Contributor

@jomasti jomasti commented Dec 1, 2018

Along with this change, create_database will also create an actual
SQLite database file instead of just an empty file.

Fixes #306

Along with this change, `create_database` will also create an actual
SQLite database file instead of just an empty file.
@@ -567,7 +576,8 @@ def create_database(url, encoding='utf8', template=None):

elif engine.dialect.name == 'sqlite' and database != ':memory:':
if database:
open(database, 'w').close()
engine.execute("CREATE TABLE DB(id int);")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the line below seem strange. What is their purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is so an actual SQLite file is created instead of just an empty file.

@kvesteri kvesteri merged commit 4302d1c into kvesteri:master Dec 4, 2018
@kvesteri
Copy link
Owner

kvesteri commented Dec 4, 2018

Thanks for the PR! 🚋

@jomasti jomasti deleted the feature/database-exists-sqlite-header branch December 4, 2018 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants