Registry / database / ark-sql-runner

ark-sql-runner

JSON →
library1.2.2jsnpmunverified

A CLI utility for executing SQL queries sequentially from a '.sql' file against MySQL databases. Current version 1.2.2. When a query fails, it stops execution and preserves the failed query at the top of the file, allowing resume after correction. Successful queries are removed from the file. Supports saving credentials for reuse and automatic logging. Only supports MySQL as of now, with no recent updates; the project appears to be in maintenance mode.

npm install ark-sql-runner
INSTALL
IMPORT
SIG · ARK-SQL-RUNNER
A
ark-sql-runner
databasejavascriptv1.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Installs the package globally and runs a SQL file against a MySQL database with credentials provided via CLI flags.

npm install -g ark-sql-runner ark-sql-runner -f myqueries.sql -h localhost -u root -p password -d mydb
Debug
Known issues
breakingOnly MySQL databases are supported. Attempting to use with other databases (PostgreSQL, SQLite, etc.) will fail.
fix
Use a different tool such as psql for PostgreSQL.
affects: <=1.2.2
gotchaThe '.sql' file is modified in place: successful queries are removed, and failed queries remain at the top. This can lead to data loss if the file is not backed up.
fix
Always keep a backup of your original SQL file before running this tool.
affects: <=1.2.2
gotchaCredentials passed via CLI flags are visible in process listings and command history. Saved credentials are stored in plain text.
fix
Avoid using production credentials; prefer environment variables or a secure vault.
affects: <=1.2.2
deprecatedThe project has not been updated recently and may not be actively maintained. No support for newer MySQL features or security fixes.
fix
Consider using mysql2 or a more modern SQL runner.
affects: >=0.0.0
Errors
Common errors & fixes
Error: File should be an .sql file
The file provided with the -f flag does not have a .sql extension.
fix
Ensure your file name ends with '.sql' or rename it accordingly.
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'host' (using password: YES)
Incorrect MySQL credentials (username, password, or host).
fix
Verify your MySQL credentials and the user's host permissions.
Error: ER_NO_DATABASE: Unknown database 'dbname'
The specified database does not exist on the MySQL server.
fix
Create the database first or check the database name spelling.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies
mysqlrequiredUnderlying MySQL database driver used to execute queries
yargsrequiredCLI argument parsing
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
ark-sql-runner — npm install ark-sql-runner · libregistry