Documentation
¶
Overview ¶
Package driver provides file SQL driver implementation. This package implements database/sql/driver interfaces to enable reading CSV, TSV, and LTSV files as SQL databases through SQLite3.
Package driver provides file SQL driver implementation for database/sql
Index ¶
- Variables
- type Connection
- func (conn *Connection) Begin() (driver.Tx, error)
- func (conn *Connection) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (conn *Connection) Close() error
- func (conn *Connection) Dump(outputDir string) error
- func (conn *Connection) Prepare(query string) (driver.Stmt, error)
- func (conn *Connection) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- type Connector
- type Driver
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoPathsProvided is returned when no paths are provided ErrNoPathsProvided = errors.New("filesql driver: no paths provided") // ErrNoFilesLoaded is returned when no files were loaded ErrNoFilesLoaded = errors.New("filesql driver: no files were loaded") // ErrStmtExecContextNotSupported is returned when statement does not support ExecContext ErrStmtExecContextNotSupported = errors.New("filesql driver: statement does not support ExecContext") // ErrBeginTxNotSupported is returned when underlying connection does not support BeginTx ErrBeginTxNotSupported = errors.New("filesql driver: underlying connection does not support BeginTx") // ErrPrepareContextNotSupported is returned when underlying connection does not support PrepareContext ErrPrepareContextNotSupported = errors.New("filesql driver: underlying connection does not support PrepareContext") // ErrNotFilesqlConnection is returned when connection is not a filesql connection ErrNotFilesqlConnection = errors.New("filesql driver: connection is not a filesql connection") )
Predefined errors
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection implements database/sql/driver.Conn interface
func (*Connection) Begin ¶
func (conn *Connection) Begin() (driver.Tx, error)
Begin implements driver.Conn interface (deprecated, use BeginTx instead)
func (*Connection) Close ¶
func (conn *Connection) Close() error
Close implements driver.Conn interface
func (*Connection) Dump ¶
func (conn *Connection) Dump(outputDir string) error
Dump exports all tables from SQLite3 database to specified directory in CSV format
func (*Connection) Prepare ¶
func (conn *Connection) Prepare(query string) (driver.Stmt, error)
Prepare implements driver.Conn interface (deprecated, use PrepareContext instead)
func (*Connection) PrepareContext ¶
PrepareContext implements driver.ConnPrepareContext interface
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector implements database/sql/driver.Connector interface
type Driver ¶
type Driver struct{}
Driver implements database/sql/driver.Driver interface for file-based SQL
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction implements database/sql/driver.Tx interface
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
Commit implements driver.Tx interface
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
Rollback implements driver.Tx interface