database

package
v0.0.0-...-be6f397 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBMutex      sync.Mutex
	Databases    map[string]*sql.DB
	DriverString string
	IsCSV        bool
)

Functions

func GetDatabaseForFile

func GetDatabaseForFile(database string) *sql.DB

GetDatabaseForFile does what you think it does

func ProcessSqlQueryForDatabaseType

func ProcessSqlQueryForDatabaseType(q Query, rowData map[string]interface{}, schemaName, columnName string, db *Database)

Types

type Database

type Database interface {
	Update(q *Update)
	GenerateQuery(u *Update) (string, []string)
	GetPlaceholderForDatabaseType() string
	GetFileName() string
	GetTableNamesQuery() string
	GetDatabaseReference() *sql.DB
	CloseDatabaseReference()
	SetDatabaseReference(dbPath string)
}

type Query

type Query interface {
	GetValues() map[string]interface{}
	SetValues(map[string]interface{})
}

type SQLite

type SQLite struct {
	FileName string
	Database *sql.DB
}

func (*SQLite) CloseDatabaseReference

func (db *SQLite) CloseDatabaseReference()

func (*SQLite) GenerateQuery

func (db *SQLite) GenerateQuery(u *Update) (string, []string)

func (*SQLite) GetDatabaseReference

func (db *SQLite) GetDatabaseReference() *sql.DB

func (*SQLite) GetFileName

func (db *SQLite) GetFileName() string

func (SQLite) GetPlaceholderForDatabaseType

func (db SQLite) GetPlaceholderForDatabaseType() string

func (SQLite) GetTableNamesQuery

func (db SQLite) GetTableNamesQuery() string

func (*SQLite) SetDatabaseReference

func (db *SQLite) SetDatabaseReference(dbPath string)

func (*SQLite) Update

func (db *SQLite) Update(q *Update)

type Update

type Update struct {
	Column    string      // this is the header
	Update    interface{} // this is the new cell value
	TableName string
	// contains filtered or unexported fields
}

func (*Update) GetValues

func (u *Update) GetValues() map[string]interface{}

func (*Update) SetValues

func (u *Update) SetValues(v map[string]interface{})

Jump to

Keyboard shortcuts

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