Commit Graph

100 Commits

Author SHA1 Message Date
Jinzhu 4d6b70ec88 Allow modify statement from dest 2023-02-02 17:15:08 +08:00
jessetang f82e9cfdbe
test(clause/joins): add join unit test (#5832) 2022-11-03 21:03:13 +08:00
robhafner e8f48b5c15
fix: limit=0 results (#5735) (#5736) 2022-10-07 20:14:14 +08:00
Wen Sun 9564b82975
Fix OnConstraint builder (#5738) 2022-10-07 13:46:20 +08:00
Clark McCauley 540fb49bcb
Fixed #5355 - Named variables don't work when followed by Windows CRLF line endings (#5356)
* Fixed #5355.

* Fixed unit test to test both CRLF and CR line endings
2022-05-22 15:16:01 +08:00
Mikhail Faraponov 2990790fbc
Use WriteByte for single byte operations (#5167)
Co-authored-by: Mikhail Faraponov <mikefaraponov@Mikhails-MacBook-Pro.local>
2022-03-17 22:54:30 +08:00
sammyrnycreal 5edc78116f Fixed the use of "or" to be " OR ", to account for words that contain "or" or "and" (e.g., 'score', 'band') in a sql statement as the name of a field. 2022-02-20 08:22:21 +08:00
Jinzhu cec0d32aec Support use clause.Expression as argument 2022-01-28 18:48:32 +08:00
kinggo b47cf57f5e
ci: add gofumpt check in reviewdog (#4973) 2022-01-06 15:02:53 +08:00
kinggo 8dde09e0be
fix: generate sql incorrect when use soft_delete and only one OR (#4969)
* fix: generate sql incorrect when use soft_delete and only one OR
2021-12-30 11:47:14 +08:00
Emre Güllü 2c3fc2db28
Fix: Where clauses with named arguments may cause generation of unintended queries (#4937) 2021-12-21 19:50:00 +08:00
Jinzhu 45e804dd3f Fix call valuer interface when using nil value 2021-11-29 16:19:11 +08:00
Jinzhu e1b4c066a8 Fix FullSaveAssociations, close #4874 2021-11-29 11:02:44 +08:00
Jinzhu b8f33a42a4
Add unused argument (#4871)
* Append unused argument to gorm statement
2021-11-23 17:11:52 +08:00
Jinzhu 835d7bde59 Add returning support to delete 2021-10-28 07:56:55 +08:00
Jinzhu af3fbdc2fc Improve returning support 2021-10-26 22:40:14 +08:00
River 851fea0221
fix: QuoteTo not fully support raw mode (#4735)
* fix: QuoteTo not fully support raw mode

* fix: table alias without AS

* test: clause.Column/Table quote test

* fix: revert table alias quote
2021-09-29 14:02:35 +08:00
Jim 5202529ea1
fix (clause/expression): Allow sql stmt terminator (#4693)
Allow the sql stmt terminator ";" at the end of a named parameter.

Example: select * from table_name where name == @name;
2021-09-20 21:40:48 +08:00
Sec Cake 093694fbf2
Fix extra 'AND' when len(values) == 0 ON IN.NegationBuild() (#4618) 2021-08-20 18:06:48 +08:00
River 25f561a742
feat: QuoteTo accept clause.Expr (#4621)
* feat: QuoteTo accept clause.Expr

* test: update Expr build test
2021-08-19 14:33:18 +08:00
River ac97aec513
New Comma Expression (#4524)
* Add new comma expression

* Add comma expression unit test
2021-07-14 15:51:24 +08:00
Jinzhu 76cd73cb82 Fix wipes out MySQL global variables from the query, close #4515 2021-07-13 18:48:43 +08:00
Vitaliy Shein dd8bf88eb9
add Target where clause for on conflict (#4442)
Co-authored-by: Vitaliy Shein <vitaliy.shein@thebricks.com>
2021-06-07 10:39:00 +08:00
Jinzhu 9abac96546 Fix Eq, Neq support slice of data 2021-05-31 17:21:27 +08:00
Jinzhu 14e96080d8 Eq, Neq support slice of data 2021-05-31 15:25:38 +08:00
Karolos Lykos f0d0bbbc10
Added missing white space (#4330)
* Added missing white space

* Added missing white space

* Added missing white space
2021-04-29 07:15:37 +08:00
Jinzhu 33601dc72f Support Having w/o Group 2021-03-30 18:28:09 +08:00
Ratan Phayade a3abb5fedf
support named params in Select API (#4142)
* adds support for named arguments in select

* changes clause identifies and adds test
2021-03-07 10:59:00 +08:00
Jinzhu 90476fea7a Fix Join with slice IN, close #4133 2021-03-04 18:40:47 +08:00
Jinzhu a13b7a6acb Fix OnConflict where order for postgres, close #4073 2021-02-10 14:11:29 +08:00
Jinzhu 435bf70865 Add OnConflict OnConstraint support, close #3882 2021-01-05 21:31:51 +08:00
Philip Sahli 9b8d3b3a0f
fix typo (#3911) 2021-01-04 11:30:05 +08:00
Jinzhu 6c0ee2700a Allow to use Valuer with Eq expression, #3899 2020-12-30 10:42:13 +08:00
vellotis 51b5208599
Fix building of `clause.Eq` and `clause.Neq` expressions that fail to handle `(*T)(nil)` use cases correctly (#3848)
* Update tests to cover building `clause.Eq` and `clause.Neq` when value could be a nil pointer of a primitive

* Fix use cases for `clause.Eq` and `clause.Neq` when value is nil pointer of a primitive type
2020-12-11 14:07:23 +08:00
Jinzhu 694e42d6a1 Fix clause.IN with only one value of multiple rows 2020-11-17 19:11:24 +08:00
Jinzhu 62be27d3ca Add OnConflict UpdateAll support 2020-11-16 20:22:08 +08:00
LeoZhan 832abda7a4
refactor: simplify the writing instead of using struct literal (#3728) 2020-11-08 09:41:43 +08:00
Jinzhu c915471169 Support Expression for OrderBy clause 2020-11-03 10:30:05 +08:00
Jinzhu 9b2181199d Fix soft delete with OrCondition, close #3627 2020-10-19 14:50:11 +08:00
Jinzhu 08ecef8e0b Fix NamedArguments with nested struct, close #3596 2020-10-13 15:32:29 +08:00
Jinzhu c9165fe3ca Don't panic when using unmatched vars in query, close #3488 2020-09-18 21:42:27 +08:00
Jinzhu d002c70cf6 Support named argument for struct 2020-09-17 21:52:41 +08:00
Jinzhu e583dfa196 Allow negative number for limit 2020-09-11 11:54:21 +08:00
Jinzhu 2242ac6c0e Fix tests & refactor for PR #3429 2020-09-09 10:31:48 +08:00
caelansar aceb3dad3b correct generated sql 2020-09-08 21:28:04 +08:00
Jinzhu 680dda2c15 Fix combine conditions when using string conditions, close #3358 2020-09-02 20:09:51 +08:00
Jinzhu 496db1f13e Fix named argument with multiple line SQL, fix #3336 2020-08-31 15:45:56 +08:00
Jinzhu 362779575c Fix Select with specific symbol, close #3157 2020-07-17 11:24:24 +08:00
Jinzhu 4456df7a5d Lint with golangci-lint 2020-07-16 11:27:12 +08:00
Jinzhu 72a64bef11 Don't merge clause From 2020-07-15 10:25:10 +08:00