gormite_databases

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgXWrapper

type PgXWrapper struct {
	*pgxpool.Pool
	// contains filtered or unexported fields
}

func (*PgXWrapper) Exec

func (w *PgXWrapper) Exec(
	ctx context.Context,
	sqlQuery string,
	args ...interface{},
) (pgconn.CommandTag, error)

func (*PgXWrapper) Query

func (w *PgXWrapper) Query(
	ctx context.Context,
	sqlQuery string,
	args ...any,
) (pgx.Rows, error)

type PgxWrappedDatabase

type PgxWrappedDatabase interface {
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	Exec(ctx context.Context, sql string, arguments ...any) (
		pgconn.CommandTag,
		error,
	)
}

type PostgresDatabase

type PostgresDatabase struct {
	PgX       PgxWrappedDatabase
	PgxConfig *pgxpool.Config
	// contains filtered or unexported fields
}

func NewPostgresDatabase

func NewPostgresDatabase(dsn string) *PostgresDatabase

func (*PostgresDatabase) Destruct

func (d *PostgresDatabase) Destruct()

func (*PostgresDatabase) Exec

func (d *PostgresDatabase) Exec(
	ctx context.Context,
	sql string,
	args ...interface{},
) (pgconn.CommandTag, error)

func (*PostgresDatabase) Get

func (d *PostgresDatabase) Get(sql string, args ...interface{}) QueryInterface

func (*PostgresDatabase) Select

func (d *PostgresDatabase) Select(sql string, args ...interface{}) QueryInterface

type PostgresDatabaseInterface

type PostgresDatabaseInterface interface {
	Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
	Select(sql string, args ...interface{}) QueryInterface
	Get(sql string, args ...interface{}) QueryInterface
}

PostgresDatabaseInterface - TODO: Remove after move to utility library

type Query

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

func (*Query) Exec

func (q *Query) Exec(ctx context.Context) error

func (*Query) ExecWrapped

func (q *Query) ExecWrapped(ctx context.Context) error

func (*Query) Scan

func (q *Query) Scan(dest ...interface{}) QueryInterface

func (*Query) ScanCol

func (q *Query) ScanCol(dest ...interface{}) QueryInterface

type QueryInterface

type QueryInterface interface {
	Scan(dest ...interface{}) QueryInterface
	ScanCol(dest ...interface{}) QueryInterface
	Exec(ctx context.Context) error
}

type SqlError

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

func (*SqlError) Error

func (e *SqlError) Error() string

func (*SqlError) GetExtraData

func (e *SqlError) GetExtraData() map[string]any

Jump to

Keyboard shortcuts

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