db

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecVTOrc

func ExecVTOrc(query string, args ...any) (sql.Result, error)

ExecVTOrc will execute given query on the vtorc backend database.

func IsSQLite

func IsSQLite() bool

func OpenVTOrc

func OpenVTOrc() (db *sql.DB, err error)

OpenTopology returns the DB instance for the vtorc backed database

func QueryVTOrc

func QueryVTOrc(query string, argsArray []any, onRow func(sqlutils.RowMap) error) error

QueryVTOrc

func QueryVTOrcRowsMap

func QueryVTOrcRowsMap(query string, onRow func(sqlutils.RowMap) error) error

QueryVTOrcRowsMap

func ReadTimeNow

func ReadTimeNow() (timeNow string, err error)

ReadTimeNow reads and returns the current timestamp as string. This is an unfortunate workaround to support both MySQL and SQLite in all possible timezones. SQLite only speaks UTC where MySQL has timezone support. By reading the time as string we get the database's de-facto notion of the time, which we can then feed back to it.

Types

type DB

type DB interface {
	QueryVTOrc(query string, argsArray []any, onRow func(sqlutils.RowMap) error) error
}
var (
	Db DB = (*vtorcDB)(nil)
)

type DummySQLResult

type DummySQLResult struct {
}

func (DummySQLResult) LastInsertId

func (dummyRes DummySQLResult) LastInsertId() (int64, error)

func (DummySQLResult) RowsAffected

func (dummyRes DummySQLResult) RowsAffected() (int64, error)

Jump to

Keyboard shortcuts

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