paged_composite

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 ConsumedSerial

type ConsumedSerial struct {
	ExpiresAt     time.Time
	StorageNodeId []byte
	ProjectId     []byte
	BucketName    []byte
	Action        uint
	SerialNumber  []byte
	Settled       uint64
}

type ConsumedSerial_Action_Field

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

func ConsumedSerial_Action

func ConsumedSerial_Action(v uint) ConsumedSerial_Action_Field

type ConsumedSerial_BucketName_Field

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

func ConsumedSerial_BucketName

func ConsumedSerial_BucketName(v []byte) ConsumedSerial_BucketName_Field

type ConsumedSerial_ExpiresAt_Field

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

func ConsumedSerial_ExpiresAt

func ConsumedSerial_ExpiresAt(v time.Time) ConsumedSerial_ExpiresAt_Field

type ConsumedSerial_ProjectId_Field

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

func ConsumedSerial_ProjectId

func ConsumedSerial_ProjectId(v []byte) ConsumedSerial_ProjectId_Field

type ConsumedSerial_SerialNumber_Field

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

func ConsumedSerial_SerialNumber

func ConsumedSerial_SerialNumber(v []byte) ConsumedSerial_SerialNumber_Field

type ConsumedSerial_Settled_Field

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

func ConsumedSerial_Settled

func ConsumedSerial_Settled(v uint64) ConsumedSerial_Settled_Field

type ConsumedSerial_StorageNodeId_Field

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

func ConsumedSerial_StorageNodeId

func ConsumedSerial_StorageNodeId(v []byte) ConsumedSerial_StorageNodeId_Field

type ConsumedSerial_Update_Fields

type ConsumedSerial_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 Methods

type Methods interface {
	CreateNoReturn_ConsumedSerial(ctx context.Context,
		consumed_serial_expires_at ConsumedSerial_ExpiresAt_Field,
		consumed_serial_storage_node_id ConsumedSerial_StorageNodeId_Field,
		consumed_serial_project_id ConsumedSerial_ProjectId_Field,
		consumed_serial_bucket_name ConsumedSerial_BucketName_Field,
		consumed_serial_action ConsumedSerial_Action_Field,
		consumed_serial_serial_number ConsumedSerial_SerialNumber_Field,
		consumed_serial_settled ConsumedSerial_Settled_Field) (
		err error)

	Paged_ConsumedSerial_By_ExpiresAt_Greater(ctx context.Context,
		consumed_serial_expires_at_greater ConsumedSerial_ExpiresAt_Field,
		limit int, start *Paged_ConsumedSerial_By_ExpiresAt_Greater_Continuation) (
		rows []*ConsumedSerial, next *Paged_ConsumedSerial_By_ExpiresAt_Greater_Continuation, err error)
}

type Paged_ConsumedSerial_By_ExpiresAt_Greater_Continuation

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

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