@exogee/graphweaver-mikroorm 2.4.0 → 2.6.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.
|
@@ -48,16 +48,20 @@ class DatabaseFile {
|
|
|
48
48
|
const connection = [`export const connection = {`];
|
|
49
49
|
connection.push(`${pad}connectionManagerId: '${this.databaseType}',`);
|
|
50
50
|
connection.push(`${pad}mikroOrmConfig: {`);
|
|
51
|
-
connection.push(`${pad}${pad}entities
|
|
51
|
+
connection.push(`${pad}${pad}entities,`);
|
|
52
52
|
connection.push(
|
|
53
53
|
`${pad}${pad}driver: ${isPostgresql ? "PostgreSqlDriver" : isMySQL ? "MySqlDriver" : "SqliteDriver"},`
|
|
54
54
|
);
|
|
55
|
-
connection.push(`${pad}${pad}dbName: '${config.dbName}',`);
|
|
55
|
+
connection.push(`${pad}${pad}dbName: process.env.DATABASE_NAME || '${config.dbName}',`);
|
|
56
56
|
if (!isSQLite) {
|
|
57
|
-
connection.push(`${pad}${pad}host: '${config.host}',`);
|
|
58
|
-
connection.push(`${pad}${pad}user: '${config.user}',`);
|
|
59
|
-
connection.push(
|
|
60
|
-
|
|
57
|
+
connection.push(`${pad}${pad}host: process.env.DATABASE_HOST || '${config.host}',`);
|
|
58
|
+
connection.push(`${pad}${pad}user: process.env.DATABASE_USER || '${config.user}',`);
|
|
59
|
+
connection.push(
|
|
60
|
+
`${pad}${pad}password: process.env.DATABASE_PASSWORD || '${config.password}',`
|
|
61
|
+
);
|
|
62
|
+
connection.push(
|
|
63
|
+
`${pad}${pad}port: process.env.DATABASE_PORT ? parseInt(process.env.DATABASE_PORT) : ${config.port},`
|
|
64
|
+
);
|
|
61
65
|
}
|
|
62
66
|
connection.push(`${pad}},`);
|
|
63
67
|
connection.push(`};`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/introspection/files/database-file.ts"],
|
|
4
|
-
"sourcesContent": ["import { Options } from '@mikro-orm/core';\nimport { ConnectionOptions, DatabaseType } from '../../database';\n\nexport class DatabaseFile {\n\tconstructor(\n\t\tprotected readonly databaseType: DatabaseType,\n\t\tprotected readonly connection: ConnectionOptions\n\t) {}\n\n\tgetBasePath() {\n\t\treturn `backend/`;\n\t}\n\n\tgetBaseName() {\n\t\treturn 'database.ts';\n\t}\n\n\tgenerate(): string {\n\t\tconst isPostgresql = this.databaseType === 'postgresql';\n\t\tconst isMySQL = this.databaseType === 'mysql';\n\t\tconst isSQLite = this.databaseType === 'sqlite';\n\t\tconst imports = [\n\t\t\t...(isPostgresql ? [`import { PostgreSqlDriver } from '@mikro-orm/postgresql';`] : []),\n\t\t\t...(isMySQL ? [`import { MySqlDriver } from '@mikro-orm/mysql';`] : []),\n\t\t\t...(isSQLite ? [`import { SqliteDriver } from 'mikro-orm-sqlite-wasm';`] : []),\n\t\t\t`import { entities } from './entities';`,\n\t\t];\n\t\tconst exports = [`export const connections = [connection];`];\n\n\t\tconst pad = '\\t';\n\n\t\tconst config = this.connection.mikroOrmConfig as Options;\n\n\t\tconst connection = [`export const connection = {`];\n\t\tconnection.push(`${pad}connectionManagerId: '${this.databaseType}',`);\n\t\tconnection.push(`${pad}mikroOrmConfig: {`);\n\t\tconnection.push(`${pad}${pad}entities
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,aAAa;AAAA,EACzB,YACoB,cACA,YAClB;AAFkB;AACA;AAAA,EACjB;AAAA,EAEH,cAAc;AACb,WAAO;AAAA,EACR;AAAA,EAEA,cAAc;AACb,WAAO;AAAA,EACR;AAAA,EAEA,WAAmB;AAClB,UAAM,eAAe,KAAK,iBAAiB;AAC3C,UAAM,UAAU,KAAK,iBAAiB;AACtC,UAAM,WAAW,KAAK,iBAAiB;AACvC,UAAM,UAAU;AAAA,MACf,GAAI,eAAe,CAAC,2DAA2D,IAAI,CAAC;AAAA,MACpF,GAAI,UAAU,CAAC,iDAAiD,IAAI,CAAC;AAAA,MACrE,GAAI,WAAW,CAAC,uDAAuD,IAAI,CAAC;AAAA,MAC5E;AAAA,IACD;AACA,UAAMA,WAAU,CAAC,0CAA0C;AAE3D,UAAM,MAAM;AAEZ,UAAM,SAAS,KAAK,WAAW;AAE/B,UAAM,aAAa,CAAC,6BAA6B;AACjD,eAAW,KAAK,GAAG,GAAG,yBAAyB,KAAK,YAAY,IAAI;AACpE,eAAW,KAAK,GAAG,GAAG,mBAAmB;AACzC,eAAW,KAAK,GAAG,GAAG,GAAG,GAAG,
|
|
4
|
+
"sourcesContent": ["import { Options } from '@mikro-orm/core';\nimport { ConnectionOptions, DatabaseType } from '../../database';\n\nexport class DatabaseFile {\n\tconstructor(\n\t\tprotected readonly databaseType: DatabaseType,\n\t\tprotected readonly connection: ConnectionOptions\n\t) {}\n\n\tgetBasePath() {\n\t\treturn `backend/`;\n\t}\n\n\tgetBaseName() {\n\t\treturn 'database.ts';\n\t}\n\n\tgenerate(): string {\n\t\tconst isPostgresql = this.databaseType === 'postgresql';\n\t\tconst isMySQL = this.databaseType === 'mysql';\n\t\tconst isSQLite = this.databaseType === 'sqlite';\n\t\tconst imports = [\n\t\t\t...(isPostgresql ? [`import { PostgreSqlDriver } from '@mikro-orm/postgresql';`] : []),\n\t\t\t...(isMySQL ? [`import { MySqlDriver } from '@mikro-orm/mysql';`] : []),\n\t\t\t...(isSQLite ? [`import { SqliteDriver } from 'mikro-orm-sqlite-wasm';`] : []),\n\t\t\t`import { entities } from './entities';`,\n\t\t];\n\t\tconst exports = [`export const connections = [connection];`];\n\n\t\tconst pad = '\\t';\n\n\t\tconst config = this.connection.mikroOrmConfig as Options;\n\n\t\tconst connection = [`export const connection = {`];\n\t\tconnection.push(`${pad}connectionManagerId: '${this.databaseType}',`);\n\t\tconnection.push(`${pad}mikroOrmConfig: {`);\n\t\tconnection.push(`${pad}${pad}entities,`);\n\t\tconnection.push(\n\t\t\t`${pad}${pad}driver: ${\n\t\t\t\tisPostgresql ? 'PostgreSqlDriver' : isMySQL ? 'MySqlDriver' : 'SqliteDriver'\n\t\t\t},`\n\t\t);\n\t\tconnection.push(`${pad}${pad}dbName: process.env.DATABASE_NAME || '${config.dbName}',`);\n\t\tif (!isSQLite) {\n\t\t\tconnection.push(`${pad}${pad}host: process.env.DATABASE_HOST || '${config.host}',`);\n\t\t\tconnection.push(`${pad}${pad}user: process.env.DATABASE_USER || '${config.user}',`);\n\t\t\tconnection.push(\n\t\t\t\t`${pad}${pad}password: process.env.DATABASE_PASSWORD || '${config.password}',`\n\t\t\t);\n\t\t\tconnection.push(\n\t\t\t\t`${pad}${pad}port: process.env.DATABASE_PORT ? parseInt(process.env.DATABASE_PORT) : ${config.port},`\n\t\t\t);\n\t\t}\n\t\tconnection.push(`${pad}},`);\n\t\tconnection.push(`};`);\n\n\t\treturn `${imports.join('\\n')}\\n\\n${connection.join('\\n')}\\n\\n${exports.join('\\n')}\\n`;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,aAAa;AAAA,EACzB,YACoB,cACA,YAClB;AAFkB;AACA;AAAA,EACjB;AAAA,EAEH,cAAc;AACb,WAAO;AAAA,EACR;AAAA,EAEA,cAAc;AACb,WAAO;AAAA,EACR;AAAA,EAEA,WAAmB;AAClB,UAAM,eAAe,KAAK,iBAAiB;AAC3C,UAAM,UAAU,KAAK,iBAAiB;AACtC,UAAM,WAAW,KAAK,iBAAiB;AACvC,UAAM,UAAU;AAAA,MACf,GAAI,eAAe,CAAC,2DAA2D,IAAI,CAAC;AAAA,MACpF,GAAI,UAAU,CAAC,iDAAiD,IAAI,CAAC;AAAA,MACrE,GAAI,WAAW,CAAC,uDAAuD,IAAI,CAAC;AAAA,MAC5E;AAAA,IACD;AACA,UAAMA,WAAU,CAAC,0CAA0C;AAE3D,UAAM,MAAM;AAEZ,UAAM,SAAS,KAAK,WAAW;AAE/B,UAAM,aAAa,CAAC,6BAA6B;AACjD,eAAW,KAAK,GAAG,GAAG,yBAAyB,KAAK,YAAY,IAAI;AACpE,eAAW,KAAK,GAAG,GAAG,mBAAmB;AACzC,eAAW,KAAK,GAAG,GAAG,GAAG,GAAG,WAAW;AACvC,eAAW;AAAA,MACV,GAAG,GAAG,GAAG,GAAG,WACX,eAAe,qBAAqB,UAAU,gBAAgB,cAC/D;AAAA,IACD;AACA,eAAW,KAAK,GAAG,GAAG,GAAG,GAAG,yCAAyC,OAAO,MAAM,IAAI;AACtF,QAAI,CAAC,UAAU;AACd,iBAAW,KAAK,GAAG,GAAG,GAAG,GAAG,uCAAuC,OAAO,IAAI,IAAI;AAClF,iBAAW,KAAK,GAAG,GAAG,GAAG,GAAG,uCAAuC,OAAO,IAAI,IAAI;AAClF,iBAAW;AAAA,QACV,GAAG,GAAG,GAAG,GAAG,+CAA+C,OAAO,QAAQ;AAAA,MAC3E;AACA,iBAAW;AAAA,QACV,GAAG,GAAG,GAAG,GAAG,2EAA2E,OAAO,IAAI;AAAA,MACnG;AAAA,IACD;AACA,eAAW,KAAK,GAAG,GAAG,IAAI;AAC1B,eAAW,KAAK,IAAI;AAEpB,WAAO,GAAG,QAAQ,KAAK,IAAI,CAAC;AAAA;AAAA,EAAO,WAAW,KAAK,IAAI,CAAC;AAAA;AAAA,EAAOA,SAAQ,KAAK,IAAI,CAAC;AAAA;AAAA,EAClF;AACD;",
|
|
6
6
|
"names": ["exports"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exogee/graphweaver-mikroorm",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "MikroORM backend for @exogee/graphweaver",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@apollo/server": "4.11.0",
|
|
16
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
16
|
+
"@aws-sdk/client-secrets-manager": "3.654.0",
|
|
17
17
|
"dataloader": "2.2.2",
|
|
18
18
|
"decimal.js": "10.4.3",
|
|
19
19
|
"dotenv": "16.4.5",
|
|
20
20
|
"graphql": "16.9.0",
|
|
21
21
|
"pluralize": "8.0.0",
|
|
22
22
|
"reflect-metadata": "0.2.2",
|
|
23
|
-
"@exogee/graphweaver": "2.
|
|
24
|
-
"@exogee/graphweaver-server": "2.
|
|
25
|
-
"@exogee/logger": "2.
|
|
23
|
+
"@exogee/graphweaver": "2.6.0",
|
|
24
|
+
"@exogee/graphweaver-server": "2.6.0",
|
|
25
|
+
"@exogee/logger": "2.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@mikro-orm/core": "6.3.10",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@mikro-orm/sqlite": "6.3.10",
|
|
33
33
|
"@types/node": "22.5.5",
|
|
34
34
|
"@types/pluralize": "0.0.33",
|
|
35
|
-
"esbuild": "0.
|
|
35
|
+
"esbuild": "0.24.0",
|
|
36
36
|
"glob": "10.4.3",
|
|
37
37
|
"tsx": "4.19.1",
|
|
38
38
|
"typescript": "5.6.2"
|