postgresai 0.17.0-dev.3 → 0.17.0-dev.5
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/README.md +17 -10
- package/dist/bin/postgres-ai.js +22012 -18951
- package/dist/sql/06.helpers.sql +10 -0
- package/dist/sql/sql/06.helpers.sql +10 -0
- package/package.json +1 -1
- package/schemas/A002.schema.json +2 -0
- package/schemas/A003.schema.json +2 -0
- package/schemas/A004.schema.json +2 -0
- package/schemas/A007.schema.json +2 -0
- package/schemas/A013.schema.json +2 -0
- package/schemas/D001.schema.json +2 -0
- package/schemas/D004.schema.json +2 -0
- package/schemas/F001.schema.json +2 -0
- package/schemas/F002.schema.json +1 -1
- package/schemas/F003.schema.json +2 -0
- package/schemas/F004.schema.json +2 -0
- package/schemas/F005.schema.json +2 -0
- package/schemas/F009.schema.json +2 -0
- package/schemas/G001.schema.json +2 -0
- package/schemas/G003.schema.json +2 -0
- package/schemas/H001.schema.json +2 -0
- package/schemas/H002.schema.json +2 -0
- package/schemas/H004.schema.json +2 -0
- package/schemas/I001.schema.json +2 -0
- package/schemas/K001.schema.json +2 -0
- package/schemas/K003.schema.json +2 -0
- package/schemas/K004.schema.json +2 -0
- package/schemas/K005.schema.json +2 -0
- package/schemas/K006.schema.json +2 -0
- package/schemas/K007.schema.json +2 -0
- package/schemas/K008.schema.json +2 -0
- package/schemas/M001.schema.json +2 -0
- package/schemas/M002.schema.json +2 -0
- package/schemas/M003.schema.json +2 -0
- package/schemas/N001.schema.json +2 -0
- package/sql/06.helpers.sql +10 -0
package/dist/sql/06.helpers.sql
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
-- Helper functions for postgres_ai monitoring user (template-filled by cli/lib/init.ts)
|
|
2
2
|
|
|
3
|
+
-- Remove the retired helper from databases prepared by older CLI versions.
|
|
4
|
+
-- A non-owner cannot drop it: warn and continue instead of aborting prepare-db.
|
|
5
|
+
do $$
|
|
6
|
+
begin
|
|
7
|
+
drop function if exists postgres_ai.explain_generic(text, text, text);
|
|
8
|
+
exception when insufficient_privilege then
|
|
9
|
+
raise warning 'postgres_ai: legacy SECURITY DEFINER helper was NOT removed: %', sqlerrm
|
|
10
|
+
using hint = 'Its owner or a superuser must drop it; see the drop function statement in step 06.helpers.';
|
|
11
|
+
end $$;
|
|
12
|
+
|
|
3
13
|
/*
|
|
4
14
|
* table_describe
|
|
5
15
|
*
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
-- Helper functions for postgres_ai monitoring user (template-filled by cli/lib/init.ts)
|
|
2
2
|
|
|
3
|
+
-- Remove the retired helper from databases prepared by older CLI versions.
|
|
4
|
+
-- A non-owner cannot drop it: warn and continue instead of aborting prepare-db.
|
|
5
|
+
do $$
|
|
6
|
+
begin
|
|
7
|
+
drop function if exists postgres_ai.explain_generic(text, text, text);
|
|
8
|
+
exception when insufficient_privilege then
|
|
9
|
+
raise warning 'postgres_ai: legacy SECURITY DEFINER helper was NOT removed: %', sqlerrm
|
|
10
|
+
using hint = 'Its owner or a superuser must drop it; see the drop function statement in step 06.helpers.';
|
|
11
|
+
end $$;
|
|
12
|
+
|
|
3
13
|
/*
|
|
4
14
|
* table_describe
|
|
5
15
|
*
|
package/package.json
CHANGED
package/schemas/A002.schema.json
CHANGED
package/schemas/A003.schema.json
CHANGED
package/schemas/A004.schema.json
CHANGED
package/schemas/A007.schema.json
CHANGED
package/schemas/A013.schema.json
CHANGED
package/schemas/D001.schema.json
CHANGED
package/schemas/D004.schema.json
CHANGED
|
@@ -126,6 +126,8 @@
|
|
|
126
126
|
"additionalProperties": false,
|
|
127
127
|
"required": ["data"],
|
|
128
128
|
"properties": {
|
|
129
|
+
"available": { "type": "boolean" },
|
|
130
|
+
"reason": { "type": "string" },
|
|
129
131
|
"data": { "$ref": "#/$defs/data" },
|
|
130
132
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
131
133
|
}
|
package/schemas/F001.schema.json
CHANGED
|
@@ -195,6 +195,8 @@
|
|
|
195
195
|
"additionalProperties": false,
|
|
196
196
|
"required": ["data"],
|
|
197
197
|
"properties": {
|
|
198
|
+
"available": { "type": "boolean" },
|
|
199
|
+
"reason": { "type": "string" },
|
|
198
200
|
"data": { "$ref": "#/$defs/data" },
|
|
199
201
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" },
|
|
200
202
|
"effective_values": { "$ref": "#/$defs/effectiveValues" },
|
package/schemas/F002.schema.json
CHANGED
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
},
|
|
103
103
|
"nodeResult": {
|
|
104
104
|
"type": "object", "additionalProperties": false, "required": ["data"],
|
|
105
|
-
"properties": { "data": { "$ref": "#/$defs/data" }, "postgres_version": { "$ref": "#/$defs/postgresVersion" } }
|
|
105
|
+
"properties": { "available": { "type": "boolean" }, "reason": { "type": "string" }, "data": { "$ref": "#/$defs/data" }, "postgres_version": { "$ref": "#/$defs/postgresVersion" } }
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
package/schemas/F003.schema.json
CHANGED
|
@@ -249,6 +249,8 @@
|
|
|
249
249
|
"additionalProperties": false,
|
|
250
250
|
"required": ["data"],
|
|
251
251
|
"properties": {
|
|
252
|
+
"available": { "type": "boolean" },
|
|
253
|
+
"reason": { "type": "string" },
|
|
252
254
|
"data": { "$ref": "#/$defs/data" },
|
|
253
255
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
254
256
|
}
|
package/schemas/F004.schema.json
CHANGED
|
@@ -117,6 +117,8 @@
|
|
|
117
117
|
"additionalProperties": false,
|
|
118
118
|
"required": ["data"],
|
|
119
119
|
"properties": {
|
|
120
|
+
"available": { "type": "boolean" },
|
|
121
|
+
"reason": { "type": "string" },
|
|
120
122
|
"data": { "$ref": "#/$defs/data" },
|
|
121
123
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
122
124
|
}
|
package/schemas/F005.schema.json
CHANGED
|
@@ -123,6 +123,8 @@
|
|
|
123
123
|
"additionalProperties": false,
|
|
124
124
|
"required": ["data"],
|
|
125
125
|
"properties": {
|
|
126
|
+
"available": { "type": "boolean" },
|
|
127
|
+
"reason": { "type": "string" },
|
|
126
128
|
"data": { "$ref": "#/$defs/data" },
|
|
127
129
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
128
130
|
}
|
package/schemas/F009.schema.json
CHANGED
|
@@ -147,6 +147,8 @@
|
|
|
147
147
|
"additionalProperties": false,
|
|
148
148
|
"required": ["data"],
|
|
149
149
|
"properties": {
|
|
150
|
+
"available": { "type": "boolean" },
|
|
151
|
+
"reason": { "type": "string" },
|
|
150
152
|
"data": { "$ref": "#/$defs/data" },
|
|
151
153
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
152
154
|
}
|
package/schemas/G001.schema.json
CHANGED
|
@@ -125,6 +125,8 @@
|
|
|
125
125
|
"additionalProperties": false,
|
|
126
126
|
"required": ["data"],
|
|
127
127
|
"properties": {
|
|
128
|
+
"available": { "type": "boolean" },
|
|
129
|
+
"reason": { "type": "string" },
|
|
128
130
|
"data": { "$ref": "#/$defs/data" },
|
|
129
131
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
130
132
|
}
|
package/schemas/G003.schema.json
CHANGED
package/schemas/H001.schema.json
CHANGED
|
@@ -133,6 +133,8 @@
|
|
|
133
133
|
"additionalProperties": false,
|
|
134
134
|
"required": ["data"],
|
|
135
135
|
"properties": {
|
|
136
|
+
"available": { "type": "boolean" },
|
|
137
|
+
"reason": { "type": "string" },
|
|
136
138
|
"data": { "$ref": "#/$defs/data" },
|
|
137
139
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
138
140
|
}
|
package/schemas/H002.schema.json
CHANGED
|
@@ -119,6 +119,8 @@
|
|
|
119
119
|
"additionalProperties": false,
|
|
120
120
|
"required": ["data"],
|
|
121
121
|
"properties": {
|
|
122
|
+
"available": { "type": "boolean" },
|
|
123
|
+
"reason": { "type": "string" },
|
|
122
124
|
"data": { "$ref": "#/$defs/data" },
|
|
123
125
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
124
126
|
}
|
package/schemas/H004.schema.json
CHANGED
|
@@ -118,6 +118,8 @@
|
|
|
118
118
|
"additionalProperties": false,
|
|
119
119
|
"required": ["data"],
|
|
120
120
|
"properties": {
|
|
121
|
+
"available": { "type": "boolean" },
|
|
122
|
+
"reason": { "type": "string" },
|
|
121
123
|
"data": { "$ref": "#/$defs/data" },
|
|
122
124
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
123
125
|
}
|
package/schemas/I001.schema.json
CHANGED
|
@@ -141,6 +141,8 @@
|
|
|
141
141
|
"additionalProperties": false,
|
|
142
142
|
"required": ["data"],
|
|
143
143
|
"properties": {
|
|
144
|
+
"available": { "type": "boolean" },
|
|
145
|
+
"reason": { "type": "string" },
|
|
144
146
|
"data": { "$ref": "#/$defs/data" },
|
|
145
147
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
146
148
|
}
|
package/schemas/K001.schema.json
CHANGED
|
@@ -151,6 +151,8 @@
|
|
|
151
151
|
"additionalProperties": false,
|
|
152
152
|
"required": ["data"],
|
|
153
153
|
"properties": {
|
|
154
|
+
"available": { "type": "boolean" },
|
|
155
|
+
"reason": { "type": "string" },
|
|
154
156
|
"data": { "$ref": "#/$defs/data" },
|
|
155
157
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
156
158
|
}
|
package/schemas/K003.schema.json
CHANGED
|
@@ -153,6 +153,8 @@
|
|
|
153
153
|
"additionalProperties": false,
|
|
154
154
|
"required": ["data"],
|
|
155
155
|
"properties": {
|
|
156
|
+
"available": { "type": "boolean" },
|
|
157
|
+
"reason": { "type": "string" },
|
|
156
158
|
"data": { "$ref": "#/$defs/data" },
|
|
157
159
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
158
160
|
}
|
package/schemas/K004.schema.json
CHANGED
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"additionalProperties": false,
|
|
101
101
|
"required": ["data"],
|
|
102
102
|
"properties": {
|
|
103
|
+
"available": { "type": "boolean" },
|
|
104
|
+
"reason": { "type": "string" },
|
|
103
105
|
"data": { "$ref": "#/$defs/data" },
|
|
104
106
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
105
107
|
}
|
package/schemas/K005.schema.json
CHANGED
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"additionalProperties": false,
|
|
101
101
|
"required": ["data"],
|
|
102
102
|
"properties": {
|
|
103
|
+
"available": { "type": "boolean" },
|
|
104
|
+
"reason": { "type": "string" },
|
|
103
105
|
"data": { "$ref": "#/$defs/data" },
|
|
104
106
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
105
107
|
}
|
package/schemas/K006.schema.json
CHANGED
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"additionalProperties": false,
|
|
101
101
|
"required": ["data"],
|
|
102
102
|
"properties": {
|
|
103
|
+
"available": { "type": "boolean" },
|
|
104
|
+
"reason": { "type": "string" },
|
|
103
105
|
"data": { "$ref": "#/$defs/data" },
|
|
104
106
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
105
107
|
}
|
package/schemas/K007.schema.json
CHANGED
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"additionalProperties": false,
|
|
101
101
|
"required": ["data"],
|
|
102
102
|
"properties": {
|
|
103
|
+
"available": { "type": "boolean" },
|
|
104
|
+
"reason": { "type": "string" },
|
|
103
105
|
"data": { "$ref": "#/$defs/data" },
|
|
104
106
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
105
107
|
}
|
package/schemas/K008.schema.json
CHANGED
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"additionalProperties": false,
|
|
101
101
|
"required": ["data"],
|
|
102
102
|
"properties": {
|
|
103
|
+
"available": { "type": "boolean" },
|
|
104
|
+
"reason": { "type": "string" },
|
|
103
105
|
"data": { "$ref": "#/$defs/data" },
|
|
104
106
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
105
107
|
}
|
package/schemas/M001.schema.json
CHANGED
|
@@ -109,6 +109,8 @@
|
|
|
109
109
|
"additionalProperties": false,
|
|
110
110
|
"required": ["data"],
|
|
111
111
|
"properties": {
|
|
112
|
+
"available": { "type": "boolean" },
|
|
113
|
+
"reason": { "type": "string" },
|
|
112
114
|
"data": { "$ref": "#/$defs/data" },
|
|
113
115
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
114
116
|
}
|
package/schemas/M002.schema.json
CHANGED
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"additionalProperties": false,
|
|
101
101
|
"required": ["data"],
|
|
102
102
|
"properties": {
|
|
103
|
+
"available": { "type": "boolean" },
|
|
104
|
+
"reason": { "type": "string" },
|
|
103
105
|
"data": { "$ref": "#/$defs/data" },
|
|
104
106
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
105
107
|
}
|
package/schemas/M003.schema.json
CHANGED
|
@@ -118,6 +118,8 @@
|
|
|
118
118
|
"additionalProperties": false,
|
|
119
119
|
"required": ["data"],
|
|
120
120
|
"properties": {
|
|
121
|
+
"available": { "type": "boolean" },
|
|
122
|
+
"reason": { "type": "string" },
|
|
121
123
|
"data": { "$ref": "#/$defs/data" },
|
|
122
124
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
123
125
|
}
|
package/schemas/N001.schema.json
CHANGED
|
@@ -153,6 +153,8 @@
|
|
|
153
153
|
"additionalProperties": false,
|
|
154
154
|
"required": ["data"],
|
|
155
155
|
"properties": {
|
|
156
|
+
"available": { "type": "boolean" },
|
|
157
|
+
"reason": { "type": "string" },
|
|
156
158
|
"data": { "$ref": "#/$defs/data" },
|
|
157
159
|
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
158
160
|
}
|
package/sql/06.helpers.sql
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
-- Helper functions for postgres_ai monitoring user (template-filled by cli/lib/init.ts)
|
|
2
2
|
|
|
3
|
+
-- Remove the retired helper from databases prepared by older CLI versions.
|
|
4
|
+
-- A non-owner cannot drop it: warn and continue instead of aborting prepare-db.
|
|
5
|
+
do $$
|
|
6
|
+
begin
|
|
7
|
+
drop function if exists postgres_ai.explain_generic(text, text, text);
|
|
8
|
+
exception when insufficient_privilege then
|
|
9
|
+
raise warning 'postgres_ai: legacy SECURITY DEFINER helper was NOT removed: %', sqlerrm
|
|
10
|
+
using hint = 'Its owner or a superuser must drop it; see the drop function statement in step 06.helpers.';
|
|
11
|
+
end $$;
|
|
12
|
+
|
|
3
13
|
/*
|
|
4
14
|
* table_describe
|
|
5
15
|
*
|