term

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

The package term contains common code for interactive database clients.

Index

Constants

This section is empty.

Variables

View Source
var (

	// PromptDatabaseName contains the used database name when using
	// the prompt.
	PromptDatabaseName string
)

Functions

func Entrypoint

func Entrypoint(db *sql.DB, args []string) error

Entrypoint controls the execution of the program by starting the interactive command-line or executing the passed query or input-file.

func ParseAndExecQueries

func ParseAndExecQueries(db *sql.DB, line string) error

ParseAndExecQueries parses the passed line into queries that are later executed.

func Repl

func Repl(db *sql.DB) error

Repl is the interactive interface that reads, evaluates, and prints the passed queries.

func UpdatePrompt

func UpdatePrompt()

UpdatePrompt updates the displayed prompt in interactive use.

Types

type GenericExecer

type GenericExecer interface {
	// GenericExec is the central method through which SQL statements
	// are sent to ASE.
	GenericExec(context.Context, string, []driver.NamedValue) (driver.Rows, driver.Result, error)
}

GenericExecer is the interface providing the GenericExec method.

Jump to

Keyboard shortcuts

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