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

db

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 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 ArrowTable added in v0.1.5

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

func NewDBJsonTable

func NewDBJsonTable(releaseAfterMarshal bool) *ArrowTable

func (*ArrowTable) Append added in v0.1.5

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

func (*ArrowTable) Chunk added in v0.1.5

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

func (*ArrowTable) DecodeMsgpack added in v0.1.5

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

func (*ArrowTable) EncodeMsgpack added in v0.1.5

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

func (*ArrowTable) MarshalJSON added in v0.1.5

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

func (*ArrowTable) NumChunks added in v0.1.5

func (t *ArrowTable) NumChunks() int

func (*ArrowTable) NumCols added in v0.1.5

func (t *ArrowTable) NumCols() int

func (*ArrowTable) NumRows added in v0.1.5

func (t *ArrowTable) NumRows() int

func (*ArrowTable) Release added in v0.1.5

func (t *ArrowTable) Release()

func (*ArrowTable) RowData added in v0.1.5

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

func (*ArrowTable) SetAutoRelease added in v0.1.5

func (t *ArrowTable) SetAutoRelease(release bool)

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 ...any) (sql.Result, error)

func (*Connection) Query

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

func (*Connection) QueryRow

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

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) QueryArrowTable added in v0.1.5

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

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) (*ArrowTable, error)

func (*Pool) QueryJsonTableArrow

func (db *Pool) QueryJsonTableArrow(ctx context.Context, q string, wrap bool, params ...any) (*ArrowTable, 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