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

docs: use methods from expression builder callback instead of global instance #446

Conversation

rafaumlemos
Copy link
Contributor

Since Kysely is able to infer context correctly from a callback and provide increased type-safety (as explained here), I have decided to switch several use cases of expression builders to utilize callbacks instead of a global function.

@vercel
Copy link

vercel bot commented Apr 24, 2023

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 Jul 3, 2023 9:46pm

@igalklebanov igalklebanov added the documentation Improvements or additions to documentation label Apr 24, 2023
@igalklebanov
Copy link
Member

Hey 👋

Thanks!

Let's make sure it is aligned with the project's prettier configuration:

iirc having parenthesis around callback arguments.

(eb) => ...

@koskimas
Copy link
Member

koskimas commented Apr 24, 2023

There are also other issues with this PR. Please don't merge until I've reviewed it.

Here's a couple off the top of my head:

  1. We should still have examples of the global module usage. It's a matter of personal preference whether you want more type-safety or cleaner looking code.
  2. We should still have tests for the global module usage too. Now all those tests were removed.

@igalklebanov
Copy link
Member

@koskimas

We should still have tests for the global module usage too. Now all those tests were removed.

Yeah, aggregate function tests explicitly tested both modes. I thought it was pretty obvious. 🤷

@rafaumlemos
Copy link
Contributor Author

Hi,

  1. The parenthesis around the callback arguments have been fixed.
  2. Regarding the tests, what do you guys suggest? Should I revert all test changes and create specific ones for testing the callback usage?

Thanks!

@koskimas
Copy link
Member

koskimas commented May 3, 2023

Yeah, revert the test changes and this is good to go.

@rafaumlemos
Copy link
Contributor Author

@koskimas @igalklebanov

fixes applied

Copy link
Member

@igalklebanov igalklebanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@igalklebanov igalklebanov merged commit 1ec3dc3 into kysely-org:master Jul 3, 2023
4 checks passed
Gaspero pushed a commit to Gaspero/kysely that referenced this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants