db

package
v0.18.6 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBibView

func CreateBibView(database *sql.DB, cols []string, idAttr string) error

CreateBibView creates a database view needed by liveattrs to fetch bibliography information.

func CreateSchema

func CreateSchema(database *sql.DB, structures map[string][]string, indexedCols []string, useSelfJoin bool,
	countColumns []int) error

CreateSchema creates all the required tables, views and indices

func DropExisting

func DropExisting(database *sql.DB) error

DropExisting drops existing tables/views. It is safe to call this even if one or more of these does not exist.

func GenerateColCountNames

func GenerateColCountNames(colCount []int) []string

GenerateColCountNames creates a list of general column names for positional attributes we would like to count. E.g. in case we want [0, 1, 3] (this can be something like 'word', 'lemma' )

func OpenDatabase

func OpenDatabase(dbPath string) (*sql.DB, error)

OpenDatabase opens a sqlite3 database specified by its filesystem path. In case of an error it panics.

func PrepareInsert

func PrepareInsert(database *sql.Tx, table string, cols []string) (*sql.Stmt, error)

PrepareInsert creates a prepared statement for an INSERT operation.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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