92 Commits

Author SHA1 Message Date
Gerhard Gruber
c807fe3202 Started with expression extension
Improved questionmark parameter placeholder replacementw

Added support for subqueries in Where and Having clauses

Queries can be transformed into subqueries by calling .Subquery() on a db object

See main_test.go:TestQueryBuilderSubselectInWhere

Fixed comment spacing

Refactoring, adding Having Subquery support, allowing db.T for tablenames

Removed quoting from tablename in db.T, use db.QT for that

Refactoring, adding Having Subquery support, allowing db.T for tablenames

Added changes

Started with expression extension

Refactoring, adding Having Subquery support, allowing db.T for tablenames

Added method to easily update fields of the Model struct

Added column comparison and Join support

Added subquery support for InnerJoin querybuilder

Fixed column comparison

Added support for column prefixes

Models can set their column prefix by implementing the method ColumnPrefix() string

Fixed multi-parameter subselects and introduced aliasing

Improved Related method

Improved Related method to search for foreign key struct fields with the suffix "ID" (additional to "Id")

Got QueryExpr support from upstream

Added support for subqueries in Where and Having clauses

Queries can be transformed into subqueries by calling .Subquery() on a db object

See main_test.go:TestQueryBuilderSubselectInWhere

Improved questionmark parameter placeholder replacementw

Refactoring, adding Having Subquery support, allowing db.T for tablenames

Removed quoting from tablename in db.T, use db.QT for that

Removed quoting from tablename in db.T, use db.QT for that

Added changes

Added method to easily update fields of the Model struct

Fixed column comparison

Added support for column prefixes

Models can set their column prefix by implementing the method ColumnPrefix() string

Fixed multi-parameter subselects and introduced aliasing

Improved Related method

Improved Related method to search for foreign key struct fields with the suffix "ID" (additional to "Id")

Added select extension for multiple columns

Added support for LEFT RIGHT OUTER joins

Fixed slice support for lexpr.In()

Publizised LExpr

Added DateFormatting for all dialects

Added SUM function for columns

Fixed FormatDate

Added count for column

Removed literal expressions LExpr

Rewrote LExpr methods to work with expr structs.

Added methods BAnd and BOr (bitwise & and | )

Added SetLogWriter method

Added NotIn query expression

Added Distinct query expression

Added DistinctColumn query expression

Same as Distinct but returns a string

Added method OnExp to jexpr

Improved query expression .Eq() method for nil pointers

