Skip to content

Commit 8e0ed45

Browse files
amaksimogithub-actions[bot]
authored andcommitted
Sync examples from connectors
1 parent dc78630 commit 8e0ed45

3 files changed

Lines changed: 55 additions & 44 deletions

File tree

javascript/postgres-js/src/alternatives/websocket/package-lock.json

Lines changed: 41 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascript/postgres-js/src/alternatives/websocket/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"lint:fix": "eslint . --fix"
99
},
1010
"dependencies": {
11-
"@aws-sdk/client-sts": "^3.1001.0",
12-
"@aws-sdk/types": "^3.973.5",
11+
"@aws-sdk/client-sts": "^3.1021.0",
12+
"@aws-sdk/types": "^3.973.7",
1313
"@aws/aurora-dsql-postgresjs-connector": "^0.2.1",
1414
"buffer": "^6.0.3",
1515
"net-browserify": "^0.2.4",
1616
"performance-now": "^2.1.0",
1717
"postgres": "^3.4.7",
1818
"process": "^0.11.10",
1919
"react": "^19.2.4",
20-
"react-dom": "^19.2.4",
20+
"react-dom": "^19.2.5",
2121
"setimmediate": "^1.0.5",
2222
"timers-browserify": "^2.0.12"
2323
},

php/pdo-pgsql/src/example_preferred.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,29 @@
1010
use Aws\AuroraDsql\PdoPgsql\AuroraDsql;
1111
use Aws\AuroraDsql\PdoPgsql\DsqlConfig;
1212

13+
// Works with both admin and non-admin users:
14+
// - Admin users operate in the default "public" schema
15+
// - Non-admin users operate in a custom "myschema" schema
1316
function main(): void
1417
{
1518
$clusterEndpoint = getenv('CLUSTER_ENDPOINT') ?: throw new RuntimeException(
1619
'CLUSTER_ENDPOINT environment variable is required'
1720
);
21+
$clusterUser = getenv('CLUSTER_USER') ?: 'admin';
22+
23+
// Determine schema based on user type
24+
$schema = $clusterUser === 'admin' ? 'public' : 'myschema';
1825

1926
$config = new DsqlConfig(
2027
host: $clusterEndpoint,
28+
user: $clusterUser,
2129
occMaxRetries: 3,
2230
);
2331
$pdo = AuroraDsql::connect($config);
2432

33+
// Set search_path for the appropriate schema
34+
$pdo->exec("SET search_path = '{$schema}'");
35+
2536
// Simple read
2637
$stmt = $pdo->query('SELECT 1 AS result');
2738
$row = $stmt->fetch(PDO::FETCH_ASSOC);

0 commit comments

Comments
 (0)