db

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DfltLAVarcharSize specifies a max. size
	// for VARCHARs used for live-attributes columns
	DfltLAVarcharSize = 700

	// DfltColcountVarcharSize specifies a max. size
	// for VARCHARs used for "colcounts" (which is a base
	// for n-grams)
	DfltColcountVarcharSize = 255
)

Variables

This section is empty.

Functions

func GenerateColCountNames

func GenerateColCountNames(colCount VertColumns) []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' )

Types

type BibViewConf

type BibViewConf struct {
	Cols   []string `json:"cols"`
	IDAttr string   `json:"idAttr"`
}

BibViewConf is a sub-configuration for bibliographic data.

func (*BibViewConf) IsConfigured

func (c *BibViewConf) IsConfigured() bool

type Conf

type Conf struct {
	Type           string   `json:"type"`
	Name           string   `json:"name"`
	Host           string   `json:"host"`
	User           string   `json:"user"`
	Password       string   `json:"password"`
	PreconfQueries []string `json:"preconfSettings"`
}

type Insert

type Insert struct {
	Stmt *sql.Stmt
}

func (*Insert) Exec

func (ins *Insert) Exec(values ...any) error

type InsertOperation

type InsertOperation interface {
	Exec(values ...any) error
}

type SelfJoinConf

type SelfJoinConf struct {
	ArgColumns  []string `json:"argColumns"`
	GeneratorFn string   `json:"generatorFn"`
}

SelfJoinConf contains information about aligned structural attributes (e.g. sentences from two languages).

func (*SelfJoinConf) IsConfigured

func (c *SelfJoinConf) IsConfigured() bool

type VertColumn added in v2.4.0

type VertColumn struct {
	Idx   int    `json:"idx"`
	ModFn string `json:"modFn,omitempty"`
}

func (VertColumn) IsUndefined added in v2.4.0

func (vc VertColumn) IsUndefined() bool

type VertColumns added in v2.4.0

type VertColumns []VertColumn

func (VertColumns) GetByIdx added in v2.4.0

func (vc VertColumns) GetByIdx(idx int) VertColumn

func (VertColumns) MaxColumn added in v2.4.0

func (vc VertColumns) MaxColumn() int

MaxColumn returns max index of a column in VertColumns. E.g. if one defines columns {3, 10, 7}, then 10 will be returned.

Rationale: We need this because in some cases, it is easier to prepare slices for all the columns - including the ones a user does not want to export. E.g. for column mod functions, in case user wants just column 3, we create a slice {"", "", "", ""} so that we can theoretically apply column mod to any value.

type Writer

type Writer interface {
	DatabaseExists() bool
	Initialize(appendMode bool) error
	PrepareInsert(table string, attrs []string) (InsertOperation, error)
	Commit() error
	Rollback() error
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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