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: add safe empty where in plugin #925

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

austinwoon
Copy link

Addresses concerns #709 with a plugin.

Copy link

vercel bot commented Mar 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 1, 2024 2:30pm

@igalklebanov igalklebanov added enhancement New feature or request built-in plugin Related to a built-in plugin labels Mar 30, 2024
Comment on lines 42 to 60
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()
Copy link
Member

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?

Copy link
Author

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

Copy link
Member

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.

Comment on lines 105 to 107
let result = await query.execute()

expect(result).to.deep.equal([])
Copy link
Member

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.

Copy link
Author

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.

Comment on lines 195 to 201
let result = await query.execute()

expect(result).to.have.length(2)
expect(result).to.deep.equal([
{ firstName: 'John' },
{ firstName: 'Mary' },
])
Copy link
Member

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.

Copy link
Author

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?

Comment on lines 287 to 289
let result = await query.execute()

expect(result).to.deep.equal([new DeleteResult(BigInt(0))])
Copy link
Member

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.

Copy link
Author

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.

@austinwoon
Copy link
Author

@igalklebanov ive addressed all of the PR comments, could i check if this is ready to be merged?

@igalklebanov
Copy link
Member

@austinwoon CI seems to run forever, can you check this?

@austinwoon
Copy link
Author

@austinwoon CI seems to run forever, can you check this?

This problem seems to not be from my PR. I checked out master and also have a pending test that never stops running. The pipeline looks to be similar as well from the latest run.

could you check on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
built-in plugin Related to a built-in plugin enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants