database

package
v0.0.0-...-d41ed40 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableFile           = "file"
	TablePlace          = "place"
	TableScheduledEvent = "scheduled_event"
)

Variables

View Source
var PSQL = sq.StatementBuilder.PlaceholderFormat(sq.Dollar)

Functions

func RollbackTx

func RollbackTx(ctx context.Context, tx Tx)

Types

type Execer

type Execer interface {
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
}

type PGX

type PGX interface {
	Queryable
	BeginTX(ctx context.Context, opts *pgx.TxOptions) (Tx, error)
}

type Queryable

type Queryable interface {
	Exec(ctx context.Context, sqlizer Sqlizer) (pgconn.CommandTag, error)
	Get(ctx context.Context, dst interface{}, sqlizer Sqlizer) error
	Select(ctx context.Context, dst interface{}, sqlizer Sqlizer) error
	ExecRaw(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
}

type RawQuery

type RawQuery string

func (RawQuery) ToSql

func (r RawQuery) ToSql() (string, []interface{}, error)

nolint:revive

type Sqlizer

type Sqlizer interface {
	ToSql() (sql string, args []interface{}, err error)
}

type Tx

type Tx interface {
	Queryable
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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