-
Notifications
You must be signed in to change notification settings - Fork 238
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: add safe empty where in plugin #925
base: master
Are you sure you want to change the base?
feat: add safe empty where in plugin #925
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.transformer.ts
Outdated
Show resolved
Hide resolved
await db.schema.dropTable('safeEmptyArrayPerson').ifExists().execute() | ||
await createTableWithId(db.schema, dialect, 'safeEmptyArrayPerson') | ||
.addColumn('firstName', 'varchar(255)') | ||
.execute() | ||
|
||
await db | ||
.insertInto('safeEmptyArrayPerson') | ||
.values([ | ||
{ | ||
firstName: 'John', | ||
}, | ||
{ | ||
firstName: 'Mary', | ||
}, | ||
{ | ||
firstName: 'Tom', | ||
}, | ||
]) | ||
.execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need a special table for this suite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the convention in this project? im doing this just so to avoid collisions with other tests suites if things are run in parallel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things are not run in parallel. Each suite creates and destroys everything.
let result = await query.execute() | ||
|
||
expect(result).to.deep.equal([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to execute really, testing the compiled sql is more than enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should execute to make sure there are no run-time errors, which was the case before.
let result = await query.execute() | ||
|
||
expect(result).to.have.length(2) | ||
expect(result).to.deep.equal([ | ||
{ firstName: 'John' }, | ||
{ firstName: 'Mary' }, | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to execute really, testing the compiled sql is more than enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we opt to keep to test for runtime errors?
let result = await query.execute() | ||
|
||
expect(result).to.deep.equal([new DeleteResult(BigInt(0))]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to execute really, testing the compiled sql is more than enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, can i leave it here since its already there? Would be good for us to know side-effects if any for results as well.
@igalklebanov ive addressed all of the PR comments, could i check if this is ready to be merged? |
src/plugin/safe-empty-array-where-in/safe-empty-array-where-in.plugin.ts
Outdated
Show resolved
Hide resolved
@austinwoon CI seems to run forever, can you check this? |
This problem seems to not be from my PR. I checked out could you check on this? |
Addresses concerns #709 with a plugin.