knex: SQlite3 backsticks/double quotes problem

Environment

Knex version: 0.12/0.14 Database + version: SQlite3 4.0.1 OS: OSX

Questions about how to use knex

I have a SQlite3 database with double quotes and it was created with knex 0.12. Then i’ve switched to knex 0.14 and executed renameColumn. It crashed, because this line is always false and it doesn’t create the table with the new table, always with the old. It is always false, because e.g. “column” !== `column`.

Is there a way to migrate my SQlite3 database file? I assume knex won’t be backwards compatible? But i guess many people could run into this.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (17 by maintainers)

Commits related to this issue

Most upvoted comments

No hurry! Just was curious whether we want to keep this issue open to track progress on second PR or close it already.

@kirrg001 Probably as a separate PR, I’m not exactly sure what solution is and would be curious to take a look at it.

I’m surprised that test hadn’t caught these… sounds like renaming parts will need more integration testing.

Looks like we need to go through all the code and look for places where there has been used hardcoded quotes like here: https://github.com/tgriesser/knex/blob/v0.15.1/src/dialects/sqlite3/schema/ddl.js#L56

Just gonna pop my head up here and explain that this bug was found during QA for Ghost 2.0, and is a blocker for us shipping.

We have a very very tight deadline on that (this week) so we are heavily invested in doing whatever is necessary to get to a fix 🚨🚑.

Would really appreciate someone who knows the codebase and/or has the ability to merge/deploy etc getting in touch and letting us know if this is even realistically possible. We can fork and fix so we aren’t entirely stuck, but would really love little advice / code review and also to have a release so we can use the mainline version if at all possible 🙂