Commit Graph

43 Commits

Author SHA1 Message Date
zaneli 23f6840776 Add limit and offset parse error 2019-11-27 11:21:05 +09:00
Alex Stockwell 820b5f244a MSSQL Create() fix: Add LastInsertIDReturningSuffix to dialect (#2690)
* MSSQL Create() fix: Add LastInsertIDReturningSuffix to dialect

Per https://github.com/denisenkom/go-mssqldb/issues/355

* MSSQL Create() fix: Added OUTPUT query to Create() builder
2019-10-17 22:54:11 +08:00
zaneli 09a868b381 Handle syntax to specify an index prefix length 2019-04-20 01:04:23 +09:00
haoc7 c721a198a7 create table add column comment (#2298) 2019-03-10 20:01:57 +08:00
Eyal Posener 123d4f50ef lock TagSettings structure when modified (#1796)
The map is modified in different places in the code which results in race conditions
on execution.
This commit locks the map with read-write lock when it is modified
2018-09-10 07:11:00 +08:00
Illya Busigin 9044197ef9 Adding GetDialect function (#1869) 2018-05-02 09:38:51 -05:00
Jinzhu 58e34726df Don't access scanner's fields if already defined data type 2018-02-18 09:00:03 +08:00
Jinzhu 3b2c4b3608 Fix insert with default value for mysql 2018-02-12 17:39:34 +08:00
Jinzhu 89a726ce5d Move ModifyColumn implemention to Dialect 2018-02-09 22:58:34 +08:00
Jinzhu 87fc1b2473 Refactor PR #1751 2018-02-03 20:27:19 +08:00
Jinzhu 802104cc7c Use BuildKeyName to build db's index name 2018-02-02 22:01:31 +08:00
Russ Egan 45f1a95051 Replace all use of *sql.DB with sqlCommon
Exporting sqlCommon as SQLCommon.

This allows passing alternate implementations of the database connection, or wrapping the connection with middleware.  This change didn't change any usages of the database variables.  All usages were already only using the functions defined in SQLCommon.

This does cause a breaking change in Dialect, since *sql.DB was referenced in the interface.
2017-03-14 17:02:14 -04:00
Jinzhu a3b8b332ed Allow customize data type via ParseFieldStructForDialect 2017-01-15 21:45:17 +08:00
Jinzhu b507cdf93d Expose current database name API 2016-07-11 21:37:44 +08:00
Jay Taylor 1485f4bce9 Use validated interface{} for limit/offset values to ensure values greater than
max 32-bit integer are addressable, and in a backwards-compatible way.
2016-06-23 06:29:51 -07:00
Jinzhu f926dd9f9f Revert "Use int64 for limit/offset values to ensure values > 32-bit int are addressable." 2016-06-16 16:31:50 +08:00
Jay Taylor 9b0fb2feb9 Use int64 for limit/offset values to ensure values greater than max 32-bit
integer are addressable.
2016-06-08 17:03:22 -07:00
Nikola Kovacs 6eb73ae654 Fix too long foreign key names in mysql.
The dialect must define its own foreign key generator method.
The previous default is available as a method on gorm.DefaultForeignKeyNamer
and can be embedded in other dialects.
The mysql dialect uses the first 24 characters plus an sha1 hash of the
full key name if the key name is more than 64 characters.
2016-05-22 00:13:26 +02: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 60a859d966 Add check HasForeignKey method to dialect, also move mssql dialect to a separate repo as it is not well tested, close #832 2016-03-05 22:51:11 +08:00
Jinzhu b6a2710a15 Don't execute SET IDENTITY_INSERT if dialect is not mssql 2016-03-05 21:24:54 +08:00
Jinzhu 4e8370e18b Refactor dialect 2016-02-15 14:59:15 +08:00
Jinzhu f4456e139e Register dialects 2016-02-14 18:06:42 +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 e159ca1914 Refactor dialect 2016-01-18 20:32:52 +08:00
Jinzhu 09f46f01b9 Refactor dialect 2016-01-16 22:01:04 +08:00
Jay Taylor beeb040c62 Reworked CurrentDatabase API to return the name instead of `*gorm.DB'. 2015-08-11 08:59:59 -07:00
Jay Taylor 70725f9d77 `CurrentDatabase' determines current dbname by querying the database.
Preserves the gorm-style query API.
2015-08-08 08:56:23 -07:00
Jay Taylor dcc06e22f7 FoundationDB dialect layer and compatibility updates. 2015-03-24 10:35:19 -07:00
Jinzhu a549b6bd49 Refactor SQL Tag 2015-03-11 17:05:58 +08:00
Jinzhu 34997385b0 Add HasIndex method for dialect interface 2015-03-02 23:02:40 +08:00
Jinzhu 0b32041135 Review and Refactor 2015-02-17 22:55:14 +08:00
Paolo Galeone 21f4de584f Use tableName.field or tableName.* in returning string 2014-12-08 12:03:42 +01:00
Joel Trost a6b243a3e9 fix for bad rebase 2014-09-16 14:49:29 -07:00
Joel Trost f79e1a2ef6 GORM support for MSSQL, passes all tests 2014-09-16 14:21:35 -07:00
Jinzhu 14590a65dc Save many to many relations into join table 2014-07-30 14:18:15 +08:00
Jinzhu b929a082d7 Fix remove index for sqlite and postgres 2014-07-29 12:02:03 +08:00
Jinzhu 29ac192090 Add Compatibility Mode 2014-07-02 17:55:21 +08:00
Jinzhu 66e6c9af9f Add method HasTable, HasColumn to dialect 2014-04-25 09:08:48 +08:00
Jinzhu a46d149579 remove package dialect for easier contribution 2014-04-25 07:20:23 +08:00