Skip to content

Commit

Permalink
Add test case for bulk upsert automatic key error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Scheurer committed May 29, 2024
1 parent c8b54c3 commit 302407e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/sscce-sequelize-6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export async function run() {
const sequelize = createSequelize6Instance({
logQueryParameters: true,
benchmark: true,
define: {
// For less clutter in the SSCCE
timestamps: false,
},
});

class Foo extends Model {}

Foo.init({
name: DataTypes.TEXT,
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
}, {
sequelize,
modelName: 'Foo',
Expand All @@ -36,6 +36,9 @@ export async function run() {
await sequelize.sync({ force: true });
expect(spy).to.have.been.called;

console.log(await Foo.create({ name: 'TS foo' }));
expect(Foo.bulkCreate(
[{ id: 'e8388762-1daa-11ef-b9f0-b7d47c40e7e3' }],
{ updateOnDuplicate: ['createdAt'] }
)).to.eventually.not.be.rejected();

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mariadb latest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mariadb oldest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mariadb latest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mssql oldest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mysql oldest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mariadb latest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mariadb oldest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mysql oldest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (native) (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mariadb oldest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mysql oldest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mysql latest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mssql latest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mysql latest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mssql oldest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mssql latest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mssql latest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mysql latest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / mssql oldest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (Node 10) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (Node 10) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (native) (Node 10) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (Node 18) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (Node 18) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (Node 20) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (native) (Node 18) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (native) (Node 10)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (native) (Node 18)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (native) (Node 10) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (native) (Node 18) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (native) (Node 20)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres latest (native) (Node 20) (minified aliases)

Expected 1-2 arguments, but got 0.

Check failure on line 42 in src/sscce-sequelize-6.ts

View workflow job for this annotation

GitHub Actions / postgres oldest (native) (Node 18)

Expected 1-2 arguments, but got 0.
expect(await Foo.count()).to.equal(1);
}

0 comments on commit 302407e

Please sign in to comment.