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

[Feature request] Add an option to ignore/remove @:primary/@:autoIncrement fields in INSERT queries #149

Open
cedx opened this issue Jun 2, 2022 · 0 comments

Comments

@cedx
Copy link
Member

cedx commented Jun 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant