dalgo2sql

package module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 10 Imported by: 2

README

dalgo2sql

SQL driver for DALgo - a Database Abstraction Layer in Go.

Status

Lint, Vet, Build, Test Go Report Card GoDoc

Usage

go get github.com/dal-go/dalgo2sql

License

Free to use and open source under MIT License.

Documentation

Index

Constants

View Source
const Version = "0.0.8"

Version indicates package version

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(db *sql.DB, options Options) dal.DB

NewDatabase creates a new instance of DALgo adapter to SQL database

Types

type Field

type Field struct {
	Name string
}

Field defines field

func (Field) String added in v0.0.9

func (v Field) String() string

type Options

type Options struct {
	PrimaryKey []string
	Recordsets map[string]*Recordset
}

Options provides database sqlOptions for DALgo - // TODO: document why & how to use

func (Options) GetRecordsetByKey added in v0.0.9

func (o Options) GetRecordsetByKey(key *dal.Key) *Recordset

func (Options) PrimaryKeyFieldNames added in v0.0.9

func (o Options) PrimaryKeyFieldNames(key *dal.Key) (primaryKey []string)

type Recordset

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

Recordset hold recordset settings

func NewRecordset added in v0.0.9

func NewRecordset(name string, t RecordsetType, primaryKey []dal.FieldRef) *Recordset

func (*Recordset) Name

func (v *Recordset) Name() string

func (*Recordset) PrimaryKey

func (v *Recordset) PrimaryKey() []dal.FieldRef

func (*Recordset) PrimaryKeyFieldNames added in v0.0.9

func (v *Recordset) PrimaryKeyFieldNames() []string

func (*Recordset) Type

func (v *Recordset) Type() RecordsetType

type RecordsetType

type RecordsetType = int

RecordsetType defines type of a database recordset

const (
	// Table identifies a table in a database
	Table RecordsetType = iota
	// View identifies a view in a database
	View
	// StoredProcedure identifies a stored procedure in a database
	StoredProcedure
)

Directories

Path Synopsis
end2end module

Jump to

Keyboard shortcuts

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