Skip to content

Reproduce MSSQL Trigger bulkCreate Output Failure - #302

Open
klondikemarlen wants to merge 6 commits into
sequelize:mainfrom
klondikemarlen:mssql-trigger-bulk-create-334
Open

Reproduce MSSQL Trigger bulkCreate Output Failure#302
klondikemarlen wants to merge 6 commits into
sequelize:mainfrom
klondikemarlen:mssql-trigger-bulk-create-334

Conversation

@klondikemarlen

@klondikemarlen klondikemarlen commented Aug 14, 2026

Copy link
Copy Markdown

Context

A Sequelize v7 MSSQL model declares hasTrigger: true, but bulkCreate still emits an OUTPUT INSERTED clause that SQL Server rejects for a table with an enabled trigger. This PR is an executable SSCCE; per this repository’s README, it is intended to remain open as CI evidence rather than be merged.

Implementation

The branch pins @sequelize/core and @sequelize/mssql to the affected 7.0.0-alpha.48 release, configures the standalone MSSQL dialect, and creates one identity model plus a real AFTER INSERT trigger. bulkCreate then asserts its generated ID. The unused v6 template is removed so only the MSSQL v7 scenario runs. SQL Server 2022 startup uses its mssql-tools18 client with -C; this permits CI to reach the reproduction.

Screenshots

N/A — CLI/database reproduction.

Testing Instructions

  1. Open CI run 31762488431.
  2. In an MSSQL job on Node 18 or 20, confirm Run yarn start-mssql-latest succeeds.
  3. Confirm Execute SSCCE emits INSERT INTO [trigger_bulk_create_test] ([name]) OUTPUT INSERTED.[id], INSERTED.[name] VALUES (N'trigger test'); and SQL Server error 334.

Review and QA Status

PASS — local corepack yarn run start-mssql-latest reached a healthy database and passed the connection check. Local corepack yarn test:mssql reached the actual trigger and reproduced error 334 with the emitted SQL. The upstream CI run reproduced the same error in MSSQL 2017 and 2022 on Node 18 and 20 after successful database startup. corepack yarn test:sqlite skipped without loading a v6 template. git diff --check passed. The full matrix is red by design for the target reproduction and has unrelated legacy PostgreSQL failures.

Learner Coverage

No action — a database-specific third-party ORM defect does not indicate an OMP Learner capability gap.

A trigger-bearing model emits OUTPUT without INTO during bulk creation, causing SQL Server error 334. This SSCCE preserves the generated-ID assertion so CI independently captures the failure.
Pin the v7 core and standalone MSSQL dialect packages to the reported application version.
Translate the existing CI connection settings to Sequelize v7 alpha.48 and its standalone MSSQL dialect package.
Avoid optional chaining in the shared instance helper so Node 10 can skip the v7-only SSCCE before loading the alpha.48 runtime.
Use SQL Server 2022’s mssql-tools18 client and trust its self-signed local certificate for health checks and database bootstrap.
Keep CI focused on the v7 MSSQL trigger reproduction.
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

Successfully merging this pull request may close these issues.

1 participant