Documentation ¶
Overview ¶
Package shell provides a minimal SQLite REPL, similar to the built-in one. This is useful for providing a REPL with custom functions.
Example ¶
This is a small program that emulates the behavior of the sqlite3 CLI. A path to a database can be passed on the command-line.
package main import ( "fmt" "os" "zombiezen.com/go/sqlite" "zombiezen.com/go/sqlite/shell" ) func main() { dbName := ":memory:" if len(os.Args) > 1 { dbName = os.Args[1] } conn, err := sqlite.OpenConn(dbName) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } shell.Run(conn) conn.Close() }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.