mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 21:32:27 -05:00
bumps uptrace/bun deps to v1.2.8 (#3698)
This commit is contained in:
parent
7b7fc528f1
commit
3617e27afa
35 changed files with 760 additions and 220 deletions
58
vendor/github.com/uptrace/bun/dialect/feature/feature.go
generated
vendored
58
vendor/github.com/uptrace/bun/dialect/feature/feature.go
generated
vendored
|
|
@ -1,6 +1,11 @@
|
|||
package feature
|
||||
|
||||
import "github.com/uptrace/bun/internal"
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/uptrace/bun/internal"
|
||||
)
|
||||
|
||||
type Feature = internal.Flag
|
||||
|
||||
|
|
@ -35,4 +40,55 @@ const (
|
|||
UpdateOrderLimit // UPDATE ... ORDER BY ... LIMIT ...
|
||||
DeleteOrderLimit // DELETE ... ORDER BY ... LIMIT ...
|
||||
DeleteReturning
|
||||
AlterColumnExists // ADD/DROP COLUMN IF NOT EXISTS/IF EXISTS
|
||||
)
|
||||
|
||||
type NotSupportError struct {
|
||||
Flag Feature
|
||||
}
|
||||
|
||||
func (err *NotSupportError) Error() string {
|
||||
name, ok := flag2str[err.Flag]
|
||||
if !ok {
|
||||
name = strconv.FormatInt(int64(err.Flag), 10)
|
||||
}
|
||||
return fmt.Sprintf("bun: feature %s is not supported by current dialect", name)
|
||||
}
|
||||
|
||||
func NewNotSupportError(flag Feature) *NotSupportError {
|
||||
return &NotSupportError{Flag: flag}
|
||||
}
|
||||
|
||||
var flag2str = map[Feature]string{
|
||||
CTE: "CTE",
|
||||
WithValues: "WithValues",
|
||||
Returning: "Returning",
|
||||
InsertReturning: "InsertReturning",
|
||||
Output: "Output",
|
||||
DefaultPlaceholder: "DefaultPlaceholder",
|
||||
DoubleColonCast: "DoubleColonCast",
|
||||
ValuesRow: "ValuesRow",
|
||||
UpdateMultiTable: "UpdateMultiTable",
|
||||
InsertTableAlias: "InsertTableAlias",
|
||||
UpdateTableAlias: "UpdateTableAlias",
|
||||
DeleteTableAlias: "DeleteTableAlias",
|
||||
AutoIncrement: "AutoIncrement",
|
||||
Identity: "Identity",
|
||||
TableCascade: "TableCascade",
|
||||
TableIdentity: "TableIdentity",
|
||||
TableTruncate: "TableTruncate",
|
||||
InsertOnConflict: "InsertOnConflict",
|
||||
InsertOnDuplicateKey: "InsertOnDuplicateKey",
|
||||
InsertIgnore: "InsertIgnore",
|
||||
TableNotExists: "TableNotExists",
|
||||
OffsetFetch: "OffsetFetch",
|
||||
SelectExists: "SelectExists",
|
||||
UpdateFromTable: "UpdateFromTable",
|
||||
MSSavepoint: "MSSavepoint",
|
||||
GeneratedIdentity: "GeneratedIdentity",
|
||||
CompositeIn: "CompositeIn",
|
||||
UpdateOrderLimit: "UpdateOrderLimit",
|
||||
DeleteOrderLimit: "DeleteOrderLimit",
|
||||
DeleteReturning: "DeleteReturning",
|
||||
AlterColumnExists: "AlterColumnExists",
|
||||
}
|
||||
|
|
|
|||
29
vendor/github.com/uptrace/bun/dialect/pgdialect/dialect.go
generated
vendored
29
vendor/github.com/uptrace/bun/dialect/pgdialect/dialect.go
generated
vendored
|
|
@ -3,6 +3,7 @@ package pgdialect
|
|||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/uptrace/bun"
|
||||
|
|
@ -25,8 +26,9 @@ func init() {
|
|||
type Dialect struct {
|
||||
schema.BaseDialect
|
||||
|
||||
tables *schema.Tables
|
||||
features feature.Feature
|
||||
tables *schema.Tables
|
||||
features feature.Feature
|
||||
uintAsInt bool
|
||||
}
|
||||
|
||||
var _ schema.Dialect = (*Dialect)(nil)
|
||||
|
|
@ -53,7 +55,8 @@ func New(opts ...DialectOption) *Dialect {
|
|||
feature.SelectExists |
|
||||
feature.GeneratedIdentity |
|
||||
feature.CompositeIn |
|
||||
feature.DeleteReturning
|
||||
feature.DeleteReturning |
|
||||
feature.AlterColumnExists
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(d)
|
||||
|
|
@ -70,6 +73,12 @@ func WithoutFeature(other feature.Feature) DialectOption {
|
|||
}
|
||||
}
|
||||
|
||||
func WithAppendUintAsInt(on bool) DialectOption {
|
||||
return func(d *Dialect) {
|
||||
d.uintAsInt = on
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Dialect) Init(*sql.DB) {}
|
||||
|
||||
func (d *Dialect) Name() dialect.Name {
|
||||
|
|
@ -127,6 +136,20 @@ func (d *Dialect) IdentQuote() byte {
|
|||
return '"'
|
||||
}
|
||||
|
||||
func (d *Dialect) AppendUint32(b []byte, n uint32) []byte {
|
||||
if d.uintAsInt {
|
||||
return strconv.AppendInt(b, int64(int32(n)), 10)
|
||||
}
|
||||
return strconv.AppendUint(b, uint64(n), 10)
|
||||
}
|
||||
|
||||
func (d *Dialect) AppendUint64(b []byte, n uint64) []byte {
|
||||
if d.uintAsInt {
|
||||
return strconv.AppendInt(b, int64(n), 10)
|
||||
}
|
||||
return strconv.AppendUint(b, n, 10)
|
||||
}
|
||||
|
||||
func (d *Dialect) AppendSequence(b []byte, _ *schema.Table, _ *schema.Field) []byte {
|
||||
return appendGeneratedAsIdentity(b)
|
||||
}
|
||||
|
|
|
|||
2
vendor/github.com/uptrace/bun/dialect/pgdialect/version.go
generated
vendored
2
vendor/github.com/uptrace/bun/dialect/pgdialect/version.go
generated
vendored
|
|
@ -2,5 +2,5 @@ package pgdialect
|
|||
|
||||
// Version is the current release version.
|
||||
func Version() string {
|
||||
return "1.2.8"
|
||||
return "1.2.9"
|
||||
}
|
||||
|
|
|
|||
2
vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go
generated
vendored
2
vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go
generated
vendored
|
|
@ -2,5 +2,5 @@ package sqlitedialect
|
|||
|
||||
// Version is the current release version.
|
||||
func Version() string {
|
||||
return "1.2.8"
|
||||
return "1.2.9"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue