Skip to content

Commit

Permalink
Set postgres enabled state via request body in E2E and drizzle next
Browse files Browse the repository at this point in the history
… tests (#1570)

Co-authored-by: Xata Bot <[email protected]>
Co-authored-by: github-merge-queue[bot] <github-merge-queue[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 9, 2024
1 parent eed3363 commit 00a8db0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/client/src/api/controlPlaneComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,12 @@ export type CreateDatabaseRequestBody = {
* @minLength 1
*/
region: string;
/**
* Enable postgres access for this database
*
* @default false
*/
postgresEnabled?: boolean;
/**
* The dedicated cluster where branches from this database will be created. Defaults to 'shared-cluster'.
*
Expand Down
3 changes: 1 addition & 2 deletions packages/plugin-client-drizzle/test/drizzle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ describe.concurrent.each([{ type: 'pg' }, { type: 'http' }])('Drizzle $type', ({
beforeAll(async () => {
await api.databases.createDatabase({
pathParams: { workspaceId: workspace, dbName: database },
body: { region, branchName: 'main' },
headers: { 'X-Features': 'feat-pgroll-migrations=1' }
body: { region, branchName: 'main', postgresEnabled: true }
});

await waitForReplication();
Expand Down
3 changes: 1 addition & 2 deletions test/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ export async function setUpTestEnvironment(

const { databaseName: database } = await api.databases.createDatabase({
pathParams: { workspaceId: workspace, dbName: `sdk-integration-test-${prefix}-${id}` },
body: { region, defaultClusterID: clusterId },
headers: { 'X-Features': 'feat-pgroll-migrations=1' }
body: { region, defaultClusterID: clusterId, postgresEnabled: true }
});

const workspaceUrl = getHostUrl(host, 'workspaces').replace('{workspaceId}', workspace).replace('{region}', region);
Expand Down

0 comments on commit 00a8db0

Please sign in to comment.