sql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoColumn = errors.New("no column found")
	ErrNoEntity = errors.New("no entities provided")
)

Functions

This section is empty.

Types

type SQL

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

SQL is a SQL store implementation of the orbital.Store interface.

func New

func New(ctx context.Context, db *sql.DB) (*SQL, error)

New initializes a new SQL store and sets up required tables.

func (*SQL) Create

func (s *SQL) Create(ctx context.Context, rs ...orbital.Entity) ([]orbital.Entity, error)

Create implements orbital.Store.

func (*SQL) Find

func (s *SQL) Find(ctx context.Context, q query.Query) (orbital.FindResult, error)

Find implements orbital.Store.

func (*SQL) List

func (s *SQL) List(ctx context.Context, q query.Query) (orbital.ListResult, error)

List implements orbital.Store.

func (*SQL) Transaction

func (s *SQL) Transaction(ctx context.Context, txFunc orbital.TransactionFunc) error

Transaction implements orbital.Store.

func (*SQL) Update

func (s *SQL) Update(ctx context.Context, rs ...orbital.Entity) ([]orbital.Entity, error)

Update implements orbital.Store.

Jump to

Keyboard shortcuts

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