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

feat: migrate bulkInsertQuery & insertQuery to ts #16988

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lohart13
Copy link
Contributor

@lohart13 lohart13 commented Jan 24, 2024

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description Of Change

Migrates bulkInsertQuery & insertQuery to typescript.
Also fixes Db2 and SQLite returning options for insert and update (SQLite only) statements.

SQLite has had bigint support disabled which will be a breaking change.

Todos

  • Look at using Tedious bulkLoad for mssql.

@lohart13
Copy link
Contributor Author

Due to the sqlite3 package returning bigint's as JS numbers, the SQLite tests are always going to fails.

The better-sqlite3 does support bigint, is it worth switching to this package?

I notice there has been some discussion in #11400, is it worth taking this forward now?

@WikiRik
Copy link
Member

WikiRik commented Jan 24, 2024

Due to the sqlite3 package returning bigint's as JS numbers, the SQLite tests are always going to fails.

The better-sqlite3 does support bigint, is it worth switching to this package?

I notice there has been some discussion in #11400, is it worth taking this forward now?

The current plan was to look into supporting both adapters in v8 when we split dialects from core. So we would have @sequelize/sqlite3 and @sequelize/better-sqlite3 packages. I don't think we'll need to revisit this for v7, we already have enough breaking changes for users.

I think for this PR it is fine if we disable bigints for sqlite, with a mention to TryGhost/node-sqlite3#1058 (or the related PR 1501 or related issue 922 which was opened by a former sequelize maintainer)

@lohart13
Copy link
Contributor Author

Due to the sqlite3 package returning bigint's as JS numbers, the SQLite tests are always going to fails.
The better-sqlite3 does support bigint, is it worth switching to this package?
I notice there has been some discussion in #11400, is it worth taking this forward now?

The current plan was to look into supporting both adapters in v8 when we split dialects from core. So we would have @sequelize/sqlite3 and @sequelize/better-sqlite3 packages. I don't think we'll need to revisit this for v7, we already have enough breaking changes for users.

I think for this PR it is fine if we disable bigints for sqlite, with a mention to TryGhost/node-sqlite3#1058 (or the related PR 1501 or related issue 922 which was opened by a former sequelize maintainer)

Ok, makes sense.
I've disabled BIGINT support for SQLite which should allow the tests to pass.

@lohart13 lohart13 force-pushed the insert-ts branch 3 times, most recently from 9791df0 to 4fe4828 Compare February 1, 2024 22:41
@lohart13 lohart13 force-pushed the insert-ts branch 2 times, most recently from a2c0e18 to 17fa3fd Compare February 8, 2024 08:50
@ephys
Copy link
Member

ephys commented Feb 10, 2024

There is some common changes between this PR and the update PR. Would you prefer I focused on review this one first, or the other one? A lot of the legacy code I'd like to clean up applies to both PRs

@lohart13
Copy link
Contributor Author

There is some common changes between this PR and the update PR. Would you prefer I focused on review this one first, or the other one? A lot of the legacy code I'd like to clean up applies to both PRs

Focus on #17063.

@sequelize-bot sequelize-bot bot added the conflicted This PR has merge conflicts and will not be present in the list of PRs to review label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicted This PR has merge conflicts and will not be present in the list of PRs to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants