Help us shape the future of Go! Take the 2026 Go Developer Survey

db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnValue

func ColumnValue(a arrow.Array, i int) any

func RecordToJSON

func RecordToJSON(rec arrow.Record, asArray bool, w io.Writer) error

Types

type Arrow

type Arrow struct {
	*duckdb.Arrow
	// contains filtered or unexported fields
}

func (*Arrow) Close

func (a *Arrow) Close() error

type Config

type Config struct {
	Path         string
	MaxOpenConns int
	MaxIdleConns int

	Settings Settings
}

type Connection

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

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) DBConn

func (c *Connection) DBConn() *sql.Conn

func (*Connection) Exec

func (c *Connection) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*Connection) Query

func (c *Connection) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*Connection) QueryRow

func (c *Connection) QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row

type DBJsonTable

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

func NewDBJsonTable

func NewDBJsonTable(releaseAfterMarshal bool) *DBJsonTable

func (*DBJsonTable) Append

func (t *DBJsonTable) Append(rec arrow.Record)

func (*DBJsonTable) Chunk

func (t *DBJsonTable) Chunk(i int) arrow.Record

func (*DBJsonTable) DecodeMsgpack

func (t *DBJsonTable) DecodeMsgpack(dec *msgpack.Decoder) error

func (*DBJsonTable) EncodeMsgpack

func (t *DBJsonTable) EncodeMsgpack(enc *msgpack.Encoder) error

func (*DBJsonTable) MarshalJSON

func (t *DBJsonTable) MarshalJSON() ([]byte, error)

func (*DBJsonTable) NumChunks

func (t *DBJsonTable) NumChunks() int

func (*DBJsonTable) NumCols

func (t *DBJsonTable) NumCols() int

func (*DBJsonTable) NumRows

func (t *DBJsonTable) NumRows() int

func (*DBJsonTable) Release

func (t *DBJsonTable) Release()

func (*DBJsonTable) RowData

func (t *DBJsonTable) RowData(i int) (map[string]any, bool)

type JsonValue

type JsonValue string

func (*JsonValue) MarshalJSON

func (v *JsonValue) MarshalJSON() ([]byte, error)

type Pool

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

func Connect

func Connect(ctx context.Context, config Config) (*Pool, error)

func NewPool

func NewPool(path string) (*Pool, error)

func (*Pool) Arrow

func (p *Pool) Arrow(ctx context.Context) (*Arrow, error)

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Commit

func (p *Pool) Commit(ctx context.Context) error

func (*Pool) Conn

func (p *Pool) Conn(ctx context.Context) (*Connection, error)

func (*Pool) Connector

func (p *Pool) Connector() *duckdb.Connector

func (*Pool) Exec

func (p *Pool) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*Pool) IsTxContext

func (p *Pool) IsTxContext(ctx context.Context) bool

func (*Pool) QueryJsonRow

func (db *Pool) QueryJsonRow(ctx context.Context, q string, params ...any) (*JsonValue, error)

func (*Pool) QueryJsonScalarArray

func (db *Pool) QueryJsonScalarArray(ctx context.Context, q string, params ...any) (any, error)

func (*Pool) QueryJsonScalarArrayArrow

func (db *Pool) QueryJsonScalarArrayArrow(ctx context.Context, q string, params ...any) (*DBJsonTable, error)

func (*Pool) QueryJsonTable

func (db *Pool) QueryJsonTable(ctx context.Context, q string, wrap bool, params ...any) (any, error)

func (*Pool) QueryJsonTableArrow

func (db *Pool) QueryJsonTableArrow(ctx context.Context, q string, wrap bool, params ...any) (*DBJsonTable, error)

func (*Pool) QueryRowToData

func (db *Pool) QueryRowToData(ctx context.Context, data any, q string, params ...any) error

func (*Pool) QueryTableToSlice

func (db *Pool) QueryTableToSlice(ctx context.Context, data any, q string, params ...any) error

func (*Pool) Rollback

func (p *Pool) Rollback(ctx context.Context) error

func (*Pool) SetMaxIdleConns

func (p *Pool) SetMaxIdleConns(n int)

func (*Pool) SetMaxOpenConns

func (p *Pool) SetMaxOpenConns(n int)

func (*Pool) WithTx

func (p *Pool) WithTx(parent context.Context) (context.Context, error)

type Settings

type Settings struct {
	AllowedDirectories   []string
	AllowedPaths         []string
	EnableLogging        bool
	MaxMemory            int
	MaxTempDirectorySize int
	TempDirectory        string
	WorkerThreads        int
	// POSTGRESQL
	PGConnectionLimit int
	PGPagesPerTask    int
}

Jump to

Keyboard shortcuts

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