summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go')
-rw-r--r--vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go
index 3bfe500ff..92959482e 100644
--- a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go
+++ b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go
@@ -40,7 +40,8 @@ func New() *Dialect {
feature.TableNotExists |
feature.SelectExists |
feature.AutoIncrement |
- feature.CompositeIn
+ feature.CompositeIn |
+ feature.DeleteReturning
return d
}
@@ -96,9 +97,13 @@ func (d *Dialect) DefaultVarcharLen() int {
// AUTOINCREMENT is only valid for INTEGER PRIMARY KEY, and this method will be a noop for other columns.
//
// Because this is a valid construct:
+//
// CREATE TABLE ("id" INTEGER PRIMARY KEY AUTOINCREMENT);
+//
// and this is not:
+//
// CREATE TABLE ("id" INTEGER AUTOINCREMENT, PRIMARY KEY ("id"));
+//
// AppendSequence adds a primary key constraint as a *side-effect*. Callers should expect it to avoid building invalid SQL.
// SQLite also [does not support] AUTOINCREMENT column in composite primary keys.
//
@@ -111,6 +116,13 @@ func (d *Dialect) AppendSequence(b []byte, table *schema.Table, field *schema.Fi
return b
}
+// DefaultSchemaName is the "schema-name" of the main database.
+// The details might differ from other dialects, but for all means and purposes
+// "main" is the default schema in an SQLite database.
+func (d *Dialect) DefaultSchema() string {
+ return "main"
+}
+
func fieldSQLType(field *schema.Field) string {
switch field.DiscoveredSQLType {
case sqltype.SmallInt, sqltype.BigInt: