Skip to content

Commit

Permalink
Expression builder v2 (#565)
Browse files Browse the repository at this point in the history
* Make expression builder callable.

This commit also removes the deprecated filter methods. It wasn't possible to keep them
and have the combined expression builder + query builder monster be callable.

* Add chainable ands and ors to expression builder

* Update src/expression/expression-builder.ts

Co-authored-by: Igal Klebanov <[email protected]>

* Update src/expression/expression-wrapper.ts

Co-authored-by: Igal Klebanov <[email protected]>

* Update src/expression/expression-wrapper.ts

Co-authored-by: Igal Klebanov <[email protected]>

* fix confusing join expression test

* consistent language

---------

Co-authored-by: Igal Klebanov <[email protected]>
  • Loading branch information
koskimas and igalklebanov authored Jul 7, 2023
1 parent 454695c commit b23844b
Show file tree
Hide file tree
Showing 43 changed files with 1,158 additions and 2,340 deletions.
7 changes: 3 additions & 4 deletions src/dialect/postgres/postgres-introspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ export class PostgresIntrospector implements DatabaseIntrospector {
.as('auto_incrementing'),
])
// r == normal table
.where(({ cmpr, or }) => or([
cmpr('c.relkind', '=', 'r'),
cmpr('c.relkind', '=', 'v'),
]))
.where((eb) =>
eb.or([eb('c.relkind', '=', 'r'), eb('c.relkind', '=', 'v')])
)
.where('ns.nspname', '!~', '^pg_')
.where('ns.nspname', '!=', 'information_schema')
// No system columns
Expand Down
2 changes: 1 addition & 1 deletion src/dynamic/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class DynamicModule {
*
* const [person] = await db.selectFrom('person')
* .select([
* ref<PossibleColumns>(columnFromUserInput),
* ref<PossibleColumns>(columnFromUserInput),
* 'id'
* ])
* .execute()
Expand Down
Loading

1 comment on commit b23844b

@vercel
Copy link

@vercel vercel bot commented on b23844b Jul 7, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

kysely – ./

kysely.dev
kysely-git-master-kysely-team.vercel.app
www.kysely.dev
kysely-kysely-team.vercel.app

Please sign in to comment.