Documentation
¶
Index ¶
- func Version() string
- type ArrayValue
- type Column
- type Dialect
- func (d *Dialect) AppendSequence(b []byte, _ *schema.Table, _ *schema.Field) []byte
- func (d *Dialect) AppendUint32(b []byte, n uint32) []byte
- func (d *Dialect) AppendUint64(b []byte, n uint64) []byte
- func (d *Dialect) CompareType(col1, col2 sqlschema.Column) bool
- func (d *Dialect) DefaultSchema() string
- func (d *Dialect) DefaultVarcharLen() int
- func (d *Dialect) Features() feature.Feature
- func (d *Dialect) IdentQuote() byte
- func (d *Dialect) Init(*sql.DB)
- func (d *Dialect) Name() dialect.Name
- func (d *Dialect) NewInspector(db *bun.DB, options ...sqlschema.InspectorOption) sqlschema.Inspector
- func (d *Dialect) NewMigrator(db *bun.DB, schemaName string) sqlschema.Migrator
- func (d *Dialect) OnTable(table *schema.Table)
- func (d *Dialect) Tables() *schema.Tables
- type DialectOption
- type ForeignKey
- type HStoreValue
- type InformationSchemaColumn
- type InformationSchemaTable
- type Inspector
- type MultiRange
- type PrimaryKey
- type Range
- type RangeBound
- type RangeOption
- type Schema
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayValue ¶
type ArrayValue struct {
// contains filtered or unexported fields
}
func Array ¶
func Array(vi any) *ArrayValue
Array accepts a slice and returns a wrapper for working with PostgreSQL array data type.
For struct fields you can use array tag:
Emails []string `bun:",array"`
func (*ArrayValue) AppendQuery ¶
func (*ArrayValue) Scan ¶
func (a *ArrayValue) Scan(src any) error
func (*ArrayValue) Value ¶
func (a *ArrayValue) Value() any
type Column ¶ added in v1.2.6
type Column = sqlschema.BaseColumn
type Dialect ¶
type Dialect struct {
schema.BaseDialect
// contains filtered or unexported fields
}
func New ¶
func New(opts ...DialectOption) *Dialect
func (*Dialect) AppendSequence ¶ added in v1.1.17
func (*Dialect) AppendUint32 ¶ added in v1.0.14
func (*Dialect) AppendUint64 ¶ added in v1.0.14
func (*Dialect) CompareType ¶ added in v1.2.6
func (*Dialect) DefaultSchema ¶ added in v1.2.6
func (*Dialect) DefaultVarcharLen ¶ added in v1.1.10
func (*Dialect) IdentQuote ¶
func (*Dialect) NewInspector ¶ added in v1.2.6
func (*Dialect) NewMigrator ¶ added in v1.2.6
type DialectOption ¶ added in v1.2.7
type DialectOption func(d *Dialect)
func WithAppendUintAsInt ¶ added in v1.2.9
func WithAppendUintAsInt(on bool) DialectOption
func WithoutFeature ¶ added in v1.2.7
func WithoutFeature(other feature.Feature) DialectOption
type ForeignKey ¶ added in v1.2.6
type ForeignKey struct {
ConstraintName string `bun:"constraint_name"`
SourceSchema string `bun:"schema_name"`
SourceTable string `bun:"table_name"`
SourceColumns []string `bun:"columns,array"`
TargetSchema string `bun:"target_schema"`
TargetTable string `bun:"target_table"`
TargetColumns []string `bun:"target_columns,array"`
}
type HStoreValue ¶ added in v1.1.6
type HStoreValue struct {
// contains filtered or unexported fields
}
func HStore ¶ added in v1.1.6
func HStore(vi any) *HStoreValue
HStore accepts a map[string]string and returns a wrapper for working with PostgreSQL hstore data type.
For struct fields you can use hstore tag:
Attrs map[string]string `bun:",hstore"`
func (*HStoreValue) AppendQuery ¶ added in v1.1.6
func (*HStoreValue) Scan ¶ added in v1.1.6
func (h *HStoreValue) Scan(src any) error
func (*HStoreValue) Value ¶ added in v1.1.6
func (h *HStoreValue) Value() any
type InformationSchemaColumn ¶ added in v1.2.6
type InformationSchemaColumn struct {
Schema string `bun:"table_schema"`
Table string `bun:"table_name"`
Name string `bun:"column_name"`
DataType string `bun:"data_type"`
VarcharLen int `bun:"varchar_len"`
IsArray bool `bun:"is_array"`
ArrayDims int `bun:"array_dims"`
Default string `bun:"default"`
IsDefaultLiteral bool `bun:"default_is_literal_expr"`
IsIdentity bool `bun:"is_identity"`
IndentityType string `bun:"identity_type"`
IsSerial bool `bun:"is_serial"`
IsNullable bool `bun:"is_nullable"`
UniqueGroups []string `bun:"unique_groups,array"`
}
type InformationSchemaTable ¶ added in v1.2.6
type InformationSchemaTable struct {
Schema string `bun:"table_schema,pk"`
Name string `bun:"table_name,pk"`
PrimaryKey PrimaryKey `bun:"embed:primary_key_"`
Columns []*InformationSchemaColumn `bun:"rel:has-many,join:table_schema=table_schema,join:table_name=table_name"`
}
type Inspector ¶ added in v1.2.6
type Inspector struct {
sqlschema.InspectorConfig
// contains filtered or unexported fields
}
type MultiRange ¶ added in v1.2.2
func (MultiRange[T]) AppendQuery ¶ added in v1.2.16
func (*MultiRange[T]) IsZero ¶ added in v1.2.16
func (m *MultiRange[T]) IsZero() bool
func (*MultiRange[T]) Len ¶ added in v1.2.16
func (m *MultiRange[T]) Len() int
type PrimaryKey ¶ added in v1.2.6
type Range ¶ added in v1.2.2
type Range[T any] struct { Lower, Upper T LowerBound, UpperBound RangeBound }
func NewEmptyRange ¶ added in v1.2.16
func (Range[T]) AppendQuery ¶ added in v1.2.2
type RangeBound ¶ added in v1.2.2
type RangeBound byte
const ( // RangeBoundUnset indicates that no bound is set. // This usually means the range is uninitialized or unspecified. RangeBoundUnset RangeBound = 0x0 // RangeBoundEmpty is a special marker for an empty range. // This is NOT a valid PostgreSQL bound character, but is used internally // to represent a range that contains no values. RangeBoundEmpty RangeBound = 'E' RangeBoundInclusiveLeft RangeBound = '[' RangeBoundInclusiveRight RangeBound = ']' RangeBoundExclusiveLeft RangeBound = '(' RangeBoundExclusiveRight RangeBound = ')' )
type RangeOption ¶ added in v1.2.16
type Schema ¶ added in v1.2.6
type Schema = sqlschema.BaseDatabase
Click to show internal directories.
Click to hide internal directories.