-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Sqlite3] Fix can not get table sql because of case sensitive #5509
Conversation
@OlivierCavadenti Thanks for the label, i added the tests. |
If SQLite is case-sensitive, why should knex hide that? |
Hi @kibertoad When we try to get some tables DDL, we don't care if we pass the UPPERCASE or lowercase of table name. |
got it, thanks! |
@zydmayday I will check coveralls configuration before merge that. It's seems coverage decreased computation take into account not only coverage of code, but also coverage of tests... I will not ask you to make a test for test :D. |
@OlivierCavadenti |
Example
Here is an example how to reproduce the issue.
https://github.com/zydmayday/learn-knex/blob/main/knex/knex.test.ts#L34-L44
Details
Use sqlite3 as database for testing, and has some migration scripts for setting up tables.
If we have one script create a table called "some_table(https://github.com/zydmayday/learn-knex/blob/main/knex/migrations/1_create_table.ts)",
and another script alter table but using table name "Some_Table(https://github.com/zydmayday/learn-knex/blob/main/knex/migrations/2_add_columns.ts)".
Then after running jest, we will have the following error logs.
How to fix
Because the related SQL script is case sensitive, change it to run in a case insensitive way.