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.

Models sometimes won't be created after sync and close for SQLite3

See original GitHub issue

Reproduction Steps

  1. Create two models, don’t think it matters what’s in them, as long as there’s a primary key and at least one other column
  2. After that, call await db.link([Model1, Model2]), then await db.sync(), then await db.close()
  3. If both tables were created successfully, delete one of them then rerun

Expected Behaviour

Both tables should be created successfully.

Actual Behaviour

Sometimes both will be created successfully, but sometimes not all of them will be created.

Let me know if there’s a misunderstanding of how these methods work or if there’s any issues reproducing it. Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Cotehcommented, Jun 4, 2020

Hey Arnaud, sorry about the late response. My internet was out for a few days, just got a replacement modem yesterday. Seems like all tables are created now, after running another minimal example and my web app. I even dropped one of the tables and reran the app and it created it again. I noticed that you upgraded to version 2 of the sqlite library sometime after I posted this issue, maybe that fixed it.

I’ll reopen if it happens again.

0reactions
eveningkidcommented, Jun 4, 2020

Thanks for the update, no worries. See you around 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I avoid concurrency problems when using SQLite on ...
Inserts, updates, deletes and reads are generally OK from multiple threads, but Brad's answer is not correct. You have to be careful with...
Read more >
SQLite escaping doesn't work · Issue #149 · eveningkid/denodb
Hi, I tried to use denodb for storing html in a SQLite database. ... await db.sync({ drop: true }); await IssueExample.create({body: "no ...
Read more >
File Locking And Concurrency In SQLite Version 3
When a process wants to read from a database file, it followed the following sequence of steps: Open the database file and obtain...
Read more >
Importing and Exporting (Dump Command) Data in SQLite
Importing data from SQL files. After having used the .dump command inside the sqlite3 prompt to export your SQLite database as an SQL...
Read more >
Database — peewee 3.15.4 documentation
Open and close connections. ... Peewee comes with support for SQLite, MySQL and Postgres. ... by default, do not persist after the connection...
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