driver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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) BeginTx

func (conn *Connection) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

BeginTx implements driver.ConnBeginTx interface

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

func (conn *Connection) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)

PrepareContext implements driver.ConnPrepareContext interface

type Connector

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

Connector implements database/sql/driver.Connector interface

func (*Connector) Connect

func (c *Connector) Connect(_ context.Context) (driver.Conn, error)

Connect implements driver.Connector interface

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

Driver implements driver.Connector interface

type Driver

type Driver struct{}

Driver implements database/sql/driver.Driver interface for file-based SQL

func NewDriver

func NewDriver() *Driver

NewDriver creates a new file SQL driver

func (*Driver) Open

func (d *Driver) Open(dsn string) (driver.Conn, error)

Open implements driver.Driver interface

func (*Driver) OpenConnector

func (d *Driver) OpenConnector(dsn string) (driver.Connector, error)

OpenConnector implements driver.DriverContext interface

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

Jump to

Keyboard shortcuts

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