You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response includes a `directConnection` object with credentials for connecting directly to the underlying PostgreSQL database. Use these values to build your `DATABASE_URL`:
This direct connection string is the recommended way to connect to your Prisma Postgres database for all use cases including Prisma Client, migrations, and direct database access.
259
+
207
260
-**Responses**:
208
261
-`201 Created`: Project created
209
262
-`401 Unauthorized`
@@ -314,6 +367,42 @@ Delete a database.
314
367
-`403 Cannot delete default environment`
315
368
-`404 Not Found`
316
369
370
+
#### `GET /databases/{databaseId}/usage`
371
+
372
+
Get usage metrics for a database.
373
+
374
+
-**Path parameters**:
375
+
-`databaseId`: Database ID
376
+
-**Query parameters**:
377
+
-`startDate` (optional): Start date for the usage period
378
+
-`endDate` (optional): End date for the usage period
379
+
-**Response body**:
380
+
```json
381
+
{
382
+
"period": {
383
+
"start": "2025-12-01T00:00:00.000Z",
384
+
"end": "2025-12-14T21:39:23.331Z"
385
+
},
386
+
"metrics": {
387
+
"operations": {
388
+
"used": 0,
389
+
"unit": "ops"
390
+
},
391
+
"storage": {
392
+
"used": 0,
393
+
"unit": "GiB"
394
+
}
395
+
},
396
+
"generatedAt": "2025-12-14T21:39:23.331Z"
397
+
}
398
+
```
399
+
-**Responses**:
400
+
-`200 OK`: Usage metrics returned
401
+
-`400 Bad Request`: Invalid request parameters
402
+
-`401 Unauthorized`
403
+
-`404 Not Found`
404
+
-`500 Internal Server Error`: Error occurred while fetching metrics
0 commit comments