Commit Graph
43 Commits
Author SHA1 Message Date
Huan Du 827392d26d fix #186: use args in LIMIT and/or OFFSET expression 2025-01-26 15:06:21 +08:00
Huan Du 75c6f8c1e4 implement CTEBuilder 2024-07-06 23:58:26 +08:00
Huan Du 76f1e16370 add sample to show how to build JOIN with Struct 2024-04-24 02:52:38 +08:00
zhangyongding e4c1e6d0e0 The ForeachRead function add isQuoted input parameters 2023-08-09 14:07:32 +08:00
zhangyongding 3c091eb813 add func for foreach tags 2023-08-08 11:07:34 +08:00
zhangyongding 096b0896e9 supports custom DBTag content 2023-07-25 09:13:42 +08:00
Huan Du ca5bb168f8 update test cases and examples for better coverage 2023-02-27 10:13:49 +08:00
Huan Du 42130d3b3a refs #60. more flexibility to filter fields with WithTag and WithoutTag in Struct 2023-02-27 00:59:49 +08:00
Spencer Connaughton 8880301f5b Merge remote-tracking branch 'upstream/master'
# Conflicts:
#	README.md
#	args.go
#	flavor.go
#	insert_test.go
#	interpolate.go
#	interpolate_test.go
#	select_test.go
#	struct.go
#	struct_test.go
2023-01-05 10:19:05 -05:00
39a4b2509b Merge remote-tracking branch 'upstream/master' (#2)
* ignore unexported fields that are not embedded structs

* fix #74 [BREAKING CHANGE] Select#GroupBy and Select#OrderBy behavior change.

Previous, GroupBy and OrderBy only keep the columns in the last call. Now, all columns are kept.

* fix #75 add Struct#Columns/ColumnsForTag and Struct#Values/ValuesForTag

* remove a call to StructField.IsExported as it is not in go1.13

* refs #78 add new `fieldas` tag to set AS name for SELECT

* update docs

* fix #81 refactory struct field parser to make fieldas correct in all cases

* Add Gitter badge

* Fix insert ignore for postgres and sqlite.

* fix test

Co-authored-by: MichaÅ‚ Dobaczewski <[email protected]>
Co-authored-by: Huan Du <[email protected]>
Co-authored-by: The Gitter Badger <[email protected]>
Co-authored-by: Zhong Ren <[email protected]>
2022-11-30 10:57:35 -05:00
Huan Du 61a65cedc6 support driver.Valuer type in Struct and interpolate methods 2022-11-24 16:33:48 +08:00
Spencer ConnaughtonandGitHub 0f54cd520c Add CQL support (#1)
* Add CQL flavor.

* Add support for CQL argument compilation.

* Adopt substests for interpolation tests.

* Add support for CQL interpolation.

* Add support for CQL blobs.

https://docs.datastax.com/en/cql-oss/3.x/cql/cql_reference/blob_r.html

* Add CQL timestamp interpolation support.

https://docs.datastax.com/en/cql-oss/3.x/cql/cql_reference/timestamp_type_r.html

* Add builder test for CQL.

* Add support for the NOW function.

https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/timeuuid_functions_r.html?hl=now

* Add support for CQL update IF statement.

https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/cqlUpdate.html#Conditionallyupdatingcolumns

* Drop table prefixes for CQL SELECTs.

* Switch to single quoting for CQL queries.

https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/escape_char_r.html

* Update documentation.

* Use valid CQL in tests.

* Support CQL LIMIT.
2022-09-08 14:39:35 -04:00
Huan Du e6e16111d3 fix #81 refactory struct field parser to make fieldas correct in all cases 2022-09-04 00:09:09 +08:00
Huan Du 72a87cb0b7 refs #78 add new fieldas tag to set AS name for SELECT 2022-07-21 22:14:43 +08:00
Huan Du 0304f8a109 fix #75 add Struct#Columns/ColumnsForTag and Struct#Values/ValuesForTag 2022-06-25 15:07:58 +08:00
Huan DuandGitHub c4f15543da Merge pull request #73 from MDobak/master
Ignore unexported fields that are not embedded structs
2022-06-23 13:24:50 +08:00
Huan Du 20431a834c merge 2022-06-23 13:14:18 +08:00
Huan Du d444898018 fix #74 [BREAKING CHANGE] Select#GroupBy and Select#OrderBy behavior change.
Previous, GroupBy and OrderBy only keep the columns in the last call. Now, all columns are kept.
2022-06-23 12:50:48 +08:00
Michał Dobaczewski c1d29073e0 ignore unexported fields that are not embedded structs 2022-06-07 13:15:06 +02:00
Aleksander Zaruczewski 157445026c Fix warnings and typos 2022-02-17 16:07:23 +03:00
Huan Du 1bb5856684 fix #65 Struct#InsertInto* methods are aware of omitempty options now 2021-07-25 15:34:47 +08:00
Huan Du 9d74991669 fix #59 support field mapper for Struct 2021-02-21 20:18:09 +08:00
Lluis Toyos 8dfc8a45ae Fix Error: tags now are trimmed 2020-10-30 13:10:21 +01:00
Lluis Toyos edc8d5dfb6 changes suggested by Huan du (just minor fix on tests) 2020-10-29 17:57:52 +01:00
Lluis Toyos 840ad7d339 changes suggested by Huan du 2020-10-29 17:40:23 +01:00
Lluis Toyos bd0b043b6a Adding Tests for omitempty_for_TAG 2020-10-25 16:34:50 +01:00
Huan Du 5a841c3555 refs #40. add table name as col prefix in Struct#SelectFrom/SelectFromTag 2019-11-21 14:46:19 +08:00
sunzheng 414da2d9ea refactory and rm useless code 2019-11-11 16:14:28 +08:00
sunzheng 728429d745 add replaceInto and replaceIntoForTag and its tests 2019-11-10 19:03:06 +08:00
sunzheng ddd5057cb7 add insert_ignore and insert_ignore_for_tag and its tests 2019-11-10 18:43:51 +08:00
Sergio Checa Blanco c8c78f7826 update struct with missing pointer values 2019-07-13 22:43:38 +02:00
Huan Du 015f032529 add a new fieldopt "omitempty" 2019-03-20 00:18:57 +08:00
Huan Du 1a61b6d200 fix #9. remove the limit set in Struct#SelectFrom. 2018-03-15 20:23:40 +08:00
Huan Du c5133ff161 support quote in Struct 2018-02-22 22:08:57 +08:00
Huan Du e219582f5a fix #6. support Postgre-flavor markers. 2018-02-04 21:49:42 +08:00
petersunbag d89336ca7e InsertInto and InsertIntoForTag receive ...interface{} 2018-01-08 13:29:16 +08:00
petersunbag 9abfa340c3 struct bulk insert 2018-01-07 22:04:04 +08:00
Huan Du 49c988a55e add coverage report 2017-12-31 01:07:58 +08:00
Huan Du 86a512f89a update doc 2017-12-31 00:35:51 +08:00
Huan Du d4955d773c update doc 2017-12-31 00:33:16 +08:00
Huan Du 3d80e20960 update doc and provide more samples 2017-12-31 00:31:19 +08:00
Huan Du 8378d54eaa update doc and examples 2017-12-30 13:38:11 +08:00
Huan Du ae0151fccb implement Struct and add more docs 2017-12-30 04:36:25 +08:00