sql

package module
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const DB_CONN object.Type = "db.conn"
View Source
const SQL_ROW_ITERATOR = object.Type("sql.row_iterator")

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, args ...object.Object) object.Object

func Module

func Module() *object.Module

Types

type DB

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

func New

func New(ctx context.Context, connection string, stream bool) (*DB, error)

func NewFromDB added in v1.8.0

func NewFromDB(ctx context.Context, db *sql.DB) *DB

func (*DB) Close

func (db *DB) Close() error

func (*DB) Cost

func (db *DB) Cost() int

func (*DB) Equals

func (db *DB) Equals(other object.Object) object.Object

func (*DB) Exec

func (db *DB) Exec(ctx context.Context, args ...object.Object) object.Object

func (*DB) GetAttr

func (db *DB) GetAttr(name string) (object.Object, bool)

func (*DB) Inspect

func (db *DB) Inspect() string

func (*DB) Interface

func (db *DB) Interface() interface{}

func (*DB) IsTruthy

func (db *DB) IsTruthy() bool

func (*DB) MarshalJSON

func (db *DB) MarshalJSON() ([]byte, error)

func (*DB) Query

func (db *DB) Query(ctx context.Context, args ...object.Object) object.Object

func (*DB) RunOperation

func (db *DB) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*DB) SetAttr

func (db *DB) SetAttr(name string, value object.Object) error

func (*DB) Type

func (db *DB) Type() object.Type

type RowIterator added in v1.8.0

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

func NewRowIterator added in v1.8.0

func NewRowIterator(ctx context.Context, rows *sql.Rows) *RowIterator

func (*RowIterator) Close added in v1.8.0

func (ri *RowIterator) Close()

func (*RowIterator) Cost added in v1.8.0

func (ri *RowIterator) Cost() int

func (*RowIterator) Entry added in v1.8.0

func (ri *RowIterator) Entry() (object.IteratorEntry, bool)

Entry implements the object.Iterator interface. Returns an IteratorEntry for the current row and a bool indicating success.

func (*RowIterator) Equals added in v1.8.0

func (ri *RowIterator) Equals(other object.Object) object.Object

func (*RowIterator) GetAttr added in v1.8.0

func (ri *RowIterator) GetAttr(name string) (object.Object, bool)

func (*RowIterator) Inspect added in v1.8.0

func (ri *RowIterator) Inspect() string

func (*RowIterator) Interface added in v1.8.0

func (ri *RowIterator) Interface() interface{}

func (*RowIterator) IsTruthy added in v1.8.0

func (ri *RowIterator) IsTruthy() bool

func (*RowIterator) MarshalJSON added in v1.8.0

func (ri *RowIterator) MarshalJSON() ([]byte, error)

func (*RowIterator) Next added in v1.8.0

func (ri *RowIterator) Next(ctx context.Context) (object.Object, bool)

Next implements the object.Iterator interface. Advances the iterator and returns the current row and a bool indicating success.

func (*RowIterator) RunOperation added in v1.8.0

func (ri *RowIterator) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*RowIterator) SetAttr added in v1.8.0

func (ri *RowIterator) SetAttr(name string, value object.Object) error

func (*RowIterator) Type added in v1.8.0

func (ri *RowIterator) Type() object.Type

Jump to

Keyboard shortcuts

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