File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ type Dialect interface {
23
23
FieldAsColumn (field * schema.Field ) string
24
24
TruncateDDL (tableName string , force bool ) []string
25
25
CreateTableSettings () string
26
- InsertHasReturningPhrase () bool
27
26
ShowTables () string
28
27
29
28
// ReplacePlaceholders alters a query string by replacing the '?' placeholders with the appropriate
@@ -33,8 +32,14 @@ type Dialect interface {
33
32
Placeholders (n int ) string
34
33
// HasNumberedPlaceholders returns true for dialects such as PostgreSQL that use numbered placeholders.
35
34
HasNumberedPlaceholders () bool
36
- // HasLastInsertId returns true for dialects such as MySQL that return a last-insert ID after each INSERT.
35
+ // HasLastInsertId returns true for dialects such as MySQL that return a last-insert ID after each
36
+ // INSERT. This allows the corresponding feature of the database/sql API to work.
37
+ // It is the inverse of InsertHasReturningPhrase.
37
38
HasLastInsertId () bool
39
+ // InsertHasReturningPhrase returns true for dialects such as Postgres that use a RETURNING phrase to
40
+ // obtain the last-insert ID after each INSERT.
41
+ // It is the inverse of HasLastInsertId.
42
+ InsertHasReturningPhrase () bool
38
43
}
39
44
40
45
//-------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ type Index struct {
45
45
Fields FieldList
46
46
}
47
47
48
- func (t * TableDescription ) HasLastInsertId () bool {
48
+ func (t * TableDescription ) HasIntegerPrimaryKey () bool {
49
49
return t .Primary != nil && t .Primary .Type .Base .IsInteger ()
50
50
}
51
51
You can’t perform that action at this time.
0 commit comments