ql

command
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2015 License: BSD-3-Clause, Apache-2.0 Imports: 11 Imported by: 0

README

ql

Command ql is a utility to explore a database, prototype a schema or test drive a query, etc.

Installation

$ go get github.com/cznic/ql/ql

Documentation: godoc.org/github.com/cznic/ql/ql

Documentation

Overview

Command ql is a utility to explore a database, prototype a schema or test drive a query, etc.

Installation:

$ go get github.com/cznic/ql/ql

Usage:

ql [-db name] [-schema regexp] [-tables regexp] [-fld] statement_list

Options:

-db name	Name of the database to use. Defaults to "ql.db".
		If the DB file does not exists it is created automatically.

-schema re	If re != "" show the CREATE statements of matching tables and exit.

-tables re	If re != "" show the matching table names and exit.

-fld		First row of a query result set will show field names.

statement_list	QL statements to execute.
		If no non flag arguments are present, ql reads from stdin.
		The list is wrapped into an automatic transaction.

-t		Report and measure time to execute, including creating/opening and closing the DB.

Example:

$ ql 'create table t (i int, s string)'
$ ql << EOF
> insert into t values
> (1, "a"),
> (2, "b"),
> (3, "c"),
> EOF
$ ql 'select * from t'
3, "c"
2, "b"
1, "a"
$ ql -fld 'select * from t where i != 2 order by s'
"i", "s"
1, "a"
3, "c"
$

Jump to

Keyboard shortcuts

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