@geekmidas/cli 0.50.0 → 0.51.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -49,11 +49,11 @@
49
49
  "openapi-typescript": "^7.4.2",
50
50
  "pg": "~8.17.1",
51
51
  "prompts": "~2.4.2",
52
- "@geekmidas/logger": "~0.4.0",
53
- "@geekmidas/errors": "~0.1.0",
54
- "@geekmidas/schema": "~0.1.0",
52
+ "@geekmidas/envkit": "~0.7.0",
55
53
  "@geekmidas/constructs": "~0.8.0",
56
- "@geekmidas/envkit": "~0.7.0"
54
+ "@geekmidas/errors": "~0.1.0",
55
+ "@geekmidas/logger": "~0.4.0",
56
+ "@geekmidas/schema": "~0.1.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/lodash.kebabcase": "^4.1.9",
@@ -338,9 +338,11 @@ async function initializePostgresUsers(
338
338
  // Create or update user (handles existing users)
339
339
  await client.query(`
340
340
  DO $$ BEGIN
341
- CREATE USER "${user.name}" WITH PASSWORD '${user.password}';
342
- EXCEPTION WHEN duplicate_object THEN
343
- ALTER USER "${user.name}" WITH PASSWORD '${user.password}';
341
+ IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = '${user.name}') THEN
342
+ CREATE USER "${user.name}" WITH PASSWORD '${user.password}';
343
+ ELSE
344
+ ALTER USER "${user.name}" WITH PASSWORD '${user.password}';
345
+ END IF;
344
346
  END $$;
345
347
  `);
346
348