qat

command module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 8 Imported by: 0

README

About

qat executes SQL queries, suitable for use in shell scripts.

Supported SQL servers

  • Postgres
  • MSSQL

Installation

go get github.com/osm/qat

Data sources

Postgres

qat -source "host=localhost port=5432 user=foo password=bar dbname=baz sslmode=disable" -query "SELECT 1"

MSSQL

qat -driver mssql -source "server=localhost;port=1433;user id=foo;password=bar;database=foo" -query "SELECT 1"

Usage

# Accepts query from stdin
echo "SELECT * FROM foo" | qat -source "host=localhost port=5432 user=foo password=bar dbname=baz sslmode=disable"

# Query passed as a parameter
qat -source "host=localhost port=5432 user=foo password=bar dbname=baz sslmode=disable" -query "SELECT * FROM foo"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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