question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically ensure path for storage.db when setting up SQLite

See original GitHub issue

Issue 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
papbcommented, Jan 15, 2020

@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 😬

1reaction
multumcommented, Nov 25, 2019

@papb Hi! I would like to contribute. Can i take this?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found