@stonyx/orm 0.3.2-alpha.5 → 0.3.2-alpha.7
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/config/environment.js +91 -12
- package/package.json +5 -5
- package/config/environment.ts +0 -91
package/config/environment.js
CHANGED
|
@@ -1,12 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const {
|
|
2
|
+
ORM_ACCESS_PATH,
|
|
3
|
+
ORM_MODEL_PATH,
|
|
4
|
+
ORM_REST_ROUTE,
|
|
5
|
+
ORM_SERIALIZER_PATH,
|
|
6
|
+
ORM_TRANSFORM_PATH,
|
|
7
|
+
ORM_VIEW_PATH,
|
|
8
|
+
ORM_USE_REST_SERVER,
|
|
9
|
+
DB_AUTO_SAVE,
|
|
10
|
+
DB_FILE,
|
|
11
|
+
DB_MODE,
|
|
12
|
+
DB_DIRECTORY,
|
|
13
|
+
DB_SCHEMA_PATH,
|
|
14
|
+
DB_SAVE_INTERVAL,
|
|
15
|
+
MYSQL_HOST,
|
|
16
|
+
MYSQL_PORT,
|
|
17
|
+
MYSQL_USER,
|
|
18
|
+
MYSQL_PASSWORD,
|
|
19
|
+
MYSQL_DATABASE,
|
|
20
|
+
MYSQL_CONNECTION_LIMIT,
|
|
21
|
+
MYSQL_MIGRATIONS_DIR,
|
|
22
|
+
PG_HOST,
|
|
23
|
+
PG_PORT,
|
|
24
|
+
PG_USER,
|
|
25
|
+
PG_PASSWORD,
|
|
26
|
+
PG_DATABASE,
|
|
27
|
+
PG_CONNECTION_LIMIT,
|
|
28
|
+
PG_MIGRATIONS_DIR,
|
|
29
|
+
TIMESCALE_HOST,
|
|
30
|
+
TIMESCALE_PORT,
|
|
31
|
+
TIMESCALE_USER,
|
|
32
|
+
TIMESCALE_PASSWORD,
|
|
33
|
+
TIMESCALE_DATABASE,
|
|
34
|
+
TIMESCALE_CONNECTION_LIMIT,
|
|
35
|
+
TIMESCALE_MIGRATIONS_DIR,
|
|
36
|
+
} = process.env;
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
logColor: 'white',
|
|
40
|
+
logMethod: 'db',
|
|
41
|
+
|
|
42
|
+
db: {
|
|
43
|
+
autosave: DB_AUTO_SAVE ?? 'false', // 'true' (cron interval), 'false' (disabled), 'onUpdate' (save after each write op)
|
|
44
|
+
file: DB_FILE ?? 'db.json',
|
|
45
|
+
mode: DB_MODE ?? 'file', // 'file' (single db.json) or 'directory' (one file per collection)
|
|
46
|
+
directory: DB_DIRECTORY ?? 'db', // directory name for collection files when mode is 'directory'
|
|
47
|
+
saveInterval: DB_SAVE_INTERVAL ?? 60 * 60, // 1 hour
|
|
48
|
+
schema: DB_SCHEMA_PATH ?? './config/db-schema.js'
|
|
49
|
+
},
|
|
50
|
+
paths: {
|
|
51
|
+
access: ORM_ACCESS_PATH ?? './access', // Optional for restServer access hooks
|
|
52
|
+
model: ORM_MODEL_PATH ?? './models',
|
|
53
|
+
serializer: ORM_SERIALIZER_PATH ?? './serializers',
|
|
54
|
+
transform: ORM_TRANSFORM_PATH ?? './transforms',
|
|
55
|
+
view: ORM_VIEW_PATH ?? './views'
|
|
56
|
+
},
|
|
57
|
+
mysql: MYSQL_HOST ? {
|
|
58
|
+
host: MYSQL_HOST ?? 'localhost',
|
|
59
|
+
port: parseInt(MYSQL_PORT ?? '3306'),
|
|
60
|
+
user: MYSQL_USER ?? 'root',
|
|
61
|
+
password: MYSQL_PASSWORD ?? '',
|
|
62
|
+
database: MYSQL_DATABASE ?? 'stonyx',
|
|
63
|
+
connectionLimit: parseInt(MYSQL_CONNECTION_LIMIT ?? '10'),
|
|
64
|
+
migrationsDir: MYSQL_MIGRATIONS_DIR ?? 'migrations',
|
|
65
|
+
migrationsTable: '__migrations',
|
|
66
|
+
} : undefined,
|
|
67
|
+
postgres: PG_HOST ? {
|
|
68
|
+
host: PG_HOST ?? 'localhost',
|
|
69
|
+
port: parseInt(PG_PORT ?? '5432'),
|
|
70
|
+
user: PG_USER ?? 'postgres',
|
|
71
|
+
password: PG_PASSWORD ?? '',
|
|
72
|
+
database: PG_DATABASE ?? 'stonyx',
|
|
73
|
+
connectionLimit: parseInt(PG_CONNECTION_LIMIT ?? '10'),
|
|
74
|
+
migrationsDir: PG_MIGRATIONS_DIR ?? 'migrations',
|
|
75
|
+
migrationsTable: '__migrations',
|
|
76
|
+
} : undefined,
|
|
77
|
+
timescale: TIMESCALE_HOST ? {
|
|
78
|
+
host: TIMESCALE_HOST ?? 'localhost',
|
|
79
|
+
port: parseInt(TIMESCALE_PORT ?? '5432'),
|
|
80
|
+
user: TIMESCALE_USER ?? 'postgres',
|
|
81
|
+
password: TIMESCALE_PASSWORD ?? '',
|
|
82
|
+
database: TIMESCALE_DATABASE ?? 'stonyx',
|
|
83
|
+
connectionLimit: parseInt(TIMESCALE_CONNECTION_LIMIT ?? '10'),
|
|
84
|
+
migrationsDir: TIMESCALE_MIGRATIONS_DIR ?? 'migrations',
|
|
85
|
+
migrationsTable: '__migrations',
|
|
86
|
+
} : undefined,
|
|
87
|
+
restServer: {
|
|
88
|
+
enabled: ORM_USE_REST_SERVER ?? 'true', // Whether to load restServer for automatic route setup or
|
|
89
|
+
route: ORM_REST_ROUTE ?? '/',
|
|
90
|
+
}
|
|
91
|
+
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"stonyx-async",
|
|
5
5
|
"stonyx-module"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.3.2-alpha.
|
|
7
|
+
"version": "0.3.2-alpha.7",
|
|
8
8
|
"description": "",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"type": "module",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://github.com/abofs/stonyx-orm#readme",
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@stonyx/cron": "0.2.1-beta.
|
|
65
|
-
"@stonyx/events": "0.1.1-beta.
|
|
66
|
-
"stonyx": "0.2.3-beta.
|
|
64
|
+
"@stonyx/cron": "0.2.1-beta.59",
|
|
65
|
+
"@stonyx/events": "0.1.1-beta.47",
|
|
66
|
+
"stonyx": "0.2.3-beta.63"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@stonyx/rest-server": ">=0.2.1-beta.14",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@stonyx/rest-server": "0.2.1-beta.
|
|
85
|
+
"@stonyx/rest-server": "0.2.1-beta.59",
|
|
86
86
|
"@stonyx/utils": "0.2.3-beta.23",
|
|
87
87
|
"@types/node": "^25.6.0",
|
|
88
88
|
"mysql2": "^3.20.0",
|
package/config/environment.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
ORM_ACCESS_PATH,
|
|
3
|
-
ORM_MODEL_PATH,
|
|
4
|
-
ORM_REST_ROUTE,
|
|
5
|
-
ORM_SERIALIZER_PATH,
|
|
6
|
-
ORM_TRANSFORM_PATH,
|
|
7
|
-
ORM_VIEW_PATH,
|
|
8
|
-
ORM_USE_REST_SERVER,
|
|
9
|
-
DB_AUTO_SAVE,
|
|
10
|
-
DB_FILE,
|
|
11
|
-
DB_MODE,
|
|
12
|
-
DB_DIRECTORY,
|
|
13
|
-
DB_SCHEMA_PATH,
|
|
14
|
-
DB_SAVE_INTERVAL,
|
|
15
|
-
MYSQL_HOST,
|
|
16
|
-
MYSQL_PORT,
|
|
17
|
-
MYSQL_USER,
|
|
18
|
-
MYSQL_PASSWORD,
|
|
19
|
-
MYSQL_DATABASE,
|
|
20
|
-
MYSQL_CONNECTION_LIMIT,
|
|
21
|
-
MYSQL_MIGRATIONS_DIR,
|
|
22
|
-
PG_HOST,
|
|
23
|
-
PG_PORT,
|
|
24
|
-
PG_USER,
|
|
25
|
-
PG_PASSWORD,
|
|
26
|
-
PG_DATABASE,
|
|
27
|
-
PG_CONNECTION_LIMIT,
|
|
28
|
-
PG_MIGRATIONS_DIR,
|
|
29
|
-
TIMESCALE_HOST,
|
|
30
|
-
TIMESCALE_PORT,
|
|
31
|
-
TIMESCALE_USER,
|
|
32
|
-
TIMESCALE_PASSWORD,
|
|
33
|
-
TIMESCALE_DATABASE,
|
|
34
|
-
TIMESCALE_CONNECTION_LIMIT,
|
|
35
|
-
TIMESCALE_MIGRATIONS_DIR,
|
|
36
|
-
} = process.env;
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
logColor: 'white',
|
|
40
|
-
logMethod: 'db',
|
|
41
|
-
|
|
42
|
-
db: {
|
|
43
|
-
autosave: DB_AUTO_SAVE ?? 'false', // 'true' (cron interval), 'false' (disabled), 'onUpdate' (save after each write op)
|
|
44
|
-
file: DB_FILE ?? 'db.json',
|
|
45
|
-
mode: DB_MODE ?? 'file', // 'file' (single db.json) or 'directory' (one file per collection)
|
|
46
|
-
directory: DB_DIRECTORY ?? 'db', // directory name for collection files when mode is 'directory'
|
|
47
|
-
saveInterval: DB_SAVE_INTERVAL ?? 60 * 60, // 1 hour
|
|
48
|
-
schema: DB_SCHEMA_PATH ?? './config/db-schema.js'
|
|
49
|
-
},
|
|
50
|
-
paths: {
|
|
51
|
-
access: ORM_ACCESS_PATH ?? './access', // Optional for restServer access hooks
|
|
52
|
-
model: ORM_MODEL_PATH ?? './models',
|
|
53
|
-
serializer: ORM_SERIALIZER_PATH ?? './serializers',
|
|
54
|
-
transform: ORM_TRANSFORM_PATH ?? './transforms',
|
|
55
|
-
view: ORM_VIEW_PATH ?? './views'
|
|
56
|
-
},
|
|
57
|
-
mysql: MYSQL_HOST ? {
|
|
58
|
-
host: MYSQL_HOST ?? 'localhost',
|
|
59
|
-
port: parseInt(MYSQL_PORT ?? '3306'),
|
|
60
|
-
user: MYSQL_USER ?? 'root',
|
|
61
|
-
password: MYSQL_PASSWORD ?? '',
|
|
62
|
-
database: MYSQL_DATABASE ?? 'stonyx',
|
|
63
|
-
connectionLimit: parseInt(MYSQL_CONNECTION_LIMIT ?? '10'),
|
|
64
|
-
migrationsDir: MYSQL_MIGRATIONS_DIR ?? 'migrations',
|
|
65
|
-
migrationsTable: '__migrations',
|
|
66
|
-
} : undefined,
|
|
67
|
-
postgres: PG_HOST ? {
|
|
68
|
-
host: PG_HOST ?? 'localhost',
|
|
69
|
-
port: parseInt(PG_PORT ?? '5432'),
|
|
70
|
-
user: PG_USER ?? 'postgres',
|
|
71
|
-
password: PG_PASSWORD ?? '',
|
|
72
|
-
database: PG_DATABASE ?? 'stonyx',
|
|
73
|
-
connectionLimit: parseInt(PG_CONNECTION_LIMIT ?? '10'),
|
|
74
|
-
migrationsDir: PG_MIGRATIONS_DIR ?? 'migrations',
|
|
75
|
-
migrationsTable: '__migrations',
|
|
76
|
-
} : undefined,
|
|
77
|
-
timescale: TIMESCALE_HOST ? {
|
|
78
|
-
host: TIMESCALE_HOST ?? 'localhost',
|
|
79
|
-
port: parseInt(TIMESCALE_PORT ?? '5432'),
|
|
80
|
-
user: TIMESCALE_USER ?? 'postgres',
|
|
81
|
-
password: TIMESCALE_PASSWORD ?? '',
|
|
82
|
-
database: TIMESCALE_DATABASE ?? 'stonyx',
|
|
83
|
-
connectionLimit: parseInt(TIMESCALE_CONNECTION_LIMIT ?? '10'),
|
|
84
|
-
migrationsDir: TIMESCALE_MIGRATIONS_DIR ?? 'migrations',
|
|
85
|
-
migrationsTable: '__migrations',
|
|
86
|
-
} : undefined,
|
|
87
|
-
restServer: {
|
|
88
|
-
enabled: ORM_USE_REST_SERVER ?? 'true', // Whether to load restServer for automatic route setup or
|
|
89
|
-
route: ORM_REST_ROUTE ?? '/',
|
|
90
|
-
}
|
|
91
|
-
}
|