mirror of
https://github.com/glebarez/sqlite.git
synced 2025-10-04 07:16:23 +08:00
enable RETURNING functionality for Create opeartion due to bug fix in GORM (https://github.com/go-gorm/gorm/issues/4891)
This commit is contained in:
@@ -56,11 +56,7 @@ func (dialector Dialector) Initialize(db *gorm.DB) (err error) {
|
||||
// https://www.sqlite.org/releaselog/3_35_0.html
|
||||
if compareVersion(version, "3.35.0") >= 0 {
|
||||
callbacks.RegisterDefaultCallbacks(db, &callbacks.Config{
|
||||
// CreateClauses should support RETURNING, but for now there's a bug with foreign key pragma
|
||||
// RETURNING will be added as soon as bug is fixed
|
||||
// in case of Primary key, the generated SQLite ID is still accessible though,
|
||||
// due to LastGeneratedID support golang sql package
|
||||
CreateClauses: []string{"INSERT", "VALUES", "ON CONFLICT"},
|
||||
CreateClauses: []string{"INSERT", "VALUES", "ON CONFLICT", "RETURNING"},
|
||||
UpdateClauses: []string{"UPDATE", "SET", "WHERE", "RETURNING"},
|
||||
DeleteClauses: []string{"DELETE", "FROM", "WHERE", "RETURNING"},
|
||||
LastInsertIDReversed: true,
|
||||
|
Reference in New Issue
Block a user