query

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteRun

func ExecuteRun(ctx context.Context, drv driver.Connection, sql string, limitFlag int, write bool, expand string, full bool, compact bool, formatFlag string) error

ExecuteRun runs a SQL query on an already-resolved connection and writes results. Uses streaming (QueryStream) when the driver supports it, falling back to buffered Query.

User SQL is sent verbatim — we never modify it to inject LIMIT/TOP. Pagination is enforced client-side: we read up to `effectiveLimit+1` rows from the iterator and close the cursor early if we hit the cap. The "+1" is the probe for hasMore=true. Trade-off: the database planner doesn't know we'll stop, so huge ORDER BY queries lose LIMIT-aware optimization. Users who care put LIMIT/TOP in their own SQL — the hint on the @pagination payload nudges them in that direction.

func Register

func Register(root *cobra.Command, globals func() *shared.GlobalFlags)

Register adds the query command group to root.

Types

This section is empty.

Jump to

Keyboard shortcuts

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