storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2016 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbType

type DbType int

DbType defines the type of the db

const (
	MSSQL      DbType = iota // MS SQL Server
	PostgreSQL               // Postgresql
)

Relational Db Types

func ConvertToDbType

func ConvertToDbType(value string) (DbType, error)

ConvertToDbType convert's a string to a DbType

type Storage

type Storage struct {
	DbType                    DbType
	AppendStatement           string
	SelectBySourceIDStatement string
	// contains filtered or unexported fields
}

Storage a db abstraction

func NewStorage

func NewStorage(dbType DbType, connection string, tableName string) (*Storage, error)

NewStorage creates a new storage

func NewStorageFinalized

func NewStorageFinalized(db *sql.DB, dbType DbType, tableName string) (*Storage, error)

NewStorageFinalized creates a new storage with a passed in db argument

func (*Storage) Close

func (db *Storage) Close() (err error)

Close close db

func (*Storage) Exec

func (db *Storage) Exec(query string, args ...interface{}) (*sql.Result, error)

Exec executes sql statement

func (*Storage) Query

func (db *Storage) Query(query string, args ...interface{}) (*sql.Rows, error)

Query executes a query statement

Jump to

Keyboard shortcuts

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