outlet-orm 4.2.0 → 5.0.0
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 +1312 -1199
- package/bin/init.js +379 -221
- package/bin/migrate.js +440 -442
- package/package.json +76 -77
- package/src/Database/DatabaseConnection.js +4 -0
- package/{lib → src}/Migrations/Migration.js +48 -48
- package/{lib → src}/Migrations/MigrationManager.js +326 -326
- package/src/Model.js +1118 -1118
- package/{lib → src}/Schema/Schema.js +790 -790
- package/src/index.js +49 -31
- package/types/index.d.ts +660 -660
- package/lib/Database/DatabaseConnection.js +0 -4
package/package.json
CHANGED
|
@@ -1,77 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "outlet-orm",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A Laravel Eloquent-inspired ORM for Node.js with support for MySQL, PostgreSQL, and SQLite",
|
|
5
|
-
"main": "src/index.js",
|
|
6
|
-
"types": "types/index.d.ts",
|
|
7
|
-
"bin": {
|
|
8
|
-
"outlet-init": "./bin/init.js",
|
|
9
|
-
"outlet-convert": "./bin/convert.js",
|
|
10
|
-
"outlet-migrate": "./bin/migrate.js"
|
|
11
|
-
},
|
|
12
|
-
"files": [
|
|
13
|
-
"src/**",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"test": "jest",
|
|
22
|
-
"test:
|
|
23
|
-
"
|
|
24
|
-
"lint": "eslint \"{src,bin
|
|
25
|
-
"
|
|
26
|
-
"migrate": "node bin/migrate.js
|
|
27
|
-
"migrate:
|
|
28
|
-
"migrate:
|
|
29
|
-
"migrate:
|
|
30
|
-
"migrate:
|
|
31
|
-
"migrate:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "outlet-orm",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "A Laravel Eloquent-inspired ORM for Node.js with support for MySQL, PostgreSQL, and SQLite",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"outlet-init": "./bin/init.js",
|
|
9
|
+
"outlet-convert": "./bin/convert.js",
|
|
10
|
+
"outlet-migrate": "./bin/migrate.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src/**",
|
|
14
|
+
"bin/**",
|
|
15
|
+
"types/**",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"test:watch": "jest --watch",
|
|
22
|
+
"test:coverage": "jest --coverage",
|
|
23
|
+
"lint": "eslint \"{src,bin}/**/*.js\"",
|
|
24
|
+
"lint:fix": "eslint \"{src,bin}/**/*.js\" --fix",
|
|
25
|
+
"migrate": "node bin/migrate.js migrate",
|
|
26
|
+
"migrate:make": "node bin/migrate.js make",
|
|
27
|
+
"migrate:rollback": "node bin/migrate.js rollback --steps 1",
|
|
28
|
+
"migrate:status": "node bin/migrate.js status",
|
|
29
|
+
"migrate:reset": "node bin/migrate.js reset --yes",
|
|
30
|
+
"migrate:refresh": "node bin/migrate.js refresh --yes",
|
|
31
|
+
"migrate:fresh": "node bin/migrate.js fresh --yes"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"orm",
|
|
35
|
+
"eloquent",
|
|
36
|
+
"laravel",
|
|
37
|
+
"database",
|
|
38
|
+
"mysql",
|
|
39
|
+
"postgresql",
|
|
40
|
+
"sqlite",
|
|
41
|
+
"query-builder",
|
|
42
|
+
"active-record"
|
|
43
|
+
],
|
|
44
|
+
"author": "omgbwa-yasse",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/omgbwa-yasse/outlet-orm.git"
|
|
49
|
+
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/omgbwa-yasse/outlet-orm/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/omgbwa-yasse/outlet-orm#readme",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"dotenv": "^16.4.5"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"mysql2": "^3.15.2",
|
|
59
|
+
"pg": "^8.11.0",
|
|
60
|
+
"sqlite3": "^5.1.6"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"mysql2": { "optional": true },
|
|
64
|
+
"pg": { "optional": true },
|
|
65
|
+
"sqlite3": { "optional": true }
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^20.10.0",
|
|
69
|
+
"eslint": "^8.50.0",
|
|
70
|
+
"jest": "^29.7.0",
|
|
71
|
+
"typescript": "^5.3.0"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=18.0.0"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Migration Class
|
|
3
|
-
* All migrations should extend this class
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
class Migration {
|
|
7
|
-
constructor(connection) {
|
|
8
|
-
this.connection = connection;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Run the migrations
|
|
13
|
-
*/
|
|
14
|
-
async up() {
|
|
15
|
-
throw new Error('Migration up() method must be implemented');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Reverse the migrations
|
|
20
|
-
*/
|
|
21
|
-
async down() {
|
|
22
|
-
throw new Error('Migration down() method must be implemented');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get the migration name
|
|
27
|
-
*/
|
|
28
|
-
static getName() {
|
|
29
|
-
return this.name;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Execute raw SQL
|
|
34
|
-
*/
|
|
35
|
-
async execute(sql) {
|
|
36
|
-
return await this.connection.execute(sql);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get the Schema builder
|
|
41
|
-
*/
|
|
42
|
-
getSchema() {
|
|
43
|
-
const { Schema } = require('../Schema/Schema');
|
|
44
|
-
return new Schema(this.connection);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
module.exports = Migration;
|
|
1
|
+
/**
|
|
2
|
+
* Base Migration Class
|
|
3
|
+
* All migrations should extend this class
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
class Migration {
|
|
7
|
+
constructor(connection) {
|
|
8
|
+
this.connection = connection;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Run the migrations
|
|
13
|
+
*/
|
|
14
|
+
async up() {
|
|
15
|
+
throw new Error('Migration up() method must be implemented');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Reverse the migrations
|
|
20
|
+
*/
|
|
21
|
+
async down() {
|
|
22
|
+
throw new Error('Migration down() method must be implemented');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get the migration name
|
|
27
|
+
*/
|
|
28
|
+
static getName() {
|
|
29
|
+
return this.name;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Execute raw SQL
|
|
34
|
+
*/
|
|
35
|
+
async execute(sql) {
|
|
36
|
+
return await this.connection.execute(sql);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the Schema builder
|
|
41
|
+
*/
|
|
42
|
+
getSchema() {
|
|
43
|
+
const { Schema } = require('../Schema/Schema');
|
|
44
|
+
return new Schema(this.connection);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = Migration;
|