Documentation
¶
Index ¶
- func DetectDriver(dsn string) string
- func Register(name string, factory DriverFactory)
- type BaseDialect
- func (d *BaseDialect) CaseInsensitiveLike() string
- func (d *BaseDialect) LimitOffset(limit, offset int) string
- func (d *BaseDialect) MapType(dbType string) string
- func (d *BaseDialect) OnConflictClause(columns []string, action string) string
- func (d *BaseDialect) Placeholder(n int) string
- func (d *BaseDialect) QuoteIdentifier(name string) string
- func (d *BaseDialect) ReturningClause(cols ...string) string
- func (d *BaseDialect) SupportsArrays() bool
- func (d *BaseDialect) SupportsCTE() bool
- func (d *BaseDialect) SupportsFullJoin() bool
- func (d *BaseDialect) SupportsReturning() bool
- func (d *BaseDialect) SupportsWindowFunctions() bool
- func (d *BaseDialect) UpsertSupport() bool
- type Column
- type Database
- type Dialect
- type DriverFactory
- type Relation
- type Result
- type Row
- type Rows
- type SchemaIntrospector
- type StandardType
- type TableSchema
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectDriver ¶
func Register ¶
func Register(name string, factory DriverFactory)
Types ¶
type BaseDialect ¶
type BaseDialect struct{}
func (*BaseDialect) CaseInsensitiveLike ¶
func (d *BaseDialect) CaseInsensitiveLike() string
func (*BaseDialect) LimitOffset ¶
func (d *BaseDialect) LimitOffset(limit, offset int) string
func (*BaseDialect) MapType ¶ added in v0.4.6
func (d *BaseDialect) MapType(dbType string) string
func (*BaseDialect) OnConflictClause ¶ added in v0.4.6
func (d *BaseDialect) OnConflictClause(columns []string, action string) string
func (*BaseDialect) Placeholder ¶ added in v0.4.6
func (d *BaseDialect) Placeholder(n int) string
func (*BaseDialect) QuoteIdentifier ¶ added in v0.4.6
func (d *BaseDialect) QuoteIdentifier(name string) string
func (*BaseDialect) ReturningClause ¶ added in v0.4.6
func (d *BaseDialect) ReturningClause(cols ...string) string
func (*BaseDialect) SupportsArrays ¶ added in v0.4.6
func (d *BaseDialect) SupportsArrays() bool
func (*BaseDialect) SupportsCTE ¶ added in v0.4.6
func (d *BaseDialect) SupportsCTE() bool
func (*BaseDialect) SupportsFullJoin ¶ added in v0.4.6
func (d *BaseDialect) SupportsFullJoin() bool
func (*BaseDialect) SupportsReturning ¶ added in v0.4.6
func (d *BaseDialect) SupportsReturning() bool
func (*BaseDialect) SupportsWindowFunctions ¶ added in v0.4.6
func (d *BaseDialect) SupportsWindowFunctions() bool
func (*BaseDialect) UpsertSupport ¶ added in v0.4.6
func (d *BaseDialect) UpsertSupport() bool
type Database ¶
type Database interface {
Connect(ctx context.Context, dsn string) error
Close() error
Ping(ctx context.Context) error
Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
QueryRow(ctx context.Context, query string, args ...interface{}) Row
Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
Begin(ctx context.Context) (Tx, error)
Dialect() Dialect
DriverName() string
Introspector() SchemaIntrospector
}
type Dialect ¶
type Dialect interface {
Placeholder(n int) string
SupportsReturning() bool
ReturningClause(cols ...string) string
LimitOffset(limit, offset int) string
QuoteIdentifier(name string) string
MapType(dbType string) string
CaseInsensitiveLike() string
// Query builder capabilities
SupportsFullJoin() bool
SupportsWindowFunctions() bool
SupportsCTE() bool
SupportsArrays() bool
OnConflictClause(columns []string, action string) string
UpsertSupport() bool
}
type DriverFactory ¶
type DriverFactory func() Database
type SchemaIntrospector ¶
type StandardType ¶
type StandardType string
const ( TypeInteger StandardType = "integer" TypeBigInt StandardType = "bigint" TypeString StandardType = "string" TypeText StandardType = "text" TypeBoolean StandardType = "boolean" TypeTimestamp StandardType = "timestamp" TypeUUID StandardType = "uuid" TypeJSON StandardType = "json" TypeFloat StandardType = "float" TypeDecimal StandardType = "decimal" TypeDate StandardType = "date" TypeTime StandardType = "time" TypeBytea StandardType = "bytea" )
func StandardizeType ¶
func StandardizeType(dbType, driverName string) StandardType
type TableSchema ¶
type Tx ¶
type Tx interface {
Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
QueryRow(ctx context.Context, query string, args ...interface{}) Row
Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
Commit(ctx context.Context) error
Rollback(ctx context.Context) error
}
Click to show internal directories.
Click to hide internal directories.