create-db 1.0.4-pr45-DC-4829-source-flag-17239115059.0 → 1.0.4-pr45-DC-4829-source-flag-17244466791.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/index.js +7 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -315,7 +315,11 @@ async function createDatabase(name, region, userAgent, returnJson = false) {
|
|
|
315
315
|
const resp = await fetch(`${CREATE_DB_WORKER_URL}/create`, {
|
|
316
316
|
method: "POST",
|
|
317
317
|
headers: { "Content-Type": "application/json" },
|
|
318
|
-
body: JSON.stringify({
|
|
318
|
+
body: JSON.stringify({
|
|
319
|
+
region,
|
|
320
|
+
name,
|
|
321
|
+
utm_source: userAgent || CLI_NAME,
|
|
322
|
+
}),
|
|
319
323
|
});
|
|
320
324
|
|
|
321
325
|
if (resp.status === 429) {
|
|
@@ -406,7 +410,7 @@ async function createDatabase(name, region, userAgent, returnJson = false) {
|
|
|
406
410
|
const directDbName = directConnDetails?.database || "postgres";
|
|
407
411
|
const directConn =
|
|
408
412
|
directConnDetails && directHost
|
|
409
|
-
? `postgresql://${directUser}:${directPass}@${directHost}${directPort}/${directDbName}`
|
|
413
|
+
? `postgresql://${directUser}:${directPass}@${directHost}${directPort}/${directDbName}?sslmode=require`
|
|
410
414
|
: null;
|
|
411
415
|
|
|
412
416
|
const claimUrl = `${CLAIM_DB_WORKER_URL}?projectID=${projectId}&utm_source=${userAgent}&utm_medium=cli`;
|
|
@@ -571,12 +575,9 @@ async function main() {
|
|
|
571
575
|
command: CLI_NAME,
|
|
572
576
|
region: region,
|
|
573
577
|
"selection-method": "flag",
|
|
578
|
+
"user-agent": userAgent,
|
|
574
579
|
};
|
|
575
580
|
|
|
576
|
-
if (userAgent) {
|
|
577
|
-
analyticsProps["user-agent"] = userAgent;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
581
|
await analytics.capture("create_db:region_selected", analyticsProps);
|
|
581
582
|
} catch (error) {}
|
|
582
583
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-db",
|
|
3
|
-
"version": "1.0.4-pr45-DC-4829-source-flag-
|
|
3
|
+
"version": "1.0.4-pr45-DC-4829-source-flag-17244466791.0",
|
|
4
4
|
"description": "Instantly create a temporary Prisma Postgres database with one command, then claim and persist it in your Prisma Data Platform project when ready.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "",
|