neonctl 1.11.5 → 1.12.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.
@@ -28,6 +28,11 @@ export const builder = (argv) => {
28
28
  describe: 'Use pooled connection',
29
29
  default: false,
30
30
  },
31
+ prisma: {
32
+ type: 'boolean',
33
+ describe: 'Use connection string for Prisma setup',
34
+ default: false,
35
+ },
31
36
  });
32
37
  };
33
38
  export const handler = async (props) => {
@@ -40,5 +45,12 @@ export const handler = async (props) => {
40
45
  connectionString.pathname = props.database.name;
41
46
  connectionString.username = props.role.name;
42
47
  connectionString.password = password.password;
48
+ if (props.prisma) {
49
+ connectionString.searchParams.set('connect_timeout', '30');
50
+ if (props.pooled) {
51
+ connectionString.searchParams.set('pool_timeout', '30');
52
+ connectionString.searchParams.set('pgbouncer', 'true');
53
+ }
54
+ }
43
55
  process.stdout.write(connectionString.toString());
44
56
  };
@@ -36,4 +36,41 @@ describe('connection_string', () => {
36
36
  snapshot: true,
37
37
  },
38
38
  });
39
+ testCliCommand({
40
+ name: 'connection_string prisma',
41
+ args: [
42
+ 'connection-string',
43
+ '--project.id',
44
+ 'test',
45
+ '--endpoint.id',
46
+ 'test_endpoint_id',
47
+ '--database.name',
48
+ 'test_db',
49
+ '--role.name',
50
+ 'test_role',
51
+ '--prisma',
52
+ ],
53
+ expected: {
54
+ snapshot: true,
55
+ },
56
+ });
57
+ testCliCommand({
58
+ name: 'connection_string prisma pooled',
59
+ args: [
60
+ 'connection-string',
61
+ '--project.id',
62
+ 'test',
63
+ '--endpoint.id',
64
+ 'test_endpoint_id',
65
+ '--database.name',
66
+ 'test_db',
67
+ '--role.name',
68
+ 'test_role',
69
+ '--prisma',
70
+ '--pooled',
71
+ ],
72
+ expected: {
73
+ snapshot: true,
74
+ },
75
+ });
39
76
  });
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git@github.com:neondatabase/neonctl.git"
6
6
  },
7
7
  "type": "module",
8
- "version": "1.11.5",
8
+ "version": "1.12.0",
9
9
  "description": "CLI tool for NeonDB Cloud management",
10
10
  "main": "index.js",
11
11
  "author": "NeonDB",