2020-08-06 20:58:47 +03:00
|
|
|
# sq: swiss army knife for data
|
2016-10-17 07:14:01 +03:00
|
|
|
|
2020-08-06 20:58:47 +03:00
|
|
|
`sq` is a swiss army knife for data. `sq` provides uniform access to
|
|
|
|
structured data sources like traditional SQL-style databases,
|
2020-08-06 21:37:33 +03:00
|
|
|
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,
|
|
|
|
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,
|
|
|
|
columns, size) and has commands for frequent 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
|
2020-08-06 21:37:33 +03:00
|
|
|
$ 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
|
2020-08-06 21:37:33 +03:00
|
|
|
$ 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
|
|
|
|
|
2020-08-06 21:37:33 +03:00
|
|
|
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
|
|
|
|
2020-08-06 21:37:33 +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.
|
2020-08-06 21:37:33 +03:00
|
|
|
|
2016-10-21 19:14:48 +03:00
|
|
|
|