Additional commands for AdonisJS 6 Lucid ORM to help with database management and exploration.
This package provides additional Ace commands for AdonisJS applications to manage and explore databases:
db:create- Create a new databasedb:drop- Drop an existing database (with production safety)
list:databases- List all configured database connectionslist:tables- List all tables in a specific database
npm install @jrmc/adonis-lucid-commandsAfter installation, configure the package in your AdonisJS application:
node ace configure @jrmc/adonis-lucid-commandsThis will automatically register the commands in your adonisrc.ts file.
# Create database using default connection
node ace db:create
# Create database using specific connection
node ace db:create --name=mysql# Drop database using default connection
node ace db:drop
# Drop database using specific connection
node ace db:drop --name=mysqldb:drop command is disabled in production environments to prevent accidental data loss.
node ace list:databasesThis command displays all configured database connections with their client type and database name.
# List tables in default connection
node ace list:tables
# List tables in specific connection
node ace list:tables --name=mysqlThis command shows all tables in the specified database connection. It supports multiple database clients:
- PostgreSQL - Uses
information_schema.tables - MySQL - Uses
information_schema.tables - SQLite - Uses
sqlite_master - MSSQL - Uses
sys.tables
The package supports the following database clients:
- PostgreSQL (
pg,postgres,postgresql) - MySQL (
mysql,mysql2) - SQLite (
sqlite,sqlite3,better-sqlite3) - Microsoft SQL Server (
mssql)
- AdonisJS Core:
^6.12.1 - AdonisJS Lucid:
^20.6.0 || ^21.0.0
MIT License - see LICENSE file for details.
Jeremy Chaufourier - [email protected]