heptane

package
v0.0.0-...-bed264f Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Implementation of RowProvider relying on database/sql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect interface {

	// TableName writes the name of a table in a sql string to the Builder.
	WriteTableName(sb *strings.Builder, n r.TableName)

	// FieldName writes the name of a field in a sql string to the Builder.
	WriteFieldName(sb *strings.Builder, n r.FieldName)

	// Placeholder writes a placeholder for the argument i of a sql string to
	// the Builder.
	WritePlaceholder(sb *strings.Builder, i int)
}

Dialect offers methods to generate database specific sql strings.

type Row

type Row struct {
	DB      *sql.DB
	Dialect Dialect
}

Row implements RowProvider. Each RowAccess is performed on a single sql.DB.

func (*Row) Access

func (p *Row) Access(a r.RowAccess) error

Access implements RowProvider.

func (*Row) AccessSlice

func (p *Row) AccessSlice(aa []r.RowAccess) (errs []error)

AccessSlice implements RowProvider.

func (*Row) Create

func (p *Row) Create(a r.RowCreate) error

func (*Row) Delete

func (p *Row) Delete(a r.RowDelete) error

func (*Row) Retrieve

func (p *Row) Retrieve(a *r.RowRetrieve) error

func (*Row) Update

func (p *Row) Update(a r.RowUpdate) error

type SqlError

type SqlError struct {
	Err error
}

SqlError is produced when the package database.sql returns an error.

func (SqlError) Error

func (e SqlError) Error() string

type UnsupportedRowAccessTypeError

type UnsupportedRowAccessTypeError struct {
	RowAccess r.RowAccess
}

UnsupportedRowAccessTypeError is produced when the type of a RowAccess is not supported. Current supported types are RowCreate, RowRetrieve, RowUpdate and RowDelete.

func (UnsupportedRowAccessTypeError) Error

Jump to

Keyboard shortcuts

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