gsqlitehandler

package module
v0.0.0-...-96abf18 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2016 License: GPL-3.0 Imports: 5 Imported by: 1

README

gsqlitehandler

Simple sqlite wrapper around most commonly used functions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqliteDB

type SqliteDB struct {
	Path       string
	Properties map[string]string
	Handler    *sql.DB
}

SqliteDB struct is the basic wrapper type for sqlite object.

func New

func New(dbPath string, properties map[string]string) *SqliteDB

New returns new SqliteDB object with Path and properties initialized.

func (*SqliteDB) Close

func (d *SqliteDB) Close()

Close zeroes Path and Properties and eventually closes Handler.

func (*SqliteDB) CreateNew

func (d *SqliteDB) CreateNew(sqlCreateTablesStmt string) error

CreateNew creates tables from the given SQL code (sqlCreateTablesStmt) and PROPERTIES table. PROPERTIES table is populated with SqliteDB Properties key-value pair(s).

func (*SqliteDB) Open

func (d *SqliteDB) Open() error

Open tries to open the SqliteDB for given Path and checks if the database has the same tags (PROPERTIES) as current SqliteDB Properties. If so, returns true. Otherwise it returns false.

Jump to

Keyboard shortcuts

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