Skip to content

Commit

Permalink
✨ update task lists and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelvalley committed Dec 9, 2023
1 parent d8163cf commit 30c3bfa
Show file tree
Hide file tree
Showing 8 changed files with 541 additions and 5 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@

A simple CLI for working with databases during development for quick queries and automation

# Table of contents

<!-- toc -->

- [SQLQ](#sqlq)
- [Table of contents](#table-of-contents)
- [Command Topics](#command-topics)
- [Goals](#goals)
<!-- tocstop -->

<!-- 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

<!-- commandsstop -->

# Goals

- [x] Manage list of connections
- [ ] Manage list of common queries with an alias
- [ ] Manage/migrate own internal DB in the real app using diesel (auto migration support lacking)
- [x] Manage list of common queries with an alias
- [x] Manage/migrate own internal DB in the real app (TBC, should work)
- [ ] Support different output formats, e.g. CSV/JSON/Table View
- [ ] Figure out how to distribute the thing
- [ ] Support terminal based UI for doing all of the application features
- [ ] On the fly creation of databases - SQLite, maybe others

<!-- below content auto generated by oclif, do not edit -->
133 changes: 133 additions & 0 deletions docs/connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
`sqlq connection`
=================

Create a connection to a database

* [`sqlq connection create ALIAS DRIVER CONNECTIONSTRING [DESCRIPTION]`](#sqlq-connection-create-alias-driver-connectionstring-description)
* [`sqlq connection delete ALIAS`](#sqlq-connection-delete-alias)
* [`sqlq connection get ALIAS`](#sqlq-connection-get-alias)
* [`sqlq connection list [SEARCH]`](#sqlq-connection-list-search)
* [`sqlq connection ls [SEARCH]`](#sqlq-connection-ls-search)

## `sqlq connection create ALIAS DRIVER CONNECTIONSTRING [DESCRIPTION]`

Create a connection to a database

```
USAGE
$ sqlq connection create ALIAS DRIVER CONNECTIONSTRING [DESCRIPTION] [--format js|table|json|csv]
ARGUMENTS
ALIAS Alias for connection
DRIVER (mssql|sqlite|pg) The type of driver to use when working to the database
CONNECTIONSTRING Connection string for database
DESCRIPTION Description of connection
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
Create a connection to a database
ALIASES
$ sqlq conn create
```

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

## `sqlq connection delete ALIAS`

Delete a connection

```
USAGE
$ sqlq connection delete ALIAS [--format js|table|json|csv]
ARGUMENTS
ALIAS Alias of connection to delete
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
Delete a connection
ALIASES
$ sqlq conn delete
```

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

## `sqlq connection get ALIAS`

Get connection

```
USAGE
$ sqlq connection get ALIAS [--format js|table|json|csv]
ARGUMENTS
ALIAS Alias for connection
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
Get connection
ALIASES
$ sqlq conn get
```

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

## `sqlq connection list [SEARCH]`

List all saved connections

```
USAGE
$ sqlq connection list [SEARCH] [--format js|table|json|csv]
ARGUMENTS
SEARCH Search for a connection by alias, description, or conection string
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
List all saved connections
ALIASES
$ sqlq connection ls
$ sqlq conn ls
```

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

## `sqlq connection ls [SEARCH]`

List all saved connections

```
USAGE
$ sqlq connection ls [SEARCH] [--format js|table|json|csv]
ARGUMENTS
SEARCH Search for a connection by alias, description, or conection string
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
List all saved connections
ALIASES
$ sqlq connection ls
$ sqlq conn ls
```
26 changes: 26 additions & 0 deletions docs/help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
`sqlq help`
===========

Display help for sqlq.

* [`sqlq help [COMMANDS]`](#sqlq-help-commands)

## `sqlq help [COMMANDS]`

Display help for sqlq.

```
USAGE
$ sqlq help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for sqlq.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/lib/commands/help.ts)_
126 changes: 126 additions & 0 deletions docs/history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
`sqlq history`
==============

Delete a history entry

* [`sqlq history delete ID`](#sqlq-history-delete-id)
* [`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]
ARGUMENTS
ID ID of history entry to delete
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
Delete a history entry
```

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

## `sqlq history get ID`

Get a history entry

```
USAGE
$ sqlq history get ID [--format js|table|json|csv]
ARGUMENTS
ID ID of history entry
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
DESCRIPTION
Get a history entry
```

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

## `sqlq history list [SEARCH]`

Search query history

```
USAGE
$ sqlq history list [SEARCH] [--format js|table|json|csv] [--alias <value>] [--aliasExact] [--count <value>]
ARGUMENTS
SEARCH Part of a query to search for
FLAGS
--alias=<value> Alias for connection
--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>
DESCRIPTION
Search query history
ALIASES
$ sqlq history ls
```

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

## `sqlq history ls [SEARCH]`

Search query history

```
USAGE
$ sqlq history ls [SEARCH] [--format js|table|json|csv] [--alias <value>] [--aliasExact] [--count <value>]
ARGUMENTS
SEARCH Part of a query to search for
FLAGS
--alias=<value> Alias for connection
--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>
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
```

_See code: [dist/commands/history/query.ts](https://github.com/nabeelvalley/sqlq/blob/v0.0.0/dist/commands/history/query.ts)_
51 changes: 51 additions & 0 deletions docs/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
`sqlq query`
============

Query data from a database by file

* [`sqlq query file ALIAS FILE`](#sqlq-query-file-alias-file)
* [`sqlq query sql ALIAS QUERY`](#sqlq-query-sql-alias-query)

## `sqlq query file ALIAS FILE`

Query data from a database by file

```
USAGE
$ sqlq query file ALIAS FILE [--format js|table|json|csv]
ARGUMENTS
ALIAS Alias for connection
FILE Path to file containing SQL query
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
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 sql ALIAS QUERY`

Query data from a database

```
USAGE
$ sqlq query sql ALIAS QUERY [--format js|table|json|csv]
ARGUMENTS
ALIAS Alias for connection
QUERY Query to run on database
FLAGS
--format=<option> [default: table]
<options: js|table|json|csv>
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)_
Loading

0 comments on commit 30c3bfa

Please sign in to comment.