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

[BUG]: SQLite - drizzle-kit pull fails in my project since kit >= 0.26.0 and orm >= 0.35.0 #3817

Open
1 task done
rainst opened this issue Dec 20, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working drizzle/kit priority Will be worked on next

Comments

@rainst
Copy link

rainst commented Dec 20, 2024

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.30.1

What version of drizzle-kit are you using?

0.38.2

Other packages

[email protected]

Describe the Bug

I have uploaded a repository to make it easier to reproduce and test the issue: https://github.com/rainst/drizzle-bug

what follows is the README of that repo:

drizzle-orm@~0.34.0 and drizzle-kit@~0.25.0 are the most recent versions that still work fine on my database, when I run orm-kit pull.

If I update the packages to the next available minor versions drizzle-orm@~0.35.0 and drizzle-kit@~0.26.0 or the latest currently available I end up with this error:

Pulling from ['public'] list of schemas

[⣷] 0 tables fetching
[⣷] 0 columns fetching
[⣷] 0 indexes fetching
[⣷] 0 foreign keys fetching
[⣷] 0 policies fetching
[⣷] 0 check constraints fetching
[⣷] 0 views fetching
SqliteError: no such column: "%3.3f" - should this be a string literal in single-quotes?
    at Object.query (/Users/(...)/projects/drizzle-bug/node_modules/drizzle-kit/bin.cjs:79216:53)
    at fromDatabase3 (/Users/(...)/projects/drizzle-bug/node_modules/drizzle-kit/bin.cjs:38587:32)
    at introspectSqlite (/Users/(...)/projects/drizzle-bug/node_modules/drizzle-kit/bin.cjs:85132:9)
    at async Object.handler (/Users/(...)/projects/drizzle-bug/node_modules/drizzle-kit/bin.cjs:92395:9)
    at async run (/Users/(...)/projects/drizzle-bug/node_modules/drizzle-kit/bin.cjs:90501:7) {
  code: 'SQLITE_ERROR'
}

SCRIPTS FOR REPRODUCING AND TESTING

  • Run yarn pull to reproduce the error. ❌

  • Run yarn downgrade to install an older versions of the packages and then yarn pull, the database will be introspected without errors. ✅

  • Run yarn downgrade:old to install an older version of the packages that still use the old config based on driver rather than dialect and run yarn pull:old to introspect successfully. ✅

  • Run yarn check-latest to install the latest versions of drizzle orm and kit and run a pull to see if the bug has been fixed in the latest version available. 🔍

WHAT I AM TRYING TO DO

The database contains raw data extracted from Microsoft Flight Simulator 2020 (airports, navigation data and so on..), that I use to run this website: https://msfs.breincorporation.com/.

Currently I manually extract the Airport table and shave off the colums I don't need, I was trying to automate this step with the help of drizzle.

@rainst rainst added the bug Something isn't working label Dec 20, 2024
@rainst rainst changed the title [BUG]: drizzle-kit pull fails on an SQLite database [BUG]: SQLite drizzle-kit pull fails since kit@~0.26.0 and orm@~0.35.0 Dec 20, 2024
@rainst rainst changed the title [BUG]: SQLite drizzle-kit pull fails since kit@~0.26.0 and orm@~0.35.0 [BUG]: SQLite - drizzle-kit pull fails in my project since kit >= 0.26.0 and orm >= 0.35.0 Dec 20, 2024
@L-Mario564 L-Mario564 added drizzle/kit priority Will be worked on next labels Dec 23, 2024
@rainst
Copy link
Author

rainst commented Dec 27, 2024

I have updated the app I use to export data from the game to sqlite, tried pulling again and I'm not getting an error anymore when using the latest versions of drizzle orm and kit.

I think this issue can be closed as it appears that it was caused by the sqlite driver used by that 3rd party app. I'm leaving it in the hands of the development team in case someone is still interested in getting to the bottom of what seems to be a very edge case (the bug is still reproducible when pulling my repo).

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working drizzle/kit priority Will be worked on next
Projects
None yet
Development

No branches or pull requests

2 participants