You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The update statement works, the asd column is ignored. The insert statement throws an error:
Error message
[Error: insert into `test` (`asd`, `id`) values (NULL, 4) - SQLITE_ERROR: table test has no column named asd] {
errno: 1,
code: 'SQLITE_ERROR'
}
Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
See above
Use case
Basically I stumbled upon this when trying to delete a field by setting it to undefined. Often when for example using the spread operator it is useful to delete fields that don't exist in the DB.
Environment
Knex version: 2.4.2
Database + version: Sqlite3 v. 5.1.2, also postgres
OS: Linux
Bug
Consider the following code:
The update statement works, the asd column is ignored. The insert statement throws an error:
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
See above
Use case
Basically I stumbled upon this when trying to delete a field by setting it to undefined. Often when for example using the spread operator it is useful to delete fields that don't exist in the DB.
But it's of course also possible to delete the field beforehand. Either way, I think that the behavior should be consistent between insert/update.
The text was updated successfully, but these errors were encountered: