Automatically ensure path for storage.db when setting up SQLite
See original GitHub issueIssue Description
Is your feature request related to a problem? Please describe.
SQLITE_CANTOPEN
error occurs when Sequelize is setup with a path to storage.db
with folders that don’t exist.
Describe the solution you’d like
Sequelize could automatically create the necessary folders when this happens.
Why should this be in Sequelize
Just for convenience
Describe alternatives/workarounds you’ve considered
Leave to users do it themselves
Additional context
See #3551
Issue Template Checklist
Is this issue dialect-specific?
- No. This issue is relevant to Sequelize as a whole.
- Yes. This issue only applies to the following dialect(s): SQLite
Would you be willing to resolve this issue by submitting a Pull Request?
- Yes, I have the time and I know how to start.
- Yes, I have the time but I don’t know how to start, I would need guidance.
- No, I don’t have the time, although I believe I could do it if I had the time…
- No, I don’t have the time and I wouldn’t even know how to start.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
VACUUM - SQLite
Running VACUUM ensures that each table and index is largely stored contiguously within the database file.
Read more >How SQLite VACUUM Optimizes Your Database
In this tutorial, we will explain why you need to use the SQLite VACUUM command and how to use it to optimize the...
Read more >How To Use an SQLite Database in a Flask Application
You first import the sqlite3 module. You open a connection to a database file named database. db , which will be created once...
Read more >How to Store Multimedia Files in a SQLite3 Database with ...
Learn how to set up a SQLite3 database and write a Python application that reads and ... integrate with APIs from cloud storage...
Read more >Data Management With Python, SQLite, and SQLAlchemy
Creating a Database Structure; Interacting With a Database With SQL ... Below, you'll explore using SQL databases and flat files for data storage...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@multum awesome. Feel free to start working on it whenever you want. I suggest using fs-jetpack, and I would do the following: test if the given file exists; if it doesnt, create the folder for it. A trick I use to create the folder in cases like this is writing an empty file there (because fs-jetpack will create all necessary folders) and then deleting the file afterwards (the intermediate folders will be kept)
Let me.know if you need more guidance 😬
@papb Hi! I would like to contribute. Can i take this?