@hesed/mysql
v0.6.0
Published
CLI for MySQL database interaction
Readme
mysql
CLI for MySQL database interaction
Install
sdkck plugins install @hesed/mysqlUsage
$ npm install -g @hesed/mysql
$ mq COMMAND
running command...
$ mq (--version)
@hesed/mysql/0.6.0 linux-x64 node-v24.18.0
$ mq --help [COMMAND]
USAGE
$ mq COMMAND
...Commands
mq mysql auth addmq mysql auth deletemq mysql auth listmq mysql auth profilemq mysql auth testmq mysql auth updatemq mysql databasesmq mysql describe-table TABLEmq mysql explain QUERYmq mysql indexes TABLEmq mysql query QUERYmq mysql tables
mq mysql auth add
Add MySQL authentication
USAGE
$ mq mysql auth add -p <value> --host <value> --port <value> -u <value> --password <value> -d <value> --ssl
--maxConcurrentQueries <value> --queryQueueTimeoutMs <value> [--json]
FLAGS
-d, --database=<value> (required) Database name
-p, --profile=<value> (required) Profile name
-u, --user=<value> (required) Username
--host=<value> (required) MySQL host
--maxConcurrentQueries=<value> (required) Max concurrent queries for this profile
--password=<value> (required) Password
--port=<value> (required) MySQL port
--queryQueueTimeoutMs=<value> (required) Milliseconds a query may wait for a free query slot before failing
--ssl (required) Use SSL
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Add MySQL authentication
EXAMPLES
$ mq mysql auth add
$ mq mysql auth add -p prodSee code: src/commands/mysql/auth/add.ts
mq mysql auth delete
Delete an authentication profile
USAGE
$ mq mysql auth delete [--json] [-p <value>]
FLAGS
-p, --profile=<value> Profile to delete
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Delete an authentication profile
EXAMPLES
$ mq mysql auth delete
$ mq mysql auth delete -p prodSee code: src/commands/mysql/auth/delete.ts
mq mysql auth list
List authentication profiles
USAGE
$ mq mysql auth list [--json]
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List authentication profiles
EXAMPLES
$ mq mysql auth listSee code: src/commands/mysql/auth/list.ts
mq mysql auth profile
Set or show the default authentication profile
USAGE
$ mq mysql auth profile [--json] [--default <value>]
FLAGS
--default=<value> Profile to set as default
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Set or show the default authentication profile
EXAMPLES
$ mq mysql auth profile
$ mq mysql auth profile --default testSee code: src/commands/mysql/auth/profile.ts
mq mysql auth test
Test authentication and connection
USAGE
$ mq mysql auth test [--json] [-p <value>]
FLAGS
-p, --profile=<value> Authentication profile name
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Test authentication and connection
EXAMPLES
$ mq mysql auth test
$ mq mysql auth test -p prodSee code: src/commands/mysql/auth/test.ts
mq mysql auth update
Update MySQL authentication
USAGE
$ mq mysql auth update -p <value> --host <value> --port <value> -u <value> --password <value> -d <value> --ssl
--maxConcurrentQueries <value> --queryQueueTimeoutMs <value> [--json]
FLAGS
-d, --database=<value> (required) Database name
-p, --profile=<value> (required) Profile name
-u, --user=<value> (required) Username
--host=<value> (required) MySQL host
--maxConcurrentQueries=<value> (required) Max concurrent queries for this profile
--password=<value> (required) Password
--port=<value> (required) MySQL port
--queryQueueTimeoutMs=<value> (required) Milliseconds a query may wait for a free query slot before failing
--ssl (required) Use SSL
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Update MySQL authentication
EXAMPLES
$ mq mysql auth update
$ mq mysql auth update -p testSee code: src/commands/mysql/auth/update.ts
mq mysql databases
List all databases accessible on the MySQL server
USAGE
$ mq mysql databases [--json] [-p <value>]
FLAGS
-p, --profile=<value> Database profile name from config
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List all databases accessible on the MySQL server
EXAMPLES
$ mq mysql databases
$ mq mysql databases -p stagingSee code: src/commands/mysql/databases.ts
mq mysql describe-table TABLE
Describe the structure of a MySQL table
USAGE
$ mq mysql describe-table TABLE [--json] [-p <value>] [--toon]
ARGUMENTS
TABLE Table name to describe
FLAGS
-p, --profile=<value> Database profile name from config
--toon Format output as toon
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Describe the structure of a MySQL table
EXAMPLES
$ mq mysql describe-table users
$ mq mysql describe-table orders --toon -p prodSee code: src/commands/mysql/describe-table.ts
mq mysql explain QUERY
Show the execution plan for a MySQL query
USAGE
$ mq mysql explain QUERY [--json] [-p <value>] [--toon]
ARGUMENTS
QUERY SQL query to explain
FLAGS
-p, --profile=<value> Database profile name from config
--toon Format output as toon
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Show the execution plan for a MySQL query
EXAMPLES
$ mq mysql explain "SELECT * FROM users WHERE id = 1"
$ mq mysql explain "SELECT * FROM orders JOIN users ON orders.user_id = users.id" --jsonSee code: src/commands/mysql/explain.ts
mq mysql indexes TABLE
Show indexes for a MySQL table
USAGE
$ mq mysql indexes TABLE [--json] [-p <value>] [--toon]
ARGUMENTS
TABLE Table name to show indexes for
FLAGS
-p, --profile=<value> Database profile name from config
--toon Format output as toon
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Show indexes for a MySQL table
EXAMPLES
$ mq mysql indexes users
$ mq mysql indexes orders --json -p prodSee code: src/commands/mysql/indexes.ts
mq mysql query QUERY
Execute a SQL query against a MySQL database
USAGE
$ mq mysql query QUERY [--json] [-p <value>] [--skip-confirmation] [--toon]
ARGUMENTS
QUERY SQL query to execute
FLAGS
-p, --profile=<value> Database profile name from config
--skip-confirmation Skip confirmation prompt for destructive operations
--toon Format output as toon
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Execute a SQL query against a MySQL database
EXAMPLES
$ mq mysql query "SELECT * FROM users LIMIT 10" --json
$ mq mysql query "UPDATE users SET email = '[email protected]' WHERE id = 999"
$ mq mysql query "DELETE FROM sessions" -p prod --skip-confirmationSee code: src/commands/mysql/query.ts
mq mysql tables
List all tables in the current MySQL database
USAGE
$ mq mysql tables [--json] [-p <value>]
FLAGS
-p, --profile=<value> Database profile name from config
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List all tables in the current MySQL database
EXAMPLES
$ mq mysql tables
$ mq mysql tables -p localSee code: src/commands/mysql/tables.ts
