summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/dialect/sqlitedialect
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/dialect/sqlitedialect')
-rw-r--r--vendor/github.com/uptrace/bun/dialect/sqlitedialect/LICENSE24
-rw-r--r--vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go98
-rw-r--r--vendor/github.com/uptrace/bun/dialect/sqlitedialect/scan.go11
-rw-r--r--vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go6
4 files changed, 0 insertions, 139 deletions
diff --git a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/LICENSE b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/LICENSE
deleted file mode 100644
index 7ec81810c..000000000
--- a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-Copyright (c) 2021 Vladimir Mihailenco. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go
deleted file mode 100644
index e79dcb004..000000000
--- a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/dialect.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package sqlitedialect
-
-import (
- "database/sql"
- "encoding/hex"
- "fmt"
-
- "github.com/uptrace/bun"
- "github.com/uptrace/bun/dialect"
- "github.com/uptrace/bun/dialect/feature"
- "github.com/uptrace/bun/dialect/sqltype"
- "github.com/uptrace/bun/schema"
-)
-
-func init() {
- if Version() != bun.Version() {
- panic(fmt.Errorf("sqlitedialect and Bun must have the same version: v%s != v%s",
- Version(), bun.Version()))
- }
-}
-
-type Dialect struct {
- schema.BaseDialect
-
- tables *schema.Tables
- features feature.Feature
-}
-
-func New() *Dialect {
- d := new(Dialect)
- d.tables = schema.NewTables(d)
- d.features = feature.CTE |
- feature.WithValues |
- feature.Returning |
- feature.InsertReturning |
- feature.InsertTableAlias |
- feature.UpdateTableAlias |
- feature.DeleteTableAlias |
- feature.InsertOnConflict |
- feature.TableNotExists |
- feature.SelectExists
- return d
-}
-
-func (d *Dialect) Init(*sql.DB) {}
-
-func (d *Dialect) Name() dialect.Name {
- return dialect.SQLite
-}
-
-func (d *Dialect) Features() feature.Feature {
- return d.features
-}
-
-func (d *Dialect) Tables() *schema.Tables {
- return d.tables
-}
-
-func (d *Dialect) OnTable(table *schema.Table) {
- for _, field := range table.FieldMap {
- d.onField(field)
- }
-}
-
-func (d *Dialect) onField(field *schema.Field) {
- field.DiscoveredSQLType = fieldSQLType(field)
-}
-
-func (d *Dialect) IdentQuote() byte {
- return '"'
-}
-
-func (d *Dialect) AppendBytes(b []byte, bs []byte) []byte {
- if bs == nil {
- return dialect.AppendNull(b)
- }
-
- b = append(b, `X'`...)
-
- s := len(b)
- b = append(b, make([]byte, hex.EncodedLen(len(bs)))...)
- hex.Encode(b[s:], bs)
-
- b = append(b, '\'')
-
- return b
-}
-
-func fieldSQLType(field *schema.Field) string {
- switch field.DiscoveredSQLType {
- case sqltype.SmallInt, sqltype.BigInt:
- // INTEGER PRIMARY KEY is an alias for the ROWID.
- // It is safe to convert all ints to INTEGER, because SQLite types don't have size.
- return sqltype.Integer
- default:
- return field.DiscoveredSQLType
- }
-}
diff --git a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/scan.go b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/scan.go
deleted file mode 100644
index f6f02b55a..000000000
--- a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/scan.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package sqlitedialect
-
-import (
- "reflect"
-
- "github.com/uptrace/bun/schema"
-)
-
-func scanner(typ reflect.Type) schema.ScannerFunc {
- return schema.Scanner(typ)
-}
diff --git a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go
deleted file mode 100644
index 8f9def8d0..000000000
--- a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package sqlitedialect
-
-// Version is the current release version.
-func Version() string {
- return "1.1.7"
-}