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

hanami new should generate db/.keep when sqlite used #191

Closed
timriley opened this issue Jul 8, 2024 · 0 comments · Fixed by #192
Closed

hanami new should generate db/.keep when sqlite used #191

timriley opened this issue Jul 8, 2024 · 0 comments · Fixed by #192
Assignees

Comments

@timriley
Copy link
Member

timriley commented Jul 8, 2024

Without this, we see errors like this when booting a new app:

08:12:10 web.1    | ! Unable to load application: Sequel::DatabaseConnectionError: SQLite3::CantOpenException: unable to open database file
08:12:10 web.1    | /Users/tim/.local/share/mise/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-2.0.2-arm64-darwin/lib/sqlite3/database.rb:119:in `open_v2': SQLite3::CantOpenException: unable to open database file (Sequel::DatabaseConnectionError)
08:12:10 web.1    | 	from /Users/tim/.local/share/mise/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-2.0.2-arm64-darwin/lib/sqlite3/database.rb:119:in `initialize'

Per .env, our default sqlite database is DATABASE_URL=sqlite://db/app_name.sqlite.

sqlite will create new database files whenever it needs, but it doesn't create new directories leading to those files, which is why we need db/ to exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants