Registry / devops / clawsql

clawsql

JSON →
library0.2.10jsnpmunverified

ClawSQL is a MySQL high-availability management platform for automating cluster provisioning, failover, read/write splitting, and topology management. Version 0.2.10 (beta) uses Docker/Podman containers, integrates ProxySQL for traffic routing and Orchestrator for topology management, and offers predefined templates for development, production, and geo-distributed setups. It requires Node.js >=22.22. Shipping TypeScript types, it provides an interactive CLI with commands for provisioning, monitoring, and lifecycle management. Key differentiators: template-based one-command provisioning, built-in monitoring with Prometheus/Grafana, and automatic GTID replication setup.

npm install clawsql
INSTALL
IMPORT
SIG · CLAWSQL
C
clawsql
devopsjavascriptv0.2.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

clawsql
import clawsql from 'clawsql'
ESM-only, Node >=22.22 required.
default
import clawsql from 'clawsql'
const clawsql = require('clawsql')
CommonJS require is not supported; ESM-only.
ClawSqlConfig
import type { ClawSqlConfig } from 'clawsql'
TypeScript types included.
ClawSqlClient
import { ClawSqlClient } from 'clawsql'
Named export for programmatic usage.
createCluster
import { createCluster } from 'clawsql'
Function for provisioning a cluster via API.

Installs ClawSQL globally, pulls Docker images, starts the platform, creates admin user on MySQL, provisions a 3-node production cluster, and connects via ProxySQL.

npm install -g clawsql clawsql install clawsql > /start # On each MySQL instance: CREATE USER 'clawsql'@'%' IDENTIFIED WITH mysql_native_password BY 'clawsql_password'; GRANT ALL PRIVILEGES ON *.* TO 'clawsql'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; # In CLI: > /clusters quick standard mycluster mysql1:3306,mysql2:3306,mysql3:3306 # Connect via ProxySQL (port 6033): mysql -h 127.0.0.1 -P 6033 -u clawsql -pclawsql_password
Debug
Known issues
breakingNode.js >=22.22.0 required
fix
Upgrade Node.js to 22.22+
affects: <0.2.0
breakingESM-only; no CommonJS support
fix
Use import instead of require()
affects: >=0.2.0
gotchaAdmin user must exist on MySQL instances with correct password
fix
Execute GRANT statements as shown in quickstart
affects: >=0.1.0
gotchaDocker Compose v2 or Podman required
fix
Install docker-compose (or podman-compose) and add user to docker group
affects: >=0.1.0
deprecated/clusters manual commands deprecated in favor of /clusters provision
fix
Use /clusters provision or /clusters quick instead
affects: >=0.2.0
gotchaProxySQL port allocation starts at 6033 and increments per cluster
fix
Check /clusters list for actual ports
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'clawsql'
Package not installed globally or locally
fix
Run 'npm install -g clawsql' or 'npm install clawsql' in project directory
clawsql: command not found
Global install not in PATH or npm prefix misconfigured
fix
Run 'npm install -g clawsql' and ensure npm global bin is in PATH (e.g., export PATH=$(npm bin -g):$PATH)
Error: ESM only - use import instead of require
Using CommonJS require() with ESM-only package
fix
Change 'const clawsql = require("clawsql")' to 'import clawsql from "clawsql"'
Docker is not running or docker-compose not found
Docker daemon not started or docker-compose not installed
fix
Start Docker (e.g., 'sudo systemctl start docker') and install docker-compose (e.g., 'sudo apt install docker-compose')
ERROR: Access denied for user 'clawsql'@'...' (using password: YES)
MySQL admin user not created or password mismatch
fix
Run the GRANT statements on each MySQL instance with correct password
Upgrade
Version history
0.2.10latest on npm
Audit
Dependencies
dockerrequiredContainer runtime required for platform services (ProxySQL, Orchestrator, etc.)
docker-composerequiredContainer orchestration for multi-service platform
mysqlrequiredMySQL instances are managed; admin user must exist on target instances
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
clawsql — npm install clawsql · libregistry