csv

package
v1.1.164 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
}

Conn i empty structure

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table implement dbEngine interface Table for csv

func NewTable

func NewTable(filePath string) (*Table, error)

NewTable open csv & init conn

func (*Table) Columns

func (t *Table) Columns() []dbEngine.Column

Columns of Table

func (*Table) Comment added in v1.0.1019

func (t *Table) Comment() string

Comment of Table

func (*Table) Delete added in v1.0.1151

func (t *Table) Delete(ctx context.Context, Options ...dbEngine.BuildSqlOptions) (int64, error)

Delete row of table according to Options

func (*Table) ExecDDL

func (t *Table) ExecDDL(ctx context.Context, sql string, args ...interface{}) error

ExecDDL execute sql

func (*Table) FindColumn

func (t *Table) FindColumn(name string) dbEngine.Column

FindColumn return column 'name' on Table or nil

func (*Table) FindIndex

func (t *Table) FindIndex(name string) *dbEngine.Index

FindIndex get index according to name

func (*Table) GetColumns

func (t *Table) GetColumns(ctx context.Context, dbTypes map[string]dbEngine.Types) error

GetColumns получение значений полей для форматирования данных

func (*Table) GetSchema

func (t *Table) GetSchema(ctx context.Context) (map[string]dbEngine.Table, map[string]dbEngine.Routine, error)

GetSchema read DB schema & store it

func (*Table) GetStat

func (t *Table) GetStat() string

GetStat return stats of conn

func (*Table) Indexes added in v1.0.1113

func (t *Table) Indexes() dbEngine.Indexes

Indexes get indexex according to table

func (*Table) InitConn

func (t *Table) InitConn(ctx context.Context, filePath string) error

InitConn create csv reader

func (*Table) Insert

func (t *Table) Insert(ctx context.Context, Options ...dbEngine.BuildSqlOptions) (int64, error)

Insert new row & return new ID or rowsAffected if there not autoinc field

func (*Table) Name

func (t *Table) Name() string

Name of Table

func (*Table) NewTable

func (t *Table) NewTable(name, typ string) dbEngine.Table

NewTable create empty Table

func (*Table) ReReadColumn added in v1.0.1040

func (t *Table) ReReadColumn(ctx context.Context, name string) dbEngine.Column

ReReadColumn renew properties of column 'name'

func (*Table) Select

func (t *Table) Select(ctx context.Context, Options ...dbEngine.BuildSqlOptions) error

Select run sql with Options (deprecated)

func (*Table) SelectAndRunEach

func (t *Table) SelectAndRunEach(ctx context.Context, each dbEngine.FncEachRow, Options ...dbEngine.BuildSqlOptions) error

SelectAndRunEach run sql of table with Options & performs each every row of query results

func (*Table) SelectAndScanEach

func (t *Table) SelectAndScanEach(ctx context.Context, each func() error, rowValue dbEngine.RowScanner, Options ...dbEngine.BuildSqlOptions) error

SelectAndScanEach run sql of table with Options & return every row into rowValues & run each

func (*Table) SelectOneAndScan added in v1.0.1088

func (t *Table) SelectOneAndScan(ctx context.Context, row interface{}, Options ...dbEngine.BuildSqlOptions) error

SelectOneAndScan run sqlof table with Options & return rows into rowValues

func (*Table) Update

func (t *Table) Update(ctx context.Context, Options ...dbEngine.BuildSqlOptions) (int64, error)

Update table according to Options

func (*Table) Upsert

func (t *Table) Upsert(ctx context.Context, Options ...dbEngine.BuildSqlOptions) (int64, error)

Upsert preforms INSERT sql or UPDATE if record with primary keys exists

Jump to

Keyboard shortcuts

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