mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 07:46:15 -06:00
[chore]: Bump github.com/uptrace/bun/dialect/pgdialect
Bumps [github.com/uptrace/bun/dialect/pgdialect](https://github.com/uptrace/bun) from 1.2.8 to 1.2.9. - [Release notes](https://github.com/uptrace/bun/releases) - [Changelog](https://github.com/uptrace/bun/blob/v1.2.9/CHANGELOG.md) - [Commits](https://github.com/uptrace/bun/compare/v1.2.8...v1.2.9) --- updated-dependencies: - dependency-name: github.com/uptrace/bun/dialect/pgdialect dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
2a46681147
commit
84b4539b0d
34 changed files with 745 additions and 205 deletions
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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue