csvimporter

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropAllTables

func DropAllTables(db *sql.DB, tbs []string) error

func ImportCSV2DB

func ImportCSV2DB(db *sql.DB, file string) (string, error)

func ImportTable

func ImportTable(db *sql.DB, tb *Table) error

func ShowTables

func ShowTables(db *sql.DB) ([]string, error)

Types

type Column

type Column struct {
	Name string
	Type string
}
type Header []Column

func (Header) Columns

func (d Header) Columns() []string

func (Header) Types

func (d Header) Types() []string

type QueryResult

type QueryResult []string

func Query

func Query(db *sql.DB, query string) ([]QueryResult, error)

func (QueryResult) Convert2AnyArray

func (q QueryResult) Convert2AnyArray() []any

type Schema

type Schema struct {
	Cid       interface{} `json:"cid"`
	Name      string      `json:"name"`
	ColType   string      `json:"colType"`
	Notnull   interface{} `json:"notnull"`
	DfltValue interface{} `json:"dflt_Value"`
	Pk        interface{} `json:"pk"`
}

func SQLiteTableInfo

func SQLiteTableInfo(db *sql.DB, table string) ([]Schema, error)

type Table

type Table struct {
	Name   string
	Header Header
	Data   [][]any
}

func Parse

func Parse(file string) (*Table, error)

Jump to

Keyboard shortcuts

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