You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add support for cross join (#1669)
* Add cross join support
* Add cross join tests
* Updated docs links (docs TBD)
* Merged cross join function types into join function types, fixed missing cases for `cross` join type, ordered `crossJoin` test queries
* `onIndex` support for `MySQL` `crossJoin`, fixed lack of `onIndex` param description in JSDoc, additional tests, disabled test case failing due to driver's issue
---------
Co-authored-by: Sukairo-02 <[email protected]>
* Export `PgTextBuilderInitial` type (#1286)
* MySQL: Removed .fullJoin() from MySQL Api (#1351)
Added new type MySqlJoinType which excludes the option for full joins and is used in the MySQL query builder createJoin function instead of the
regular JoinType.
Also removed two MySQL select type-tests which included the fullJoin function
Co-authored-by: Sukairo-02 <[email protected]>
* [Pg] Add support for left and inner lateral join in postgres (#1079)
* feat: added support for left and inner lateral join in postgres
Signed-off-by: Alex Vukadinov <[email protected]>
* chore: updated method descriptions on the new joins
Signed-off-by: Alex Vukadinov <[email protected]>
* GH-420 allowing sql inside lateral joins and revert package.json
* GH-420 reverted package.json empty line at the end
* Changed JSDoc [WIP], reversed check
---------
Signed-off-by: Alex Vukadinov <[email protected]>
Co-authored-by: Sukairo-02 <[email protected]>
* Completed `left`, `inner`, `cross` lateral joins in `postgresql`, `mysql`, `gel`, `singlestore`, disabled implicit `schema.table` prefixes in column selections on single table selections for `gel` due to possible errors in subqueries on column name matches in inner and outer queries, added\altered related tests
* [SingleStore] Add Connection Attributes and Fix Options (#4417)
* add connection attributes to SingleStore driver connection
* fix allowing connection strings/options rather than external pool
---------
Co-authored-by: Andrii Sherman <[email protected]>
* Fix for #2654, related tests (#4353)
* Dprint
* Bumped version, added changelog, fixed broken test case
* fix(3554) Correct spelling of `nowait` flag (#3555)
* Fixed `nowait` in `Gel`, `SingleStore`, added change to changelog
* Updated changelog
* Fixed broken test case
* Fixed `nowait` tests in `bun-sql`, `mysql-prefixed`
* Add changelog updates
---------
Signed-off-by: Alex Vukadinov <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Imhoff <[email protected]>
Co-authored-by: Itay Ben-Ami <[email protected]>
Co-authored-by: Alex Vukadinov <[email protected]>
Co-authored-by: Mitchell Adair <[email protected]>
Co-authored-by: Andrii Sherman <[email protected]>
Co-authored-by: Jacob Elder <[email protected]>
- Added drizzle connection attributes to `SingleStore`'s driver instances
6
+
7
+
## Fixes
8
+
9
+
- Removed unsupported by dialect `full join` from `MySQL` select api
10
+
- Forced `Gel` columns to always have explicit schema & table prefixes due to potential errors caused by lack of such prefix in subquery's selection when there's already a column bearing same name in context
11
+
- Added missing export for `PgTextBuilderInitial` type
12
+
- Removed outdated `IfNotImported` type check from `SingleStore` driver initializer
13
+
- Fixed incorrect type inferrence for insert and update models with non-strict `tsconfig`s \([#2654](https://github.com/drizzle-team/drizzle-orm/issues/2654)\)
14
+
- Fixed invalid spelling of `nowait` flag \([#3554](https://github.com/drizzle-team/drizzle-orm/issues/3554)\)
* Executes a `left join lateral` operation by adding subquery to the current query.
322
+
*
323
+
* A `lateral` join allows the right-hand expression to refer to columns from the left-hand side.
324
+
*
325
+
* Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null.
326
+
*
327
+
* See docs: {@link https://orm.drizzle.team/docs/joins#left-join-lateral}
328
+
*
329
+
* @param table the subquery to join.
330
+
* @param on the `on` clause.
331
+
*/
332
+
leftJoinLateral=this.createJoin('left',true);
314
333
315
334
/**
316
335
* Executes a `right join` operation by adding another table to the current query.
@@ -326,20 +345,20 @@ export abstract class GelSelectQueryBuilderBase<
326
345
*
327
346
* ```ts
328
347
* // Select all users and their pets
329
-
* const usersWithPets: { user: User | null; pets: Pet }[] = await db.select()
* Executes an `inner join lateral` operation, creating a new table by combining rows from two queries that have matching values.
394
+
*
395
+
* A `lateral` join allows the right-hand expression to refer to columns from the left-hand side.
396
+
*
397
+
* Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs.
398
+
*
399
+
* See docs: {@link https://orm.drizzle.team/docs/joins#inner-join-lateral}
400
+
*
401
+
* @param table the subquery to join.
402
+
* @param on the `on` clause.
403
+
*/
404
+
innerJoinLateral=this.createJoin('inner',true);
372
405
373
406
/**
374
407
* Executes a `full join` operation by combining rows from two tables into a new table.
@@ -384,20 +417,61 @@ export abstract class GelSelectQueryBuilderBase<
384
417
*
385
418
* ```ts
386
419
* // Select all users and their pets
387
-
* const usersWithPets: { user: User | null; pets: Pet | null }[] = await db.select()
420
+
* const usersWithPets: { user: User | null; pets: Pet | null; }[] = await db.select()
388
421
* .from(users)
389
422
* .fullJoin(pets, eq(users.id, pets.ownerId))
390
423
*
391
424
* // Select userId and petId
392
-
* const usersIdsAndPetIds: { userId: number | null; petId: number | null }[] = await db.select({
425
+
* const usersIdsAndPetIds: { userId: number | null; petId: number | null; }[] = await db.select({
393
426
* userId: users.id,
394
427
* petId: pets.id,
395
428
* })
396
429
* .from(users)
397
430
* .fullJoin(pets, eq(users.id, pets.ownerId))
398
431
* ```
399
432
*/
400
-
fullJoin=this.createJoin('full');
433
+
fullJoin=this.createJoin('full',false);
434
+
435
+
/**
436
+
* Executes a `cross join` operation by combining rows from two tables into a new table.
437
+
*
438
+
* Calling this method retrieves all rows from both main and joined tables, merging all rows from each table.
439
+
*
440
+
* See docs: {@link https://orm.drizzle.team/docs/joins#cross-join}
0 commit comments