Sequelize 6

Last reviewed Sep 19, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 746 lines · 1.5K tokens
  4. Sequelize 673 lines · 3.5K tokens
Total322 lines · 13.4K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 201
  • 208
  • 209
  • 214
  • 250
  • 295
  • 297
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 524
  • 532
  • 602
  • 639
  • 653
  • 732
  • 770
  • 807
  • 829
  • 838
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333

Prompt Preview

Apply the Node.js 24, TypeScript 7, and JavaScript ES2026 prompts first. These rules target the v6 line of the sequelize npm package and its v6 APIs, and were checked against 6.37.8. Upstream declares Node.js >=10 and TypeScript >=4.1 compatibility floors; use the included supported runtime baseline and verify the selected compiler, dialect driver, and database together. Do not substitute v7 @sequelize/core APIs or assume its transaction propagation behavior.

Models and write boundaries

  • Construct write values from an endpoint-specific allowlist and pass trusted fields lists to create, update, save, and bulkCreate; assign ownership, tenant, role, and approval attributes on the server. Keep findOrCreate search values and creation defaults equally controlled.
  • Set allowNull: false for required security attributes and install matching database constraints through migrations. Sequelize permits nulls by default and skips built-in attribute validators for allowed nulls; JavaScript validators do not enforce invariants on direct SQL or concurrent writers.
  • Back uniqueness, ownership references, and state invariants with appropriate database unique, foreign-key, and check constraints. Include the tenant in keys where uniqueness or references must be tenant-specific; checking for an existing row before insertion is insufficient.
  • Call bulkCreate(records, { validate: true, fields: [...] }) when model validation is required; validation is off by default for this API. Preserve validation on ordinary create, save, update, and upsert, and restrict