store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package store abstracts the database layer behind store.Store methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDefaults added in v0.0.2

func WithDefaults() []sqlxmod.Opt

func WithMigrations added in v0.0.2

func WithMigrations() sqlxmod.Opt

func WithOtel added in v0.0.2

func WithOtel() sqlxmod.Opt

Types

type NamedDB added in v0.1.0

type NamedDB struct {
	*sqlx.DB
}

NamedDB is a wrapper around sqlx.DB that adds NamedGetContext method. https://github.com/jmoiron/sqlx/issues/154#issuecomment-148216948

func (NamedDB) NamedGetContext added in v0.1.0

func (n NamedDB) NamedGetContext(ctx context.Context, dest interface{}, query string, arg interface{}) error

NamedGetContext executes a named query with the given context and arguments. It prepares the statement, executes it, and scans the result into the destination. This is commonly used for INSERT ... RETURNING query.

type Store

type Store struct {
	srvc.Module
	// contains filtered or unexported fields
}

Store wraps the sqlxmod module and provides an interface to interact with the database.

func New

func New(opts ...sqlxmod.Opt) *Store

func (*Store) Healthy

func (s *Store) Healthy(ctx context.Context) error

Jump to

Keyboard shortcuts

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