Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/claim-db-worker/app/web/DatabaseContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const DatabaseProvider = ({ children }: DatabaseProviderProps) => {

if (db) {
const directConnString = db.directConnection
? `postgresql://${db.directConnection.user}:${db.directConnection.pass}@${db.directConnection.host}?sslmode=require`
? `postgresql://${db.directConnection.user}:${db.directConnection.pass}@${db.directConnection.host}?sslmode=verify-full`
: "";

const newDbInfo = {
Expand Down
4 changes: 2 additions & 2 deletions packages/create-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ When using `--json` with `create`, the output includes:
```json
{
"success": true,
"connectionString": "postgresql://user:pass@host:5432/postgres?sslmode=require",
"connectionString": "postgresql://user:pass@host:5432/postgres?sslmode=verify-full",
"claimUrl": "https://create-db.prisma.io/claim?projectID=...",
"deletionDate": "2025-12-13T12:00:00.000Z",
"region": "us-east-1",
Expand All @@ -137,7 +137,7 @@ When using `--json` with `regions`, the output is an array of region objects:
When using `--env`, the following variables are appended to the specified file:

```env
DATABASE_URL="postgresql://user:pass@host:5432/postgres?sslmode=require"
DATABASE_URL="postgresql://user:pass@host:5432/postgres?sslmode=verify-full"
CLAIM_URL="https://create-db.prisma.io/claim?projectID=..."
```

Expand Down
7 changes: 6 additions & 1 deletion packages/create-db/src/core/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,15 @@ export async function createDatabaseCore(
Boolean(c.endpoints?.direct?.connectionString) ||
Boolean(c.endpoints?.pooled?.connectionString),
);
const connectionString =
const rawConnectionString =
connection?.endpoints?.direct?.connectionString
?? connection?.endpoints?.pooled?.connectionString
?? null;
const connectionString =
rawConnectionString?.replace(
/([?&]sslmode=)(require|prefer|verify-ca)(?=[&#]|$)/i,
"$1verify-full"
) ?? null;

const claimUrl = `${claimDbWorkerUrl}/claim?projectID=${projectId}&utm_source=${userAgent || getCommandName()}&utm_medium=cli`;

Expand Down
Loading