From b44fd93647980e0efb8e26864653a94fcade9de5 Mon Sep 17 00:00:00 2001 From: Nabeel Valley <36758308+nabeelvalley@users.noreply.github.com> Date: Sat, 9 Dec 2023 20:00:57 +0100 Subject: [PATCH] :memo: add overview to readme --- .gitignore | 4 ++-- README.md | 44 ++++++++++++++++++++++++++++++++++++++------ prisma/schema.prisma | 2 +- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 75572ed..6485b45 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,6 @@ node_modules node_modules oclif.lock oclif.manifest.json -/prisma/app.db -/prisma/app.db-journal +/prisma/sqlq.db +/prisma/sqlq.db-journal /sample.db \ No newline at end of file diff --git a/README.md b/README.md index 12420a6..abab4f3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,37 @@ A little CLI for working with databases during development for quick queries and automation +# Usage + +Install the CLI from NPM using your fave package manager. If you don't have a fave, just use `npm`: + +```sh +npm install --global sqlq +``` + +Then, you should be able to view the application help using: + +```sh +sqlq help +``` + +The flow for using the application is as follows: + +1. Create a connection to a database using `sqlq connection create` and follow the instructions. This stores the database config so you can connect and use it +2. Once you have a connection, you can run queries against it using the `sqlq query sql` or `sqlq query file` subcommands +3. You can also store queries to run by name using the `sqlq tool` subcommand set +4. The application stores previous queries which can be accessed using `sqlq history`. You can repeat these queries using their ID with `sqlq query history` + +# Supported Databases + +Currently the application should work fine with: + +1. SQLite +2. PostgreSQL +3. Microsoft SQL Server + +> Contributions welcome for additional database support + # Goals - [x] Manage list of connections @@ -15,13 +46,14 @@ A little CLI for working with databases during development for quick queries and - [ ] Run a parameterized query using a CSV for multiple inputs? + # 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 yeet`](docs/yeet.md) - Run a query via connection string. Not saved in history. +- [`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. diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 5aacc55..7e4f7d2 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -7,7 +7,7 @@ generator client { datasource db { provider = "sqlite" - url = "file:./app.db" + url = "file:./sqlq.db" } model Connection {