neon 3.3.0 → 3.5.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.
@@ -2,6 +2,7 @@
2
2
  const INSPECT_QUERIES = {
3
3
  "table-sizes": {
4
4
  describe: "Size of each table (including TOAST), largest first (pg_table_size)",
5
+ scope: "database",
5
6
  fields: [
6
7
  "schema",
7
8
  "name",
@@ -23,6 +24,7 @@ const INSPECT_QUERIES = {
23
24
  },
24
25
  "index-sizes": {
25
26
  describe: "Size of each index, largest first (pg_relation_size)",
27
+ scope: "database",
26
28
  fields: [
27
29
  "schema",
28
30
  "name",
@@ -44,6 +46,7 @@ const INSPECT_QUERIES = {
44
46
  },
45
47
  "unused-indexes": {
46
48
  describe: "Non-unique indexes with few scans — candidates for removal (pg_stat_user_indexes)",
49
+ scope: "database",
47
50
  fields: [
48
51
  "table",
49
52
  "index",
@@ -67,6 +70,7 @@ const INSPECT_QUERIES = {
67
70
  },
68
71
  "seq-scans": {
69
72
  describe: "Number of sequential scans recorded against each table (pg_stat_user_tables)",
73
+ scope: "database",
70
74
  fields: [
71
75
  "schema",
72
76
  "name",
@@ -84,13 +88,15 @@ const INSPECT_QUERIES = {
84
88
  },
85
89
  "long-running-queries": {
86
90
  describe: "Queries running longer than 5 minutes (pg_stat_activity)",
91
+ scope: "database",
87
92
  fields: [
88
93
  "pid",
89
94
  "duration",
90
95
  "state",
91
96
  "query"
92
97
  ],
93
- emptyMessage: "No long-running queries.",
98
+ emptyMessage: "No long-running queries in this database.",
99
+ emptyMessageAll: "No long-running queries in any database.",
94
100
  sql: `
95
101
  SELECT
96
102
  pid,
@@ -98,7 +104,8 @@ const INSPECT_QUERIES = {
98
104
  state,
99
105
  query
100
106
  FROM pg_stat_activity
101
- WHERE state <> 'idle'
107
+ WHERE datname = current_database()
108
+ AND state <> 'idle'
102
109
  AND query NOT ILIKE '%pg_stat_activity%'
103
110
  AND now() - query_start > interval '5 minutes'
104
111
  ORDER BY now() - query_start DESC;
@@ -106,6 +113,7 @@ const INSPECT_QUERIES = {
106
113
  },
107
114
  locks: {
108
115
  describe: "Locks held with the acquiring query and its age (pg_locks + pg_stat_activity)",
116
+ scope: "database",
109
117
  fields: [
110
118
  "pid",
111
119
  "relname",
@@ -115,7 +123,8 @@ const INSPECT_QUERIES = {
115
123
  "age",
116
124
  "query"
117
125
  ],
118
- emptyMessage: "No locks held.",
126
+ emptyMessage: "No locks held in this database.",
127
+ emptyMessageAll: "No locks held in any database.",
119
128
  sql: `
120
129
  SELECT
121
130
  a.pid,
@@ -128,13 +137,15 @@ const INSPECT_QUERIES = {
128
137
  FROM pg_locks l
129
138
  JOIN pg_stat_activity a ON a.pid = l.pid
130
139
  LEFT JOIN pg_class c ON c.oid = l.relation
131
- WHERE a.query <> '<insufficient privilege>'
140
+ WHERE a.datname = current_database()
141
+ AND a.query <> '<insufficient privilege>'
132
142
  AND l.pid <> pg_backend_pid()
133
143
  ORDER BY a.query_start;
134
144
  `
135
145
  },
136
146
  outliers: {
137
147
  describe: "Queries taking the most cumulative execution time (needs pg_stat_statements)",
148
+ scope: "database",
138
149
  fields: [
139
150
  "total_exec_time",
140
151
  "prop_exec_time",
@@ -161,6 +172,7 @@ const INSPECT_QUERIES = {
161
172
  },
162
173
  calls: {
163
174
  describe: "Most frequently called queries (needs pg_stat_statements)",
175
+ scope: "database",
164
176
  fields: [
165
177
  "ncalls",
166
178
  "total_exec_time",
@@ -186,7 +198,8 @@ const INSPECT_QUERIES = {
186
198
  `
187
199
  },
188
200
  "lfc-hit-rate": {
189
- describe: "Local File Cache hit rate (needs neon extension)",
201
+ describe: "Local File Cache hit rate (compute-wide, needs neon extension)",
202
+ scope: "compute",
190
203
  fields: ["name", "ratio"],
191
204
  emptyMessage: "No LFC stats available.",
192
205
  requiresExtension: "neon",
@@ -207,7 +220,8 @@ const INSPECT_QUERIES = {
207
220
  `
208
221
  },
209
222
  "working-set": {
210
- describe: "Estimated working set vs LFC size (needs neon extension)",
223
+ describe: "Estimated working set vs LFC size (compute-wide, needs neon extension)",
224
+ scope: "compute",
211
225
  fields: [
212
226
  "window",
213
227
  "working_set",
@@ -239,6 +253,7 @@ const INSPECT_QUERIES = {
239
253
  },
240
254
  "vacuum-stats": {
241
255
  describe: "Autovacuum status per table: last (auto)vacuum, dead tuples, threshold",
256
+ scope: "database",
242
257
  fields: [
243
258
  "schema",
244
259
  "table",
@@ -273,6 +288,7 @@ const INSPECT_QUERIES = {
273
288
  },
274
289
  bloat: {
275
290
  describe: "Estimated table/index bloat (statistical estimate, no extension needed)",
291
+ scope: "database",
276
292
  fields: [
277
293
  "type",
278
294
  "schema",
@@ -333,7 +349,8 @@ const INSPECT_QUERIES = {
333
349
  `
334
350
  },
335
351
  "replication-slots": {
336
- describe: "Replication slots: kind, status, client, restart/confirmed-flush LSNs, and lag (pg_replication_slots + pg_stat_replication)",
352
+ describe: "Replication slots (compute-wide): kind, status, client, restart/confirmed-flush LSNs, and lag (pg_replication_slots + pg_stat_replication)",
353
+ scope: "compute",
337
354
  fields: [
338
355
  "slot_name",
339
356
  "slot_type",
@@ -379,6 +396,7 @@ const INSPECT_QUERIES = {
379
396
  },
380
397
  subscriptions: {
381
398
  describe: "Per-table logical replication progress on this subscriber (pg_subscription_rel)",
399
+ scope: "database",
382
400
  fields: [
383
401
  "subscription",
384
402
  "table_name",
@@ -386,6 +404,7 @@ const INSPECT_QUERIES = {
386
404
  "lsn"
387
405
  ],
388
406
  emptyMessage: "No subscriptions found on this database.",
407
+ emptyMessageAll: "No subscriptions found on any database.",
389
408
  sql: `
390
409
  SELECT
391
410
  sub.subname AS subscription,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -46,6 +46,7 @@
46
46
  "@clack/prompts": "0.10.1",
47
47
  "@hono/node-server": "2.0.4",
48
48
  "@segment/analytics-node": "1.3.0",
49
+ "add-mcp": "2.0.0",
49
50
  "chalk": "5.3.0",
50
51
  "chokidar": "5.0.0",
51
52
  "cli-table": "0.3.11",
@@ -63,8 +64,8 @@
63
64
  "yaml": "^2.9.0",
64
65
  "yargs": "17.7.2",
65
66
  "yoctocolors": "^2.1.2",
66
- "@neon/config": "1.0.0",
67
67
  "@neon/sdk": "2.0.0",
68
+ "@neon/config": "1.0.0",
68
69
  "@neon/config-runtime": "1.0.0"
69
70
  },
70
71
  "optionalDependencies": {