I query an SQL Server instance through a MariaDB server (more on this: #133).
When we call insertOne or insertMany methods, the generated SQL query use a NULL value for @:primary/@:autoIncrement fields (of course, if these fields are not filled in).
This is fine with MySQL/MariaDB: the server understands that we want to trigger the AUTO_INCREMENT behavior. But this fails with SQL Server which does not allow an autoincremented field (i.e. an IDENTITY one) to be specified in the SQL query.
It would be very handy if we had an option in insertOne and insertMany methods, or a dedicated metadata (@:ignoreOnInsert ? @:ignoreOnNull ?), to ignore/remove these fields in the generated SQL query.
I query an SQL Server instance through a MariaDB server (more on this: #133).
When we call
insertOne
orinsertMany
methods, the generated SQL query use aNULL
value for@:primary
/@:autoIncrement
fields (of course, if these fields are not filled in).This is fine with MySQL/MariaDB: the server understands that we want to trigger the
AUTO_INCREMENT
behavior. But this fails with SQL Server which does not allow an autoincremented field (i.e. anIDENTITY
one) to be specified in the SQL query.It would be very handy if we had an option in
insertOne
andinsertMany
methods, or a dedicated metadata (@:ignoreOnInsert
?@:ignoreOnNull
?), to ignore/remove these fields in the generated SQL query.