sq/README.md

51 lines
1.6 KiB
Markdown
Raw Normal View History

2020-08-06 20:58:47 +03:00
# sq: swiss army knife for data
2016-10-17 07:14:01 +03:00
2020-10-20 18:18:56 +03:00
`sq` is a command line tool that jq-style access to
structured data sources such as SQL databases,
or document formats such as CSV or Excel. `sq` can perform cross-source joins,
execute database-native SQL, and output to a multitude of formats including JSON,
2020-08-19 23:46:04 +03:00
Excel, CSV, HTML, Markdown and XML, or output directly to a SQL database.
`sq` can inspect sources to see metadata about the source structure (tables,
2020-08-19 23:46:04 +03:00
columns, size) and has commands for common database operations such as copying
or dropping tables.
## Usage
See the [wiki](https://github.com/neilotoole/sq/wiki).
2016-10-17 07:14:01 +03:00
2020-08-06 20:58:47 +03:00
## Installation
2016-10-17 07:14:01 +03:00
2020-08-06 20:58:47 +03:00
### From source
2016-10-17 07:14:01 +03:00
2020-08-06 20:58:47 +03:00
From the `sq` project dir:
2016-10-17 07:14:01 +03:00
2020-08-06 20:58:47 +03:00
```shell script
$ go install
2020-08-06 20:58:47 +03:00
```
2016-10-17 07:14:01 +03:00
2020-08-06 20:58:47 +03:00
The simple go install does not populate the binary with build info that
is output via the `sq version` command. To do so, use [mage](https://magefile.org/).
2016-10-17 07:14:01 +03:00
2020-08-06 20:58:47 +03:00
```shell script
$ brew install mage
$ mage install
2016-10-17 07:14:01 +03:00
```
2016-10-21 19:14:48 +03:00
2020-08-06 20:58:47 +03:00
### Other installation options
For homebrew, scoop, rpm etc, see the [wiki](https://github.com/neilotoole/sq/wiki).
2016-10-21 19:14:48 +03:00
2020-08-06 20:58:47 +03:00
## Acknowledgements
2016-10-21 19:14:48 +03:00
- Much inspiration is owed to [jq](https://stedolan.github.io/jq/).
- See [`go.mod`](https://github.com/neilotoole/sq/blob/master/go.mod) for a list of third-party packages.
- Additionally, `sq` incorporates modified versions of:
- [`olekukonko/tablewriter`](https://github.com/olekukonko/tablewriter)
- [`segmentio/encoding`](https://github.com/segmentio/encoding) for JSON encoding.
2020-08-06 20:58:47 +03:00
- The [_Sakila_](https://dev.mysql.com/doc/sakila/en/) example databases were lifted from [jOOQ](https://github.com/jooq/jooq), which
in turn owe their heritage to earlier work on Sakila.
2016-10-21 19:14:48 +03:00