Commit graph

106 commits

Author SHA1 Message Date
Arjen Brouwer
d3ada5361e Add support for postgres arrays 2025-10-16 13:32:18 +02:00
Mathieu Kooiman
6cabfcdc1a feat: expose CustomExpression+Token in mysql/postgres/sqlite 2024-07-13 17:10:26 +02:00
Karl Blomster
1d310624d8
Export BinaryOperator function 2024-03-26 15:49:17 +01:00
go-jet
39de87671e Additional tests for 'ON CONFLICT DO NOTHING without conflict target does not appear in generated SQL' bug. 2024-03-24 13:02:23 +01:00
bill matlock
0d250f5b41 ON CONFLICT DO NOTHING without a conflict target is valid SQL as far as Postgres is concerned. 2024-03-18 16:38:28 -04:00
go-jet
43fc77ba99 Range expression update
* Add Int4 and Int8 integer expression to distinguish int4range and int8range types
* Add range functions to range expressions to avoid go template appearing in sql
* Compact range integration tests and add range update tests
2024-02-27 10:48:57 +01:00
Sarkan
893567daca
Range types implemented
plus and minus infinity keyword tests implemented

range table tests added

skip cockroach db added

select test case added for range fields

generator modified to generate correct types

generator tests modified to include sample range table

model and template generators modified to support range fields

returning the T in UPPER and LOWER functions

raw ranges implemented

bounds set as optional

dep modified

dependencies modified and issue fixed

range expression with templates implemented

rangeExpression change to make it more type safe

third parameter of constructor function fixed

literals removed, functions added

tests modified

constructor functions used for creating range expressions

NumRange converted to a constructor function from literal

range_lower and range_upper renamed to lower_bound and upper_bound

range literal removed

PlusInfinity and MinusInfinity implemented

int4 and int8 castings added

issues fixed and tests checked

number, ts, tstz literal and cast implemented

date range literal expression modified and raw function used

parent type converted from RangeExpression to Expression

range type implemented for postgres

range column type, function and literal expression implemented

CONTAINS and OVERLAP operations added for range expressions

