examples

package
v0.11.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: AGPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const Driver = "sqlize-exampledriver"

use logging DB driver to see whats going on

Variables

View Source
var DBschema bsq.Model
View Source
var Dialect = ExampleDialect{
	StandardSQL: bsq.StdSQL,
}
View Source
var TGroups = struct {
	bsq.Table
	ID, Name bsq.Column
}{
	Table: bsq.Table{Name: "groups"},
}
View Source
var TMembership = struct {
	bsq.Table
	User, Group bsq.Column
}{
	Table: bsq.Table{Name: "membership"},
}
View Source
var TUsers = struct {
	bsq.Table
	ID, Name, RegDate bsq.Column
}{
	Table: bsq.Table{Name: "users"},
}

Functions

func NewUserDBRepo

func NewUserDBRepo(d bsq.CreateDialect) (entity.Repo[User, entity.ID32], error)

func RunCreateScript

func RunCreateScript(cmd sqlize.CtxCmd, drop bool) error

Types

type ExampleDialect

type ExampleDialect struct{ bsq.StandardSQL }

func (ExampleDialect) Create

func (dlc ExampleDialect) Create(
	ctx context.Context,
	cmd sqlize.Cmd,
	query string,
	args ...any,
) (id any, err error)

func (ExampleDialect) FromSQLmap

func (ExampleDialect) FromSQLmap(f *reflect.StructField) func(any) any

func (ExampleDialect) NewQuery

func (dlc ExampleDialect) NewQuery(defn ...any) (*bsq.Query, error)

func (ExampleDialect) ToSQLmap

func (ExampleDialect) ToSQLmap(f *reflect.StructField) func(any) any

type User

type User struct {
	entity.Base[entity.ID32]
	Name    string
	RegDate time.Time
}

func (*User) Equal

func (u *User) Equal(v *User) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL