database

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package database takes care of read / write process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database added in v1.0.0

type Database interface {
	Prepare(string, ...interface{}) (Stmt, error)
	LastInsertRowID() int64
}

Database describes accesses to a storage

func NewDb

func NewDb() Database

NewDb initialise a new connection

type Db

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

Db represents a connection to the storage

func (Db) LastInsertRowID

func (d Db) LastInsertRowID() int64

LastInsertRowID encapsulates the inner return

func (Db) Prepare

func (d Db) Prepare(sql string, args ...interface{}) (Stmt, error)

Prepare encapsulates the inner connection for testability

type Stmt

type Stmt interface {
	Close() error
	Step() (bool, error)
	Exec(...interface{}) error
	Scan(dst ...interface{}) error
}

Stmt represents a query statement Cf. sqlite3.Stmt

Jump to

Keyboard shortcuts

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