Skip to content

Commit

Permalink
📝 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelvalley committed Dec 9, 2023
1 parent 2e1c26b commit 8b97fc6
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 83 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ A little CLI for working with databases during development for quick queries and
- [ ] Run a parameterized query using a CSV for multiple inputs?

<!-- commands -->

# Command Topics

- [`sqlq connection`](docs/connection.md) - Create a connection to a database
- [`sqlq help`](docs/help.md) - Display help for sqlq.
- [`sqlq history`](docs/history.md) - Delete a history entry
- [`sqlq query`](docs/query.md) - Query data from a database by file
- [`sqlq tool`](docs/tool.md) - Create a tool
* [`sqlq connection`](docs/connection.md) - Create a connection to a database
* [`sqlq help`](docs/help.md) - Display help for sqlq.
* [`sqlq history`](docs/history.md) - Delete a history entry
* [`sqlq query`](docs/query.md) - Query data from a database by file
* [`sqlq tool`](docs/tool.md) - Create a tool
* [`sqlq yeet`](docs/yeet.md) - Run a query via connection string. Not saved in history.

<!-- commandsstop -->
26 changes: 16 additions & 10 deletions docs/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Create a connection to a database

```
USAGE
$ sqlq connection create ALIAS DRIVER CONNECTIONSTRING [DESCRIPTION] [--format js|table|json|csv]
$ sqlq connection create ALIAS DRIVER CONNECTIONSTRING [DESCRIPTION] [--format js|table|json|yml|yaml|csv|ssv]
[--outfile <value>]
ARGUMENTS
ALIAS Alias for connection
Expand All @@ -25,7 +26,8 @@ ARGUMENTS
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Create a connection to a database
Expand All @@ -42,14 +44,15 @@ Delete a connection

```
USAGE
$ sqlq connection delete ALIAS [--format js|table|json|csv]
$ sqlq connection delete ALIAS [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
ALIAS Alias of connection to delete
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Delete a connection
Expand All @@ -66,14 +69,15 @@ Get connection

```
USAGE
$ sqlq connection get ALIAS [--format js|table|json|csv]
$ sqlq connection get ALIAS [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
ALIAS Alias for connection
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Get connection
Expand All @@ -90,14 +94,15 @@ List all saved connections

```
USAGE
$ sqlq connection list [SEARCH] [--format js|table|json|csv]
$ sqlq connection list [SEARCH] [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
SEARCH Search for a connection by alias, description, or conection string
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
List all saved connections
Expand All @@ -115,14 +120,15 @@ List all saved connections

```
USAGE
$ sqlq connection ls [SEARCH] [--format js|table|json|csv]
$ sqlq connection ls [SEARCH] [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
SEARCH Search for a connection by alias, description, or conection string
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
List all saved connections
Expand Down
43 changes: 14 additions & 29 deletions docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ Delete a history entry
* [`sqlq history get ID`](#sqlq-history-get-id)
* [`sqlq history list [SEARCH]`](#sqlq-history-list-search)
* [`sqlq history ls [SEARCH]`](#sqlq-history-ls-search)
* [`sqlq history query ID`](#sqlq-history-query-id)

## `sqlq history delete ID`

Delete a history entry

```
USAGE
$ sqlq history delete ID [--format js|table|json|csv]
$ sqlq history delete ID [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
ID ID of history entry to delete
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Delete a history entry
Expand All @@ -36,14 +36,15 @@ Get a history entry

```
USAGE
$ sqlq history get ID [--format js|table|json|csv]
$ sqlq history get ID [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
ID ID of history entry
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Get a history entry
Expand All @@ -57,7 +58,8 @@ Search query history

```
USAGE
$ sqlq history list [SEARCH] [--format js|table|json|csv] [--alias <value>] [--aliasExact] [--count <value>]
$ sqlq history list [SEARCH] [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>] [--alias <value>]
[--aliasExact] [--count <value>]
ARGUMENTS
SEARCH Part of a query to search for
Expand All @@ -67,7 +69,8 @@ FLAGS
--aliasExact If alias should match exactly
--count=<value> [default: 20] Maximum number of results to return
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Search query history
Expand All @@ -84,7 +87,8 @@ Search query history

```
USAGE
$ sqlq history ls [SEARCH] [--format js|table|json|csv] [--alias <value>] [--aliasExact] [--count <value>]
$ sqlq history ls [SEARCH] [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>] [--alias <value>]
[--aliasExact] [--count <value>]
ARGUMENTS
SEARCH Part of a query to search for
Expand All @@ -94,31 +98,12 @@ FLAGS
--aliasExact If alias should match exactly
--count=<value> [default: 20] Maximum number of results to return
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Search query history
ALIASES
$ sqlq history ls
```

## `sqlq history query ID`

Re-run a previous database query

```
USAGE
$ sqlq history query ID [--format js|table|json|csv] [--withAlias <value>]
ARGUMENTS
ID ID of history entry to execute
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
--withAlias=<value> Override the initial alias used to run the command
DESCRIPTION
Re-run a previous database query
```
59 changes: 55 additions & 4 deletions docs/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,99 @@
Query data from a database by file

* [`sqlq query file ALIAS FILE`](#sqlq-query-file-alias-file)
* [`sqlq query history ID`](#sqlq-query-history-id)
* [`sqlq query sql ALIAS QUERY`](#sqlq-query-sql-alias-query)
* [`sqlq query tool ALIAS NAME`](#sqlq-query-tool-alias-name)

## `sqlq query file ALIAS FILE`

Query data from a database by file

```
USAGE
$ sqlq query file ALIAS FILE [--format js|table|json|csv]
$ sqlq query file ALIAS FILE [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
ALIAS Alias for connection
FILE Path to file containing SQL query
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Query data from a database by file
```

_See code: [dist/commands/query/file.ts](https://github.com/nabeelvalley/sqlq/blob/v0.0.0/dist/commands/query/file.ts)_

## `sqlq query history ID`

Re-run a previous database query

```
USAGE
$ sqlq query history ID [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>] [--withAlias <value>]
ARGUMENTS
ID ID of history entry to execute
FLAGS
--format=<option> [default: table]
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
--withAlias=<value> Override the initial alias used to run the command
DESCRIPTION
Re-run a previous database query
```

_See code: [dist/commands/query/history.ts](https://github.com/nabeelvalley/sqlq/blob/v0.0.0/dist/commands/query/history.ts)_

## `sqlq query sql ALIAS QUERY`

Query data from a database

```
USAGE
$ sqlq query sql ALIAS QUERY [--format js|table|json|csv]
$ sqlq query sql ALIAS QUERY [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>]
ARGUMENTS
ALIAS Alias for connection
QUERY Query to run on database
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
DESCRIPTION
Query data from a database
```

_See code: [dist/commands/query/sql.ts](https://github.com/nabeelvalley/sqlq/blob/v0.0.0/dist/commands/query/sql.ts)_

## `sqlq query tool ALIAS NAME`

Use a tool with a connection

```
USAGE
$ sqlq query tool ALIAS NAME [--format js|table|json|yml|yaml|csv|ssv] [--outfile <value>] [--params <value>]
ARGUMENTS
ALIAS Connection alias to invoke the tool against
NAME Name of tool to execute
FLAGS
--format=<option> [default: table]
<options: js|table|json|yml|yaml|csv|ssv>
--outfile=<value> Print output to file
--params=<value>... Parameter to use in subcommand
DESCRIPTION
Use a tool with a connection
```

_See code: [dist/commands/query/tool.ts](https://github.com/nabeelvalley/sqlq/blob/v0.0.0/dist/commands/query/tool.ts)_
Loading

0 comments on commit 8b97fc6

Please sign in to comment.