unique_checking

package
v0.0.0-...-06e4aab Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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)
	ShouldRetry func(driver string, err error) bool
)
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 A

type A struct {
	Id int64
}

type A_B_C_Row

type A_B_C_Row struct {
	A A
	B B
	C C
}

type A_Id_Field

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

func A_Id

func A_Id(v int64) A_Id_Field

type A_Update_Fields

type A_Update_Fields struct {
}

type B

type B struct {
	Id  int64
	AId int64
}

type B_AId_Field

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

func B_AId

func B_AId(v int64) B_AId_Field

type B_Id_Field

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

func B_Id

func B_Id(v int64) B_Id_Field

type B_Update_Fields

type B_Update_Fields struct {
}

type C

type C struct {
	Id  int64
	Lat float32
	Lon float32
	BId int64
}

type C_BId_Field

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

func C_BId

func C_BId(v int64) C_BId_Field

type C_Id_Field

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

func C_Id

func C_Id(v int64) C_Id_Field

type C_Lat_Field

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

func C_Lat

func C_Lat(v float32) C_Lat_Field

type C_Lon_Field

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

func C_Lon

func C_Lon(v float32) C_Lon_Field

type C_Update_Fields

type C_Update_Fields struct {
}

type D

type D struct {
	Id int64
	A  int64
	B  int64
	C  int64
}

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 D_A_Field

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

func D_A

func D_A(v int64) D_A_Field

type D_B_Field

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

func D_B

func D_B(v int64) D_B_Field

type D_C_Field

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

func D_C

func D_C(v int64) D_C_Field

type D_Id_Field

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

func D_Id

func D_Id(v int64) D_Id_Field

type D_Update_Fields

type D_Update_Fields struct {
}

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 Methods

type Methods interface {
	All_A_B_C_By_A_Id_And_C_Lat_Less_And_C_Lat_Greater_And_C_Lon_Less_And_C_Lon_Greater(ctx context.Context,
		a_id A_Id_Field,
		c_lat_less C_Lat_Field,
		c_lat_greater C_Lat_Field,
		c_lon_less C_Lon_Field,
		c_lon_greater C_Lon_Field) (
		rows []*A_B_C_Row, err error)

	Create_A(ctx context.Context) (
		a *A, err error)

	Create_B(ctx context.Context,
		b_a_id B_AId_Field) (
		b *B, err error)

	Create_C(ctx context.Context,
		c_lat C_Lat_Field,
		c_lon C_Lon_Field,
		c_b_id C_BId_Field) (
		c *C, err error)

	Create_D(ctx context.Context,
		d_a D_A_Field,
		d_b D_B_Field,
		d_c D_C_Field) (
		d *D, err error)
}

type Tx

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

func (*Tx) ExecContext

func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*Tx) QueryContext

func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)

func (*Tx) QueryRowContext

func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row

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