clientsql

package
v0.0.0-...-bcf6333 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SelectFrom = `SELECT
	c.id,
	c.name,
	c.created_at,
	c.updated_at
	FROM ` + Table + ` AS c`

SelectFrom is the query to get all of our columns without any filtering, ordering, etc.

View Source
const Table = "clients"

Table is table we are querying for our client entities.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

Repo is a client.Repo implementation that uses a SQL database as storage.

func New

func New(repo *sqlrepo.Repo) *Repo

New returns a new Repo that uses repo as its helper for talking with the database.

func (*Repo) Add

func (r *Repo) Add(ctx context.Context, c client.Client) error

Add is the client.Repo implementation.

func (*Repo) Get

func (r *Repo) Get(ctx context.Context, id data.Id) (*client.Client, error)

Get is the client.QueryRepo implementation.

func (*Repo) List

func (r *Repo) List(ctx context.Context) ([]*client.Client, error)

List is the client.QueryRepo implementation.

func (*Repo) ListByIds

func (r *Repo) ListByIds(ctx context.Context, ids []data.Id) ([]*client.Client, error)

List is the client.QueryRepo implementation.

func (*Repo) Remove

func (r *Repo) Remove(ctx context.Context, id data.Id) error

Remove is the client.Repo implementation.

func (*Repo) Set

func (r *Repo) Set(ctx context.Context, c client.Client) error

Set is the client.Repo implementation.

Jump to

Keyboard shortcuts

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