Commit Graph

2646 Commits

Author SHA1 Message Date
Jinzhu d002c70cf6 Support named argument for struct 2020-09-17 21:52:41 +08:00
Jinzhu a932175ccf Refactor cascade delete associations 2020-09-15 14:28:26 +08:00
Jinzhu 06d534d6ea Cascade delete associations, close #3473 2020-09-15 12:41:45 +08:00
Jinzhu 1d5f910b6e Update workflows template 2020-09-14 15:30:55 +08:00
Jinzhu 0ec10d4907 Fix format SQL log, close #3465 2020-09-14 12:37:16 +08:00
Jinzhu ed1b134e1c Fix use uint to for autoCreateTime, autoUpdateTime 2020-09-11 17:33:31 +08:00
Jinzhu 02fb382ec0 Support scan into int, string data types 2020-09-11 15:01:02 +08:00
Jinzhu e583dfa196 Allow negative number for limit 2020-09-11 11:54:21 +08:00
Jinzhu b8a74a80d7 Fix embedded struct with default value, close #3451 2020-09-11 11:18:54 +08:00
Jinzhu 70a7bd52ca Support delete associations with Select when deleting 2020-09-10 21:46:18 +08:00
Jinzhu 53caa85cf4 Use db's Logger for callbacks logs, close #3448, #3447 2020-09-10 19:20:47 +08:00
Jinzhu 231effe119 Fix parse blank default value, close #3442 2020-09-10 11:59:18 +08:00
Jinzhu 619d306cef ignore (-) when creating default values, #3434 2020-09-10 10:55:02 +08:00
Jinzhu f6ed895caf Build relationships if fields are not ignored, fix #3181 2020-09-09 16:37:05 +08:00
Jinzhu f6117b7f3d Should not diplay SubQuery SQL log, close #3437 2020-09-09 16:26:16 +08:00
Jinzhu 0b6ef3cb87 Merge branch 'jsternberg-migrator-release-conn' 2020-09-09 10:56:07 +08:00
Jinzhu 567597f000 Fix fail on sqlserver, #3433 2020-09-09 10:53:13 +08:00
Jinzhu e7188c04ca Fix tests & refactor for PR #3429 2020-09-09 10:42:13 +08:00
caelansar 839e09e985 correct generated sql 2020-09-09 10:42:13 +08:00
Jinzhu 2242ac6c0e Fix tests & refactor for PR #3429 2020-09-09 10:31:48 +08:00
Jonathan A. Sternberg 222427c474
Release the connection when discovering the column types in the migrator
When the migrator is used to discover the column types, such as when
used with `AutoMigrate()`, it does not close the query result. This
changes the migrator to close the query result and it also changes the
query to use `LIMIT 1` to prevent additional work against the database
when only discovering the schema.

Fixes #3432.
2020-09-08 18:12:14 -05:00
caelansar aceb3dad3b correct generated sql 2020-09-08 21:28:04 +08:00
Jinzhu c70c097e88 Refactor format SQL for driver.Valuer 2020-09-08 19:11:29 +08:00
Jinzhu c9d5c0b07a Fix create database foreign keys for same type having has many/one & many2many relationships, close #3424 2020-09-08 18:25:29 +08:00
egenchen 6de0356a57
Fix monocolor log output inconsist with colorful log (#3425) 2020-09-08 16:59:47 +08:00
Jinzhu 05794298bd Fix Save with specified table, close #3396 2020-09-06 12:22:08 +08:00
Jinzhu 6e38a2c2d5 Fix many2many join table name rule 2020-09-06 10:51:21 +08:00
Jinzhu d8ddccf147 Don't marshal to null for associations after preloading, close #3395 2020-09-04 19:09:51 +08:00
Jinzhu f121622228 Don't add prefix for invalid embedded fields 2020-09-04 14:35:44 +08:00
Jinzhu 28121d4455 Fix panic when batch creating from slice contains invalid data, close #3385 2020-09-03 20:59:41 +08:00
Jinzhu 6a86646469 Fix use db function as integer's default value, close #3384 2020-09-03 20:41:00 +08:00
Jinzhu dd0d74fad0 Fix transaction on closed conn when using prepared statement, close #3380 2020-09-03 19:16:55 +08:00
Jinzhu 3cd81ff646 Fix query with specified table and conditions, close #3382 2020-09-03 18:42:32 +08:00
Jinzhu 78e9c9b748 raise error when failed to parse default value, close #3378 2020-09-03 18:20:57 +08:00
Jinzhu f2adb088c5 Set field size from primary fields to foreign fields 2020-09-03 16:11:15 +08:00
Jinzhu cf31508095 Fix tests_all.sh 2020-09-03 15:02:04 +08:00
Jinzhu 3cc7a30712 Fix tests/go.mod 2020-09-03 13:28:37 +08:00
Jinzhu 98e15e0b95 Setup DB's ConnPool in PrepareStmt mode, fix #3362 2020-09-03 12:54:26 +08:00
Jinzhu ff3880292d Update missing playground template 2020-09-03 11:48:44 +08:00
Jinzhu 48b395b760 returns ErrEmptySlice when creating with zero length slice 2020-09-03 11:32:30 +08:00
Jinzhu fcb666cfa3 Fix associations using composite primary keys without ID field, close #3365 2020-09-03 10:58:48 +08:00
Jinzhu 130f24090d update default_value_test 2020-09-02 21:03:47 +08:00
Jinzhu dbe0f4d8d7 Allow use NULL as default value for string, close #3363 2020-09-02 20:15:12 +08:00
Jinzhu 680dda2c15 Fix combine conditions when using string conditions, close #3358 2020-09-02 20:09:51 +08:00
Jinzhu dbaa6b0ec3 Fix Scan struct with primary key, close #3357 2020-09-02 16:14:26 +08:00
aimuz 9a101c8a08
fmt.Sprint() to strconv.Format (#3354) 2020-09-01 21:03:37 +08:00
Jinzhu d1e17d549f request ColumnTypes after new session method 2020-09-01 20:53:54 +08:00
Jinzhu 22317b43c0 Fix migrate field, failed to migrate when field size changed 2020-09-01 18:58:16 +08:00
Jinzhu bf6123b01e Fix duplicated soft delete clause 2020-09-01 18:05:26 +08:00
Jinzhu e73147fa8e Better support for scan into map, fix unfriendly data type for interface, close #3351 2020-09-01 17:45:14 +08:00