@mostajs/setup 2.1.19 → 2.1.20
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/dist/lib/setup.js +8 -1
- package/package.json +1 -1
package/dist/lib/setup.js
CHANGED
|
@@ -60,12 +60,16 @@ export async function runInstall(installConfig, setupConfig) {
|
|
|
60
60
|
port: setupConfig.defaultPort,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
// 3. Set process.env in-memory
|
|
63
|
+
// 3. Set process.env in-memory (force ORM mode even if app started as NET)
|
|
64
|
+
process.env.MOSTA_DATA = 'orm';
|
|
64
65
|
process.env.DB_DIALECT = installConfig.dialect;
|
|
65
66
|
process.env.SGBD_URI = uri;
|
|
66
67
|
if (installConfig.dialect !== 'mongodb') {
|
|
67
68
|
process.env.DB_SCHEMA_STRATEGY = 'update';
|
|
68
69
|
}
|
|
70
|
+
// Clear NET vars to avoid confusion
|
|
71
|
+
delete process.env.MOSTA_NET_URL;
|
|
72
|
+
delete process.env.MOSTA_NET_TRANSPORT;
|
|
69
73
|
// 4. Disconnect existing dialect singleton
|
|
70
74
|
const { disconnectDialect } = await import('@mostajs/orm');
|
|
71
75
|
await disconnectDialect();
|
|
@@ -118,6 +122,9 @@ export async function runInstall(installConfig, setupConfig) {
|
|
|
118
122
|
*/
|
|
119
123
|
async function runNetInstall(installConfig, setupConfig) {
|
|
120
124
|
try {
|
|
125
|
+
// Force NET mode in-memory (even if app started as ORM)
|
|
126
|
+
process.env.MOSTA_DATA = 'net';
|
|
127
|
+
process.env.MOSTA_NET_URL = installConfig.net.url;
|
|
121
128
|
const net = new NetClient({
|
|
122
129
|
url: installConfig.net.url,
|
|
123
130
|
apiKey: installConfig.net.apiKey,
|
package/package.json
CHANGED