default_fields

package
v0.0.0-...-289d480 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WrapErr = func(err *Error) error { return err }
	Logger  func(format string, args ...any)
)
View Source
var SQLite3JournalMode = "WAL"

SQLite3JournalMode controls the journal_mode pragma for all new connections. Since it is read without a mutex, it must be changed to the value you want before any Open calls.

Functions

func DeleteAll

func DeleteAll(ctx context.Context, db *DB) (int64, error)

Types

type Bar

type Bar struct {
	Pk int64
	A  int
	B  int
	C  int
}

type Bar_A_Field

type Bar_A_Field struct {
	// contains filtered or unexported fields
}

func Bar_A

func Bar_A(v int) Bar_A_Field

type Bar_B_Field

type Bar_B_Field struct {
	// contains filtered or unexported fields
}

func Bar_B

func Bar_B(v int) Bar_B_Field

type Bar_C_Field

type Bar_C_Field struct {
	// contains filtered or unexported fields
}

func Bar_C

func Bar_C(v int) Bar_C_Field

type Bar_Create_Fields

type Bar_Create_Fields struct {
	C Bar_C_Field
}

type Bar_Pk_Field

type Bar_Pk_Field struct {
	// contains filtered or unexported fields
}

func Bar_Pk

func Bar_Pk(v int64) Bar_Pk_Field

type Bar_Update_Fields

type Bar_Update_Fields struct {
}

type Baz

type Baz struct {
	Pk int64
	A  int
	B  int
	C  int
}

type Baz_A_Field

type Baz_A_Field struct {
	// contains filtered or unexported fields
}

func Baz_A

func Baz_A(v int) Baz_A_Field

type Baz_B_Field

type Baz_B_Field struct {
	// contains filtered or unexported fields
}

func Baz_B

func Baz_B(v int) Baz_B_Field

type Baz_C_Field

type Baz_C_Field struct {
	// contains filtered or unexported fields
}

func Baz_C

func Baz_C(v int) Baz_C_Field

type Baz_Create_Fields

type Baz_Create_Fields struct {
	A Baz_A_Field
	B Baz_B_Field
	C Baz_C_Field
}

type Baz_Pk_Field

type Baz_Pk_Field struct {
	// contains filtered or unexported fields
}

func Baz_Pk

func Baz_Pk(v int64) Baz_Pk_Field

type Baz_Update_Fields

type Baz_Update_Fields struct {
}

type DB

type DB struct {
	*sql.DB

	Hooks struct {
		Now func() time.Time
	}
	// contains filtered or unexported fields
}

func Open

func Open(driver, source string) (db *DB, err error)

func (*DB) Close

func (obj *DB) Close() (err error)

func (*DB) Open

func (obj *DB) Open(ctx context.Context) (*Tx, error)

type DBMethods

type DBMethods interface {
	Methods

	Schema() []string
	DropSchema() []string

	Rebind(sql string) string
}

type Error

type Error struct {
	Err         error
	Code        ErrorCode
	Driver      string
	Constraint  string
	QuerySuffix string
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode int
const (
	ErrorCode_Unknown ErrorCode = iota
	ErrorCode_UnsupportedDriver
	ErrorCode_NoRows
	ErrorCode_TxDone
	ErrorCode_TooManyRows
	ErrorCode_ConstraintViolation
	ErrorCode_EmptyUpdate
)

type Foo

type Foo struct {
	Pk int64
	A  int
	B  int
	C  int
}

type Foo_A_Field

type Foo_A_Field struct {
	// contains filtered or unexported fields
}

func Foo_A

func Foo_A(v int) Foo_A_Field

type Foo_B_Field

type Foo_B_Field struct {
	// contains filtered or unexported fields
}

func Foo_B

func Foo_B(v int) Foo_B_Field

type Foo_C_Field

type Foo_C_Field struct {
	// contains filtered or unexported fields
}

func Foo_C

func Foo_C(v int) Foo_C_Field

type Foo_Create_Fields

type Foo_Create_Fields struct {
	C Foo_C_Field
}

type Foo_Pk_Field

type Foo_Pk_Field struct {
	// contains filtered or unexported fields
}

func Foo_Pk

func Foo_Pk(v int64) Foo_Pk_Field

type Foo_Update_Fields

type Foo_Update_Fields struct {
}

type Methods

type Methods interface {
	Create_Bar(ctx context.Context,
		bar_a Bar_A_Field,
		bar_b Bar_B_Field,
		optional Bar_Create_Fields) (
		bar *Bar, err error)

	Create_Baz(ctx context.Context,
		optional Baz_Create_Fields) (
		baz *Baz, err error)

	Create_Foo(ctx context.Context,
		optional Foo_Create_Fields) (
		foo *Foo, err error)

	Create_Minimal(ctx context.Context) (
		minimal *Minimal, err error)

	Get_Bar_By_Pk(ctx context.Context,
		bar_pk Bar_Pk_Field) (
		bar *Bar, err error)

	Get_Baz_By_Pk(ctx context.Context,
		baz_pk Baz_Pk_Field) (
		baz *Baz, err error)

	Get_Foo_By_Pk(ctx context.Context,
		foo_pk Foo_Pk_Field) (
		foo *Foo, err error)
}

type Minimal

type Minimal struct {
	Pk int64
}

type Minimal_Pk_Field

type Minimal_Pk_Field struct {
	// contains filtered or unexported fields
}

func Minimal_Pk

func Minimal_Pk(v int64) Minimal_Pk_Field

type Minimal_Update_Fields

type Minimal_Update_Fields struct {
}

type Special

type Special struct {
	Pk int64
	A  time.Time
	B  []byte
}

type Special_A_Field

type Special_A_Field struct {
	// contains filtered or unexported fields
}

func Special_A

func Special_A(v time.Time) Special_A_Field

type Special_B_Field

type Special_B_Field struct {
	// contains filtered or unexported fields
}

func Special_B

func Special_B(v []byte) Special_B_Field

type Special_Create_Fields

type Special_Create_Fields struct {
	A Special_A_Field
	B Special_B_Field
}

type Special_Pk_Field

type Special_Pk_Field struct {
	// contains filtered or unexported fields
}

func Special_Pk

func Special_Pk(v int64) Special_Pk_Field

type Special_Update_Fields

type Special_Update_Fields struct {
}

type Tx

type Tx struct {
	Tx *sql.Tx
	// contains filtered or unexported fields
}

type TxMethods

type TxMethods interface {
	Methods

	Rebind(s string) string
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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