range expressions implemented
2024-02-25 01:20:36 +01:00
go-jet
255f4a8eaf Add support for expression in OFFSET clause. 2024-02-13 14:01:13 +01:00
go-jet
e51ddd5506 Add support for FETCH FIRST clause. 2024-02-07 11:07:50 +01:00
Matthew Dowdell
f16f0b5e5d Add support for OF in row lock clauses
This adds support for statements such as `SELECT ... FOR UPDATE OF table NOWAIT` where `OF table`
could not be specified previously. Fixes #285.
2023-11-30 07:52:54 +00:00
go-jet
d7a5adb239 Break utils package into subpackages. 2023-07-21 14:11:31 +02:00
go-jet
0a7e0b5392 Expose internal RawBool type 2023-04-17 12:46:11 +02:00
go-jet
a428981a2d Expose internal jet.Rows type 2023-04-17 12:01:01 +02:00
go-jet
fa69565dbf Add support for postgres GROUPING SET, ROLLUP and CUBE grouping operators
Add support for mysql WITH ROLLUP grouping operator
Add support for GROUPING operator
2023-03-28 13:16:57 +02:00
go-jet
f772f90336 [MySQL] Optimizer hints 2022-09-29 13:33:00 +02:00
go-jet
c9967d151e
Merge pull request #175 from Hoonyyhoon/fix/add_omitted
fix: Add omitted reserved word 'RIGHT' on postgresql
2022-09-07 10:43:41 +02:00
Stefan
16c9ee428e Add omitted reserved word 'right' on postgresql 2022-09-07 00:54:40 +09:00
go-jet
a2ea1892e5 Go fmt. 2022-08-23 12:38:16 +02:00
Vladimír Zahradník
11b0a6858a Better json func, and tests 2022-06-04 14:22:33 +02:00
Vladimír Zahradník
0425e8895c add postgres json literal 2022-06-04 14:12:08 +02:00
go-jet
c38d2fd2c3 Update README.md 2022-05-16 11:51:47 +02:00
go-jet
2101088d0e Add support for EXTRACT time/date function. 2022-05-06 11:54:44 +02:00
go-jet
bc776f947b Add support for CockorachDB. 2022-05-05 13:01:42 +02:00
go-jet
9f91fd705a Global AND and OR functions for better indentation of a complex condition in the Go code and in the generated SQL. 2022-02-11 13:09:49 +01:00
go-jet
34f84c7170 Rename SetQueryLoggerFunc to SetQueryLogger 2022-01-20 16:51:32 +01:00
go-jet
605f1c8e3d [Postgres] Add order set aggregate functions support. 2022-01-18 19:18:00 +01:00
go-jet
4955bfc4b5 Add automatic query logger function with additional execution details. 2022-01-12 19:03:50 +01:00
go-jet
7377e078cd Skip complex expression parenthesis wrap for function parameters. 2022-01-10 16:57:57 +01:00
go-jet
a506a96d6a Add DISTINCT operator support 2022-01-10 16:43:17 +01:00
go-jet
6fe9c26d30 [Postgres] Add support for DISTINCT ON clause. 2022-01-06 18:11:26 +01:00
go-jet
038a32b032 Add WITH RECURSIVE statement support 2022-01-04 18:08:06 +01:00
go-jet
001d64f1dc Add BETWEEN operator support. 2022-01-04 17:58:10 +01:00
go-jet
01305a138f Add automatic type cast for integer literals
In parameterized statements integer literals, like Int(num), are replaced with a placeholders. For some expressions,
postgres interpreter will not have enough information to deduce the type. If this is the case postgres returns an error.
Int8, Int16, Int32.... functions now will add automatic type cast over a placeholder, so type deduction is always possible.
2021-12-26 17:29:43 +01:00
go-jet
47545ce571 Add WITH RECURSIVE support. 2021-12-26 11:34:57 +01:00
go-jet
60ffd004c5 Add USING clause support for DELETE statements 2021-12-08 18:14:57 +01:00
go-jet
72e8d7d584 Add FROM clause support for UPDATE statements 2021-12-08 18:13:58 +01:00
go-jet
d197956271 Avoid unnecessary double wrapping of SELECT statement when used as single function parameter. 2021-10-21 13:40:26 +02:00
go-jet
22b2901336 Move RETURNING clause to internal/jet so it can be reused for sqlite implementation. 2021-10-21 13:40:26 +02:00
go-jet
3015b79926 Add test for - Special characters are not working in postgres password(for generator)
https://github.com/go-jet/jet/issues/95
2021-10-04 10:48:07 +02:00
mlaflamm
c47d79ffd7 export GroupByClause type through alias 2021-07-29 09:51:55 -04:00
go-jet
caa81930dc Reset FROM clause list before new values are set. 2021-05-21 16:25:26 +02:00
go-jet
38541522e6 Fix linter errors 2021-05-16 19:10:43 +02:00
go-jet
a5b7769589 Add RawStatement support
RawStatement method creates new sql statements from raw query and optional map of named arguments.
2021-05-15 11:54:41 +02:00
go-jet
7af9072b8d Allow Raw helper to accept named arguments 2021-05-14 12:15:35 +02:00
go-jet
9385f462df Allow Bytea literal constructor to accept byte array.
Bytea literal constructor now accepts string or []byte a a parameter.
2021-05-12 12:29:22 +02:00
go-jet
f30cbb9e89 Add UUID helper function
UUID creates string literal expression from uuid object.
uuid can be any uuid type with a String method.
2021-05-11 13:20:07 +02:00
go-jet
92d02fef78 Add DECIMAL constructor for Float literal.
DECIMAL constructor is used to pass a decimal number to the SQL query without precision loss.
2021-05-09 16:25:54 +02:00
go-jet
0f773b26d6 Add LATERAL query support 2021-05-03 19:47:03 +02:00
go-jet
4ef0113f6b Add implicit cross join support 2021-05-03 18:48:15 +02:00
go-jet
0cba1f6401 Lateral - initial commit. 2021-04-30 14:02:49 +02:00