lamix 4.2.7 → 4.2.8

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/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Migration & Seeder CLI Tool
2
2
  This package supports MySQL (mysql2), PostgreSQL (pg), and SQLite (sqlite3).
3
- A simple Node.js CLI for generating and running database migrations and seeders with MySQL, using a custom DB wrapper.
3
+ A simple Node.js CLI for generating Models and running database migrations and seeders with MySQL, using a custom DB wrapper.
4
4
 
5
5
  ---
6
- get all Usage in examples provided for any issue or support get in tourch @ `andrewkhabweri@gmail.com`
6
+ get all Usage in examples folder provided for any issue or support get in tourch @ `andrewkhabweri@gmail.com`
7
7
  ## Features
8
8
 
9
9
  - Generate migration files dynamically with fields
@@ -82,12 +82,12 @@ Migrations table Supports chainable modifiers filled Manually :
82
82
  ## Setup
83
83
 
84
84
  1. download this project.
85
- npm i nexium-orm
85
+ npm i lamix
86
86
 
87
87
  2. Install dependencies (if any).
88
88
  > This tool uses `mysql2`,`pg`,`sqlite3` driver, so make sure you install your prefered driver:
89
89
  EITHER
90
- Configure DB via environment variables: `'DB_CONNECTION=mysql',DB_HOST`, `DB_USER`, `DB_PASS`, `DB_NAME`, `DB_PORT`, `DB_CONNECTION_LIMIT`.
90
+ Configure DB via environment variables: `'DB_CONNECTION=mysql',DB_HOST=yourvalue`, `DB_USER=yourvalue`, `DB_PASS=yourvalue`, `DB_NAME=yourvalue`, `DB_PORT=yourvalue`, `DB_CONNECTION_LIMIT=yourvalue`.
91
91
 
92
92
  ## Quick start
93
93
  for database connection use any driver of your choice eg
@@ -104,7 +104,7 @@ for database connection use any driver of your choice eg
104
104
  ```bash
105
105
  npm i lamix
106
106
 
107
- npm install mysql2 dotenv bcrypt
107
+ npm install mysql2
108
108
 
109
109
  ```bash
110
110
  #Make Sure you put this in package.json inside your project directory for
package/examples/User.md CHANGED
@@ -16,6 +16,7 @@ class User extends BaseModel {
16
16
  };
17
17
 
18
18
  profile() {
19
+ const Profile = require('./Profile');
19
20
  return this.hasOne(Profile).onDelete('restrict');
20
21
  }
21
22
 
@@ -33,7 +34,8 @@ class User extends BaseModel {
33
34
 
34
35
  // One-to-many: User -> Post
35
36
  posts() {
36
- return this.hasMany(require('./Post'), 'user_id', 'id').onDelete('cascade');
37
+ Post = require('./Post');
38
+ return this.hasMany(Post, 'user_id', 'id').onDelete('cascade');
37
39
  }
38
40
  }
39
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lamix",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "description": "lamix - ORM for Node-express js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "scripts": {
26
26
  "artisan": "node artisan.js",
27
- "build": "tsc && echo 'Build complete'"
27
+ "build": "tsc && echo 'Build complete'"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^24.1.0",
@@ -42,7 +42,6 @@
42
42
  "database",
43
43
  "laravel-inspired"
44
44
  ],
45
-
46
45
  "author": {
47
46
  "name": "Andrew Khabweri",
48
47
  "email": "andrewkhabweri@gmail.com"