sql

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sql contains infrastructure layer SQL implementations.

This package does not import any specific driver. The code must work on any supported dialect, so it should be as agnostic as possible. However, when there is a need for some specific dialect features, the code must be protected with constructions like:

if tx.Dialect().Name() == dialect.PG {
   // do something specific to PostgreSQL
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(db *bun.DB) *Store

func (*Store) CreateProject

func (s *Store) CreateProject(ctx context.Context, project aud.Project) error

func (*Store) CreateRecord

func (s *Store) CreateRecord(ctx context.Context, record aud.Record) error

func (*Store) CreateRecords

func (s *Store) CreateRecords(ctx context.Context, records []aud.Record) error

func (*Store) DeleteRecord

func (s *Store) DeleteRecord(ctx context.Context, projectID aud.ID, id aud.ID) error

func (*Store) GetProject

func (s *Store) GetProject(ctx context.Context, id aud.ID) (aud.Project, error)

func (*Store) GetRecord

func (s *Store) GetRecord(
	ctx context.Context,
	projectID aud.ID,
	id aud.ID,
) (aud.Record, error)

func (*Store) ListProjects

func (s *Store) ListProjects(
	ctx context.Context,
	limit int32,
	cursor aud.ProjectCursor,
) ([]aud.Project, error)

func (*Store) ListRecords

func (s *Store) ListRecords(
	ctx context.Context,
	projectID aud.ID,
	filter aud.RecordFilter,
	limit int32,
	cursor aud.RecordCursor,
) ([]aud.Record, error)

func (*Store) UpdateProject

func (s *Store) UpdateProject(
	ctx context.Context,
	id aud.ID,
	update aud.ProjectUpdate,
) (aud.Project, error)

func (*Store) UpdateRecord

func (s *Store) UpdateRecord(
	ctx context.Context,
	projectID aud.ID,
	id aud.ID,
	update aud.RecordUpdate,
) (aud.Record, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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