sql

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDatasources

func ListDatasources() ([]string, error)

ListDatasources returns all configured datasource names

Types

type Client

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

Client wraps a SQL database connection

func NewClient

func NewClient(datasourceName string) (*Client, error)

NewClient creates a new SQL client for the specified datasource (read-only by default)

func NewClientWithOptions

func NewClientWithOptions(datasourceName string, readOnly bool) (*Client, error)

NewClientWithOptions creates a new SQL client with configurable read-only mode

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string) (*QueryResult, error)

Query executes a query and returns the results

type QueryResult

type QueryResult struct {
	Columns []string
	Rows    [][]any
}

QueryResult holds the results of a query

Jump to

Keyboard shortcuts

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