Documentation ¶
Index ¶
- Constants
- func Delete32(repo Repo32, db SQL, entity Entity32) error
- func Delete64(repo Repo64, db SQL, entity Entity64) error
- func NotNoRows(err error) error
- func RunScript(db SQL, rd io.Reader) error
- func RunScriptFile(db SQL, file string) error
- func Transact(conn SQL, do func(tx Tx) error) (err error)
- func TransactContext(ctx context.Context, conn SQL, opts *sql.TxOptions, do func(tx Tx) error) (err error)
- func Update32(repo Repo32, db SQL, entity Entity32) error
- func Update64(repo Repo64, db SQL, entity Entity64) error
- type Beginner
- type DB
- type Entity32
- type Entity64
- type EntityBase32
- type ID32
- type ID64
- type NormSpace
- type Reader32
- type Reader64
- type Ref32
- func (ref *Ref32) Get(db SQL) (entity Entity32, err error)
- func (ref Ref32) ID() ID32
- func (ref Ref32) Nil() bool
- func (ref *Ref32) Resolved() (is bool, entity Entity32)
- func (ref *Ref32) Scan(src interface{}) error
- func (ref *Ref32) Set(e Entity32)
- func (ref *Ref32) SetID(rsv Reader32, id ID32)
- func (ref Ref32) Value() (driver.Value, error)
- func (ref Ref32) WithResolver(rsv Reader32) Ref32
- type Ref64
- func (ref *Ref64) Get(db SQL) (entity Entity64, err error)
- func (ref Ref64) ID() ID64
- func (ref Ref64) Nil() bool
- func (ref *Ref64) Resolved() (is bool, entity Entity64)
- func (ref *Ref64) Scan(src interface{}) error
- func (ref *Ref64) Set(e Entity64)
- func (ref *Ref64) SetID(rsv Reader64, id ID64)
- func (ref Ref64) Value() (driver.Value, error)
- func (ref Ref64) WithResolver(rsv Reader64) Ref64
- type Repo32
- type Repo64
- type RollbackError
- type SQL
- type Tx
- type TypeID
- type TypeTable
- type Wrapper
Constants ¶
View Source
const IDSeqMax32 = 4194303 // 0x3f_ffff
View Source
const IDSeqMax64 = 281474976710655 // 0xffff_ffffffff
View Source
const IDTypeMax32 = 511 // 0x1ff
View Source
const IDTypeMax64 = 32767 // 0x7fff
View Source
const NoID = 0
NoID is an ID that no DB record must have as an ID.
Variables ¶
This section is empty.
Functions ¶
func RunScriptFile ¶
func TransactContext ¶
Types ¶
type EntityBase32 ¶
type EntityBase32 struct {
// contains filtered or unexported fields
}
func (EntityBase32) EntityID ¶
func (e EntityBase32) EntityID() ID32
func (EntityBase32) EntityRepo ¶
func (e EntityBase32) EntityRepo() Repo32
func (*EntityBase32) SetEntityRepo ¶
func (e *EntityBase32) SetEntityRepo(r Repo32, id ID32)
type ID32 ¶
type ID32 int32
ID32 is the 32-bit ID type.
func MustMakeID32 ¶
MustMakeID32 panics if MakeID32 returns an error.
func NoRowsNoErr32 ¶
NoRowsNoErr32 returns NoID, nil when err is sql.ErrNoRows
type ID64 ¶
type ID64 int64
ID64 is the 64-bit ID type.
func MustMakeID64 ¶
MustMakeID64 panics if MakeID64 returns an error.
func NoRowsNoErr64 ¶
NoRowsNoErr64 returns NoID, nil when err is sql.ErrNoRows
type Ref32 ¶
type Ref32 struct {
// contains filtered or unexported fields
}
func RefEntity32 ¶
func (Ref32) WithResolver ¶
type Ref64 ¶
type Ref64 struct {
// contains filtered or unexported fields
}
func RefEntity64 ¶
func (Ref64) WithResolver ¶
type RollbackError ¶
func (RollbackError) Error ¶
func (ce RollbackError) Error() string
func (RollbackError) Unwrap ¶
func (ce RollbackError) Unwrap() error
type SQL ¶
type TypeID ¶
type TypeID = uint16
To support ploymorphism IDs consist of a TypeID part and a sequence part. The number of bits for both parts depend on the number of bits in the ID type. Currently only ID32 and ID64, i.e. uint32 and uint64, are supported ID types. A valid type id must be > 0.
Directories ¶
Path | Synopsis |
---|---|
Package bsq helps to build maintainable structured queries for SQL.
|
Package bsq helps to build maintainable structured queries for SQL. |
keywords
Package keywords defines some handy SQL keywords as const strings for use with the bsq query builder.
|
Package keywords defines some handy SQL keywords as const strings for use with the bsq query builder. |
postgres
Package postgres implements the PostgreSQL dialect for bsq.
|
Package postgres implements the PostgreSQL dialect for bsq. |
sqlite3
Package sqlite3 implements the SQLite 3 dialect for bsq.
|
Package sqlite3 implements the SQLite 3 dialect for bsq. |
Package buildsq helps to build structured queries for the structured query language.
|
Package buildsq helps to build structured queries for the structured query language. |
cmd
|
|
Deprecated: The goxic package will soon be removed.
|
Deprecated: The goxic package will soon be removed. |
Package null implements typed adapters for Go values to nullable DB columns.
|
Package null implements typed adapters for Go values to nullable DB columns. |
Click to show internal directories.
Click to hide internal directories.