scias

package module
v0.0.0-...-95e2338 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

README

scias

db, err := sql.Open("sqlite", dsn)
if err != nil {
    return err
}

c := scias.NewClient(db, "json")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(db *sql.DB, scanTag string) *Client

func (*Client) Begin

func (c *Client) Begin() (*Transaction, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Exec

func (c *Client) Exec(chk, stmt string, args map[string]any) error

func (*Client) Query

func (c *Client) Query(stmt string, args map[string]any) *Row

func (*Client) QueryAny

func (c *Client) QueryAny(dst any, stmt string, args map[string]any) error

func (*Client) Transaction

func (c *Client) Transaction(fn func(*Transaction) error) error

func (*Client) WithLog

func (c *Client) WithLog(fn func(kvs ...any) error) *Client

type Row

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

func (*Row) Close

func (r *Row) Close() error

func (*Row) Err

func (r *Row) Err() error

func (*Row) Next

func (r *Row) Next() bool

func (*Row) Scan

func (r *Row) Scan(dst any) error

type Transaction

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

func (*Transaction) Commit

func (t *Transaction) Commit() error

func (*Transaction) Exec

func (t *Transaction) Exec(chk string, stmt string, args map[string]any) error

func (*Transaction) Query

func (t *Transaction) Query(stmt string, args map[string]any) *Row

func (*Transaction) QueryAny

func (t *Transaction) QueryAny(dst any, stmt string, args map[string]any) error

func (*Transaction) Rollback

func (t *Transaction) Rollback() error

Jump to

Keyboard shortcuts

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