Fixed rebase errors
2018-02-26 16:00:19 +01:00
Jinzhu
44b9911f51 Refactor self referencing m2m support 2018-02-10 21:21:50 +08:00
Nathan Osman
8e7d807ebf Allow name of column to be customized to support self-referencing many2many fields. 2018-02-10 21:21:50 +08:00
Jinzhu
d61b7db8fa Fix postgres tests 2017-08-11 18:03:32 +08:00
Jinzhu
eae7f6be60 Fix source type is incorrect error for embedded many to many relationship 2017-06-14 17:33:21 +08:00
Jinzhu
b870f86fba Fix set Scanner's data type 2017-02-06 08:43:49 +08:00
Jinzhu
6633f325b8 Fix table name in singular mode in some cases 2017-02-05 18:38:30 +08:00
Jinzhu
1aa2d4ca89 Fix primary key for embedded struct 2017-01-09 20:07:39 +08:00
Jinzhu
afaadc3942 Refactor named value support for PolymorphicType 2016-10-06 20:33:48 +08:00
slockij
1413e55339 Add named value for PolymorphicType (to replace scope.TableName) 2016-09-28 22:44:43 +02:00
Jinzhu
446ce99a42 Support set prefix for embedded struct 2016-09-05 22:26:57 +08:00
Jinzhu
f26fa242cc Support specify GORM tag setting inside scanner 2016-08-25 17:59:26 +08:00
Jinzhu
8f0f5df8c6 Don't set auto increment primary key's HasDefaultValue to true 2016-08-13 21:46:49 +08:00
Christophe de Vienne
608fd976c4 Fix auto_increment on postgres database. 2016-06-20 15:00:19 +02:00
Jinzhu
4786e830d6 Fix create join table 2016-05-09 22:32:33 +08:00
Jinzhu
465f8ea05b Fix ignore fields 2016-05-02 19:34:11 +08:00
Jinzhu
2e9d5e6f76 Test overwrite foreign keys 2016-03-07 23:51:04 +08:00
Jinzhu
2c089573cd Add tests for override belogns to foreign keys with tag 2016-03-07 23:35:31 +08:00
Jinzhu
88184a989e Update godoc 2016-03-07 21:09:05 +08:00
Jinzhu
ec110657da Refactor based on golint 2016-03-07 17:49:55 +08:00
Jinzhu
552d9bf455 Refactor DataTypeOf for sqlite 2016-02-14 11:51:53 +08:00
Jinzhu
2dfd76d22b Refactor DataTypeOf 2016-01-29 15:08:53 +08:00
Jinzhu
d92c5db9e7 Refactor dialect 2016-01-19 13:11:11 +08:00
Jinzhu
8d716be896 Fix some go vet/lint reports 2016-01-15 21:16:48 +08:00
Jinzhu
84942c60b8 Include tag settings when clone a StructField 2016-01-08 09:02:01 +08:00
Jinzhu
d1892d3177 Support poiner of Scanner 2016-01-04 18:42:47 +08:00
Jinzhu
8aa7b475d4 Add more tests for one to many relations with customized foreign keys 2016-01-04 12:23:24 +08:00
Jinzhu
d87a960248 Test many to many relation with customized column 2016-01-04 08:26:02 +08:00
Jinzhu
d7237be63c Support poiner of time 2016-01-03 20:27:08 +08:00
Jinzhu
aa55bd3fd2 Add more tests for customized foreign keys for many2many relations 2016-01-03 17:20:24 +08:00
Jinzhu
0f5055471a Keep refactoring get model struct 2016-01-03 15:56:32 +08:00
Jinzhu
8a0c77e5fc Fix all tests for GetModelStruct 2016-01-03 14:16:58 +08:00
Jinzhu
4bc06a21c1 Refactor GetModelStruct 2016-01-03 14:04:59 +08:00
Jinzhu
6a5a2dbc55 Refactor GetModelStruct 2016-01-03 13:10:17 +08:00
Jinzhu
4e45e6dc2d Use field.TagSettings 2016-01-03 10:00:18 +08:00
Jinzhu
19b85b1f17 Compatible with both gorm, sql tag 2016-01-03 09:52:27 +08:00
Jinzhu
5d2b9bfe34 Refactor GetModelStruct 2016-01-03 09:46:07 +08:00
Jinzhu
9455215e61 Add association tests for composite primary key 2015-12-31 11:17:10 +08:00
Peter Waller
5ba59aec5f Give (*ModelStruct).TableName() a pointer receiver
There was a data race caused by the copy of the ModelStruct. See #723.

Fixes #723.
2015-12-23 10:42:03 +00:00
Jinzhu
341703ed5d Scan value into ignored fields if there is no ambiguity 2015-12-11 11:45:22 +08:00
Jinzhu
84c6b46011 Update inflection address 2015-12-03 15:18:42 +08:00
Jinzhu
ea83dec214 Use false to decline antuincrement 2015-11-22 09:35:18 +08:00
otiai10
ba12202af2 Enable to decline antuincrement on ID field 2015-11-21 18:15:47 +09:00
Nikola Kovacs
c691b33ce5 remove unused tabler interface 2015-10-01 10:25:02 +02:00
Jinzhu
8a2b73723d Better compatibility for complex sql type 2015-10-01 08:06:08 +08:00
Jinzhu
4da2c28d4d Fix data race warning when get cached model struct 2015-10-01 07:09:00 +08:00
Jinzhu
37bf87aa29 Fix can't load preload fields correctly 2015-09-26 00:41:07 +08:00
Jinzhu
edc1f78530 Fix calculate fields for the first time 2015-09-11 07:36:48 +08:00
Jinzhu
9982134955 Fix preload many2many with multiple primary keys 2015-08-18 09:19:50 +08:00
kimiby
281c5d10f6 preload_m2m improve 2015-08-16 12:36:23 +03:00