From 6d0b92b31a1de67262eb315c3a3cea46d184a4d4 Mon Sep 17 00:00:00 2001 From: robinsowell Date: Tue, 13 Jun 2023 16:00:55 -0400 Subject: [PATCH 1/2] Adding docs for straight join #3515 https://github.com/ExpressionEngine/ExpressionEngine/pull/3515 --- .../development/legacy/database/active-record.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/development/legacy/database/active-record.md b/docs/development/legacy/database/active-record.md index 936486e76..aca5ec5e2 100755 --- a/docs/development/legacy/database/active-record.md +++ b/docs/development/legacy/database/active-record.md @@ -162,7 +162,7 @@ NOTE: **Note:** As shown earlier, the `FROM` portion of your query can be specif | --------- | --------------------- | --------------------------------------------------------------------------------------------- | | \$table | `String` | The table to `JOIN` | | \$cond | `String` | The condition to join `ON` | -| \$type | `String` | The type of `JOIN` to perform: `LEFT`, `RIGHT`, `OUTER`, `INNER`, `LEFT OUTER`, `RIGHT OUTER` | +| \$type | `String` | The type of `JOIN` to perform: `LEFT`, `RIGHT`, `OUTER`, `INNER`, `LEFT OUTER`, `RIGHT OUTER` `STRAIGHT`| | Returns | `CI_DB_active_record` | The Active Record object | Permits you to write the `JOIN` portion of your query: @@ -406,6 +406,20 @@ Adds the `DISTINCT` keyword to a query: ee()->db->distinct(); ee()->db->get('table'); // Produces: SELECT DISTINCT * FROM table +### `straight([$val = TRUE])` + +| Parameter | Type | Description | +| --------- | --------------------- | ------------------------------------------------- | +| \$val | `Boolean` | _Optionally_ set to `FALSE` to disable `STRAIGHT` | +| Returns | `CI_DB_active_record` | The Active Record object | + +Adds the `STRAIGHT_JOIN` keyword to a query: + + ee()->db->straight(); + ee()->db->get('table'); // Produces: SELECT STRAIGHT_JOIN * FROM (`table1`) JOIN `table2` ON `table2`.`id` = `table1`.`acct` + +Individual tables can be straight joined by specifying in the join syntax. + ### `having($key[, $value = ''[, $escape = TRUE]])` | Parameter | Type | Description | From 74696834cbe2873195b83416281002fc3062fdcd Mon Sep 17 00:00:00 2001 From: robinsowell Date: Fri, 19 Apr 2024 13:30:47 -0400 Subject: [PATCH 2/2] Removed Straight keyword, leaving in join type straight --- docs/development/legacy/database/active-record.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/docs/development/legacy/database/active-record.md b/docs/development/legacy/database/active-record.md index aca5ec5e2..b01a4639c 100755 --- a/docs/development/legacy/database/active-record.md +++ b/docs/development/legacy/database/active-record.md @@ -406,20 +406,6 @@ Adds the `DISTINCT` keyword to a query: ee()->db->distinct(); ee()->db->get('table'); // Produces: SELECT DISTINCT * FROM table -### `straight([$val = TRUE])` - -| Parameter | Type | Description | -| --------- | --------------------- | ------------------------------------------------- | -| \$val | `Boolean` | _Optionally_ set to `FALSE` to disable `STRAIGHT` | -| Returns | `CI_DB_active_record` | The Active Record object | - -Adds the `STRAIGHT_JOIN` keyword to a query: - - ee()->db->straight(); - ee()->db->get('table'); // Produces: SELECT STRAIGHT_JOIN * FROM (`table1`) JOIN `table2` ON `table2`.`id` = `table1`.`acct` - -Individual tables can be straight joined by specifying in the join syntax. - ### `having($key[, $value = ''[, $escape = TRUE]])` | Parameter | Type | Description |