create-db 1.0.8-pr51-DC-4933-env-flag-17283424880.0 → 1.0.8-pr51-DC-4933-env-flag-17293580791.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.
Files changed (2) hide show
  1. package/index.js +6 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -540,7 +540,7 @@ async function createDatabase(name, region, userAgent, silent = false) {
540
540
  error: "api_error",
541
541
  message: result.error.message || "Unknown error",
542
542
  details: result.error,
543
- status: result.error.status,
543
+ status: result.error.status ?? resp.status,
544
544
  };
545
545
  }
546
546
 
@@ -652,8 +652,11 @@ async function main() {
652
652
  }
653
653
 
654
654
  let name = new Date().toISOString();
655
- let userLocation = await detectUserLocation();
656
- let region = getRegionClosestToLocation(userLocation) || "us-east-1";
655
+ let region = flags.region || "us-east-1";
656
+ if (!flags.region || !flags.interactive) {
657
+ const userLocation = await detectUserLocation();
658
+ region = getRegionClosestToLocation(userLocation) || region;
659
+ }
657
660
  let chooseRegionPrompt = false;
658
661
 
659
662
  if (flags.help) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-db",
3
- "version": "1.0.8-pr51-DC-4933-env-flag-17283424880.0",
3
+ "version": "1.0.8-pr51-DC-4933-env-flag-17293580791.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": "",