mwalajs 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mwala.mjs +28 -14
- package/package.json +2 -2
- package/users.csv +5 -1
package/bin/mwala.mjs
CHANGED
|
@@ -96,6 +96,7 @@ const {
|
|
|
96
96
|
const args = process.argv.slice(2);
|
|
97
97
|
const command = args[0]?.toLowerCase();
|
|
98
98
|
|
|
99
|
+
|
|
99
100
|
if (!command || command === 'help' || command === 'h') {
|
|
100
101
|
console.log(`
|
|
101
102
|
${colors.bright}╔════════════════════════════════════════════════════╗${colors.reset}
|
|
@@ -103,15 +104,15 @@ ${colors.bright}║ MwalaJS CLI v${pkg.version} ║${colo
|
|
|
103
104
|
${colors.bright}╚════════════════════════════════════════════════════╝${colors.reset}
|
|
104
105
|
|
|
105
106
|
${colors.cyan}General Commands:${colors.reset}
|
|
106
|
-
mwala -v
|
|
107
|
-
mwala help | h
|
|
107
|
+
mwala -v | --version → Show version
|
|
108
|
+
mwala help | h → Show this help
|
|
108
109
|
|
|
109
110
|
${colors.cyan}Project Management:${colors.reset}
|
|
110
|
-
mwala create-project
|
|
111
|
-
mwala init
|
|
111
|
+
mwala create-project → Create new project
|
|
112
|
+
mwala init → Initialize MwalaJS in current directory
|
|
112
113
|
|
|
113
114
|
${colors.cyan}Run Application:${colors.reset}
|
|
114
|
-
mwala serve | app.mjs
|
|
115
|
+
mwala serve | app.mjs → Start server (runs app.mjs)
|
|
115
116
|
|
|
116
117
|
${colors.cyan}Code Generation:${colors.reset}
|
|
117
118
|
mwala generate model <name>
|
|
@@ -125,8 +126,8 @@ ${colors.cyan} DATABASE COMMANDS ${colors.res
|
|
|
125
126
|
${colors.cyan}══════════════════════════════════════════════════════${colors.reset}
|
|
126
127
|
|
|
127
128
|
${colors.blue}Setup & Config:${colors.reset}
|
|
128
|
-
mwala create-db
|
|
129
|
-
mwala db:config
|
|
129
|
+
mwala create-db → Create / connect database (interactive)
|
|
130
|
+
mwala db:config → Reconfigure database settings
|
|
130
131
|
|
|
131
132
|
${colors.blue}Table Management:${colors.reset}
|
|
132
133
|
mwala db:table list
|
|
@@ -142,27 +143,40 @@ ${colors.blue}Table Management:${colors.reset}
|
|
|
142
143
|
${colors.blue}Migrations:${colors.reset}
|
|
143
144
|
mwala migrate all
|
|
144
145
|
mwala rollback last
|
|
145
|
-
mwala rollback all
|
|
146
|
+
mwala rollback all → ⚠️ drops all tables (dangerous)
|
|
147
|
+
|
|
148
|
+
${colors.blue}Data Import / Export:${colors.reset}
|
|
149
|
+
mwala db:import <file.csv|json|sql> <table>
|
|
150
|
+
mwala db:export <table> <file.csv|json|sql>
|
|
151
|
+
|
|
152
|
+
Examples:
|
|
153
|
+
mwala db:import users.csv users
|
|
154
|
+
mwala db:import users.json users
|
|
155
|
+
mwala db:import backup.sql users
|
|
146
156
|
|
|
147
|
-
${colors.blue}
|
|
157
|
+
${colors.blue}Backup & Restore:${colors.reset}
|
|
148
158
|
mwala db:seed <file.js>
|
|
149
159
|
mwala db:backup
|
|
150
160
|
mwala db:restore <file.sql>
|
|
151
|
-
mwala db:export <table> <file.csv>
|
|
152
|
-
mwala db:import <file.csv> <table>
|
|
153
161
|
|
|
154
162
|
${colors.blue}Maintenance & Stats:${colors.reset}
|
|
155
163
|
mwala db:size
|
|
156
164
|
mwala db:indexes <table>
|
|
157
|
-
mwala db:analyze <table>
|
|
165
|
+
mwala db:analyze <table> → PostgreSQL only
|
|
158
166
|
mwala db:reindex <table>
|
|
159
167
|
mwala db:vacuum
|
|
160
168
|
mwala db:connections
|
|
161
|
-
mwala db:kill-connections
|
|
162
|
-
mwala db:drop-all-tables
|
|
169
|
+
mwala db:kill-connections → ⚠️ Dangerous – admin only
|
|
170
|
+
mwala db:drop-all-tables → ⚠️ Extremely dangerous
|
|
171
|
+
|
|
172
|
+
${colors.yellow}Tips:${colors.reset}
|
|
173
|
+
- CSV/JSON = insert data only
|
|
174
|
+
- SQL = schema + data control
|
|
175
|
+
- Use --truncate for clean import (if supported)
|
|
163
176
|
|
|
164
177
|
Use: mwala <command> [options]
|
|
165
178
|
`);
|
|
179
|
+
|
|
166
180
|
process.exit(0);
|
|
167
181
|
}
|
|
168
182
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mwalajs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "MwalaJS Framework CLI Tool and Web Framework for Backend and Frontend Development.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "app.mjs",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"mongoose": "^8.12.1",
|
|
31
31
|
"mpath": "^0.9.0",
|
|
32
32
|
"multer": "^1.4.2",
|
|
33
|
-
"mwalajs": "^1.1.
|
|
33
|
+
"mwalajs": "^1.1.8",
|
|
34
34
|
"mysql2": "^3.13.0",
|
|
35
35
|
"pg": "^8.13.3",
|
|
36
36
|
"pg-hstore": "^2.3.4",
|
package/users.csv
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
id,name,email,password,age,address,createdAt,updatedAt
|
|
2
2
|
1,"mmgf","gb@h.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
3
3
|
2,"mmgf","g@bh.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
4
|
-
3,"mmgf","g5@kh.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
4
|
+
3,"mmgf","g5@kh.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
5
|
+
4,"mmgf","g@h.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
6
|
+
5,"mmgf","g4@h.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
7
|
+
6,"mmgf","g7@h.b","122",11,"vh","2026-03-21T05:21:38.000Z","2026-03-21T05:21:38.000Z"
|
|
8
|
+
|