@lark-base-open/base-database-cli 1.3.7 → 1.3.8
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/CHANGELOG.md +23 -0
- package/README.md +2 -0
- package/dist/ai-functions.d.ts +11 -0
- package/dist/ai-functions.d.ts.map +1 -1
- package/dist/ai-functions.js +118 -9
- package/dist/ai-functions.js.map +1 -1
- package/dist/archive.d.ts.map +1 -1
- package/dist/archive.js +4 -0
- package/dist/archive.js.map +1 -1
- package/dist/deploy.d.ts +4 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +26 -8
- package/dist/deploy.js.map +1 -1
- package/dist/init.d.ts +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +4 -3
- package/dist/init.js.map +1 -1
- package/dist/lark-cli-error.d.ts +1 -0
- package/dist/lark-cli-error.d.ts.map +1 -1
- package/dist/lark-cli-error.js +37 -7
- package/dist/lark-cli-error.js.map +1 -1
- package/dist/lark-cli.d.ts.map +1 -1
- package/dist/lark-cli.js +16 -4
- package/dist/lark-cli.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +7 -2
- package/dist/program.js.map +1 -1
- package/dist/public-sql-error.d.ts.map +1 -1
- package/dist/public-sql-error.js +2 -18
- package/dist/public-sql-error.js.map +1 -1
- package/dist/pull.d.ts +1 -0
- package/dist/pull.d.ts.map +1 -1
- package/dist/pull.js +13 -0
- package/dist/pull.js.map +1 -1
- package/package.json +1 -1
- package/skills/lark-base-database/SKILL.md +30 -12
- package/skills/lark-base-database/references/ai-function.md +12 -4
- package/skills/lark-base-database/references/base-capability-routing.md +4 -4
- package/skills/lark-base-database/references/base-sql-errors.generated.md +403 -0
- package/skills/lark-base-database/references/database-function-limitations.md +20 -37
- package/skills/lark-base-database/references/database-function.md +14 -40
- package/skills/lark-base-database/references/development.md +2 -2
- package/skills/lark-base-database/references/faas.md +6 -6
- package/skills/lark-base-database/references/file-transfer.md +1 -1
- package/skills/lark-base-database/references/frontend-design-guide.md +163 -33
- package/skills/lark-base-database/references/notifications.md +9 -9
- package/skills/lark-base-database/references/release.md +10 -10
- package/skills/lark-base-database/references/style-guide.md +2 -2
- package/skills/lark-base-database/references/verification.md +6 -4
- package/skills/lark-base-database/references/workspace.md +15 -13
- package/templates/database-starter/gitignore +7 -0
- package/templates/database-starter/page/package-lock.json +4 -4
- package/templates/database-starter/page/package.json +1 -1
- package/templates/database-starter/page/src/components/floating-button/assets/toast-close.svg +3 -0
- package/templates/database-starter/page/src/components/floating-button/assets/toast-info.svg +5 -0
- package/templates/database-starter/page/src/components/floating-button/assets/tooltip-caret.svg +3 -0
- package/templates/database-starter/page/src/components/floating-button/index.tsx +122 -5
- package/skills/lark-base-database/references/design/components/actions-fields.md +0 -16
- package/skills/lark-base-database/references/design/components/code/controls.css +0 -122
- package/skills/lark-base-database/references/design/components/code/controls.tsx +0 -73
- package/skills/lark-base-database/references/design/components/code/date-picker.tsx +0 -42
- package/skills/lark-base-database/references/design/components/code/floating.tsx +0 -41
- package/skills/lark-base-database/references/design/components/code/overlays.tsx +0 -19
- package/skills/lark-base-database/references/design/components/code/select.tsx +0 -34
- package/skills/lark-base-database/references/design/components/code/styles.d.ts +0 -1
- package/skills/lark-base-database/references/design/components/code/theme.css +0 -49
- package/skills/lark-base-database/references/design/components/code/usage.tsx +0 -38
- package/skills/lark-base-database/references/design/components/date-time-number.md +0 -9
- package/skills/lark-base-database/references/design/components/feedback-navigation.md +0 -9
- package/skills/lark-base-database/references/design/components/index.md +0 -18
- package/skills/lark-base-database/references/design/components/overlays.md +0 -9
- package/skills/lark-base-database/references/design/components/patterns/flat-business.md +0 -7
- package/skills/lark-base-database/references/design/components/selection.md +0 -24
- package/skills/lark-base-database/references/design/components.md +0 -91
- package/skills/lark-base-database/references/design/composition.md +0 -90
- package/skills/lark-base-database/references/design/control-recipes.md +0 -107
- package/skills/lark-base-database/references/design/examples.md +0 -172
- package/skills/lark-base-database/references/design/foundations.md +0 -126
- package/skills/lark-base-database/references/design/review.md +0 -82
- package/skills/lark-base-database/references/design/scenes/analysis-report.md +0 -66
- package/skills/lark-base-database/references/design/scenes/brand-showcase.md +0 -70
- package/skills/lark-base-database/references/design/scenes/business-operations.md +0 -85
- package/skills/lark-base-database/references/design/scenes/campaign-report.md +0 -66
- package/skills/lark-base-database/references/design/scenes/dashboard.md +0 -77
- package/skills/lark-base-database/references/design/scenes/festive-campaign.md +0 -69
- package/skills/lark-base-database/references/design/theme.md +0 -27
- package/skills/lark-base-database/references/design/typography.md +0 -56
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
<!-- Generated by errorcatalog-gen; do not edit. -->
|
|
2
|
+
# Unsupported SQL and alternatives
|
|
3
|
+
|
|
4
|
+
Use names and types from catalog.json. Refresh the Catalog when the schema changes. Follow every precondition below; a guard intentionally changes error behavior. Outside-SQL policies use the following guidance: Compute it in the code that consumes the query result (in Base Site: a Page or an Edge Function).
|
|
5
|
+
|
|
6
|
+
## Verified SQL forms
|
|
7
|
+
|
|
8
|
+
### Division with a zero divisor
|
|
9
|
+
|
|
10
|
+
Use NULLIF(divisor, 0) as the divisor if a NULL result is acceptable.
|
|
11
|
+
|
|
12
|
+
Preconditions: The caller accepts NULL instead of a division-by-zero error.
|
|
13
|
+
|
|
14
|
+
Validation kind: `guard`. Error code: `SQL_DIVISION_BY_ZERO`.
|
|
15
|
+
|
|
16
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
17
|
+
|
|
18
|
+
```sql
|
|
19
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, 1::bigint / NULLIF(0::bigint, 0::bigint) AS value FROM source ORDER BY id;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Division with a nonzero divisor
|
|
23
|
+
|
|
24
|
+
Use NULLIF(divisor, 0) as the divisor if a NULL result is acceptable.
|
|
25
|
+
|
|
26
|
+
Preconditions: For a nonzero divisor the value must be unchanged.
|
|
27
|
+
|
|
28
|
+
Validation kind: `guard`. Error code: `SQL_DIVISION_BY_ZERO`.
|
|
29
|
+
|
|
30
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
31
|
+
|
|
32
|
+
```sql
|
|
33
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, 7::bigint / NULLIF(2::bigint, 0::bigint) AS value FROM source ORDER BY id;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Filter a window output in a subquery
|
|
37
|
+
|
|
38
|
+
Compute the window in a SELECT subquery, then refer to its output.
|
|
39
|
+
|
|
40
|
+
Preconditions: Move the window output into a subquery before filtering; this corrects an invalid window context.
|
|
41
|
+
|
|
42
|
+
Validation kind: `author`. Error code: `SQL_WINDOW_NOT_ALLOWED`.
|
|
43
|
+
|
|
44
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders), ranked AS (SELECT id, ROW_NUMBER() OVER (ORDER BY sort_key, id) AS rn FROM source) SELECT id FROM ranked WHERE rn = 1 ORDER BY id;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Use the PostgreSQL TO_CHAR spelling
|
|
51
|
+
|
|
52
|
+
Use the stated public SQL function and its documented signature.
|
|
53
|
+
|
|
54
|
+
Preconditions: Choose the intended PostgreSQL format; this example uses the full date and time format.
|
|
55
|
+
|
|
56
|
+
Validation kind: `author`. Error code: `SQL_UNSUPPORTED_SYNTAX`.
|
|
57
|
+
|
|
58
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
59
|
+
|
|
60
|
+
```sql
|
|
61
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, TO_CHAR(TIMESTAMP '2026-09-26 12:34:56', 'YYYY-MM-DD HH24:MI:SS') AS value FROM source ORDER BY id;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Give NULL an explicit public type
|
|
65
|
+
|
|
66
|
+
Use an explicit CAST with the intended public SQL type.
|
|
67
|
+
|
|
68
|
+
Preconditions: Choose the intended public type; the example chooses TEXT.
|
|
69
|
+
|
|
70
|
+
Validation kind: `author`. Error code: `SQL_UNTYPED_NULL`.
|
|
71
|
+
|
|
72
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
73
|
+
|
|
74
|
+
```sql
|
|
75
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, CAST(NULL AS TEXT) AS value FROM source ORDER BY id;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Correlated max join
|
|
79
|
+
|
|
80
|
+
For an equality comparison to a grouped MAX, aggregate by the correlation key in a subquery and JOIN that result. Preserve NULL and empty-group behavior. Other correlated forms have no verified SQL rewrite.
|
|
81
|
+
|
|
82
|
+
Preconditions: Equality to a correlated MAX grouped by the correlation key; preserve NULL keys and empty groups.
|
|
83
|
+
|
|
84
|
+
Validation kind: `equivalent`. Error code: `SQL_UNSUPPORTED_SYNTAX`.
|
|
85
|
+
|
|
86
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
87
|
+
|
|
88
|
+
```sql
|
|
89
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT s.id, s.value FROM source s JOIN (SELECT group_key AS k, MAX(value) AS m FROM source GROUP BY group_key) g ON s.group_key = g.k WHERE s.value = g.m ORDER BY s.id;
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Octet length bytes
|
|
93
|
+
|
|
94
|
+
STRLEN is not supported. For byte counts, use OCTET_LENGTH(text). Byte counts and character counts can differ; character counting has no verified SQL equivalent.
|
|
95
|
+
|
|
96
|
+
Preconditions: The intent is byte count, not character count. The fixture includes non-ASCII text and NULL values.
|
|
97
|
+
|
|
98
|
+
Validation kind: `equivalent`. Error code: `SQL_FUNCTION_NOT_FOUND`.
|
|
99
|
+
|
|
100
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
101
|
+
|
|
102
|
+
```sql
|
|
103
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, OCTET_LENGTH(text_value) AS value FROM source ORDER BY id;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Array scalar containment
|
|
107
|
+
|
|
108
|
+
Both operands must be arrays of compatible element types. For single-value containment, wrap the scalar in a one-element array.
|
|
109
|
+
|
|
110
|
+
Preconditions: Single-value array containment is intended; include NULL input and unmatched elements.
|
|
111
|
+
|
|
112
|
+
Validation kind: `equivalent`. Error code: `SQL_OPERATOR_TYPE_MISMATCH`.
|
|
113
|
+
|
|
114
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
115
|
+
|
|
116
|
+
```sql
|
|
117
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, ARRAY[group_key] <@ ARRAY['g1','g2'] AS value FROM source ORDER BY id;
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Array scalar contains
|
|
121
|
+
|
|
122
|
+
Both operands must be arrays of compatible element types. For single-value containment, wrap the scalar in a one-element array.
|
|
123
|
+
|
|
124
|
+
Preconditions: Single-value array containment is intended; include NULL input and unmatched elements.
|
|
125
|
+
|
|
126
|
+
Validation kind: `equivalent`. Error code: `SQL_OPERATOR_TYPE_MISMATCH`.
|
|
127
|
+
|
|
128
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
129
|
+
|
|
130
|
+
```sql
|
|
131
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, ARRAY['g1','g2'] @> ARRAY[group_key] AS value FROM source ORDER BY id;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Numeric predicate
|
|
135
|
+
|
|
136
|
+
Use a BOOL condition. If the intent is to exclude zero, compare the numeric expression with zero; NULL rows will not match.
|
|
137
|
+
|
|
138
|
+
Preconditions: The explicitly selected intent is to exclude numeric zero and NULL.
|
|
139
|
+
|
|
140
|
+
Validation kind: `author`. Error code: `SQL_WHERE_TYPE_MISMATCH`.
|
|
141
|
+
|
|
142
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
143
|
+
|
|
144
|
+
```sql
|
|
145
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id FROM source WHERE value <> 0 ORDER BY id;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Text predicate
|
|
149
|
+
|
|
150
|
+
Use a BOOL condition. If the intent is to exclude empty text, compare the text expression with an empty string; NULL rows will not match.
|
|
151
|
+
|
|
152
|
+
Preconditions: The explicitly selected intent is to exclude empty text and NULL.
|
|
153
|
+
|
|
154
|
+
Validation kind: `author`. Error code: `SQL_WHERE_TYPE_MISMATCH`.
|
|
155
|
+
|
|
156
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
157
|
+
|
|
158
|
+
```sql
|
|
159
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id FROM source WHERE text_value <> '' ORDER BY id;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Remainder nullif
|
|
163
|
+
|
|
164
|
+
Use NULLIF(divisor, 0) as the remainder divisor if a NULL result is acceptable.
|
|
165
|
+
|
|
166
|
+
Preconditions: Returning NULL instead of an error for a zero remainder divisor is acceptable.
|
|
167
|
+
|
|
168
|
+
Validation kind: `guard`. Error code: `SQL_DIVISION_BY_ZERO`.
|
|
169
|
+
|
|
170
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
171
|
+
|
|
172
|
+
```sql
|
|
173
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, CAST(sort_key AS BIGINT) % NULLIF(CAST(0 AS BIGINT), CAST(0 AS BIGINT)) AS value FROM source ORDER BY id;
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Remainder nullif nonzero
|
|
177
|
+
|
|
178
|
+
Use NULLIF(divisor, 0) as the remainder divisor if a NULL result is acceptable.
|
|
179
|
+
|
|
180
|
+
Preconditions: Integer-valued sort keys; verify that the guard preserves a nonzero divisor.
|
|
181
|
+
|
|
182
|
+
Validation kind: `guard`. Error code: `SQL_DIVISION_BY_ZERO`.
|
|
183
|
+
|
|
184
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
185
|
+
|
|
186
|
+
```sql
|
|
187
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT id, CAST(sort_key AS BIGINT) % NULLIF(CAST(2 AS BIGINT), CAST(0 AS BIGINT)) AS value FROM source ORDER BY id;
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Cast int format
|
|
191
|
+
|
|
192
|
+
Use an optional sign and decimal digits for INT input, for example '123'. Supply the intended value; do not substitute the example.
|
|
193
|
+
|
|
194
|
+
Preconditions: The caller explicitly supplies the value 123; this example must not replace an unknown intended value.
|
|
195
|
+
|
|
196
|
+
Validation kind: `author`. Error code: `SQL_INVALID_CAST`.
|
|
197
|
+
|
|
198
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
199
|
+
|
|
200
|
+
```sql
|
|
201
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT CAST('123' AS INT) AS value FROM source LIMIT 1;
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Cast double format
|
|
205
|
+
|
|
206
|
+
Use a finite decimal number for DOUBLE input, for example '1.25'. Supply the intended value; do not substitute the example.
|
|
207
|
+
|
|
208
|
+
Preconditions: The caller explicitly supplies the finite decimal value 1.25.
|
|
209
|
+
|
|
210
|
+
Validation kind: `author`. Error code: `SQL_INVALID_CAST`.
|
|
211
|
+
|
|
212
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
213
|
+
|
|
214
|
+
```sql
|
|
215
|
+
WITH source AS (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) SELECT CAST('1.25' AS DOUBLE PRECISION) AS value FROM source LIMIT 1;
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Materialize option names before array construction
|
|
219
|
+
|
|
220
|
+
Compute OPTION.name in a derived table first, then construct ARRAY from that projected column. Preserve the original joins, filters, and NULL behavior.
|
|
221
|
+
|
|
222
|
+
Preconditions: Project OPTION.name before constructing the array. This case preserves an INNER JOIN with condition TRUE, NULL values, duplicates and row count; retain other original predicates.
|
|
223
|
+
|
|
224
|
+
Validation kind: `equivalent`. Error code: `SQL_UNSUPPORTED_SYNTAX`.
|
|
225
|
+
|
|
226
|
+
The example uses an `orders` table with `group_key`, `sort_key`, `value`, and `text_value` columns. Replace these with exact Catalog names.
|
|
227
|
+
|
|
228
|
+
```sql
|
|
229
|
+
SELECT q.id, v AS value FROM (SELECT rec_id AS id, group_key, sort_key, value, text_value FROM orders) q CROSS JOIN UNNEST(ARRAY[q.text_value]) v ORDER BY q.id;
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Unsupported diagnostics
|
|
233
|
+
|
|
234
|
+
Placeholders denote the names and types reported in the error. Use the concrete restriction reported in the error; placeholders do not declare every possible value unsupported.
|
|
235
|
+
|
|
236
|
+
| Code / variant | Reason | Repair |
|
|
237
|
+
|---|---|---|
|
|
238
|
+
| `SQL_CAST_TYPE_MISMATCH` / `unsupported_conversion` | Conversion from {SourceType} to {TargetType} is not supported. | Choose a column or parameter already having the required type. An equivalent conversion has not been verified. [outside_sql] |
|
|
239
|
+
| `SQL_FUNCTION_NOT_FOUND` / `known_unavailable` | Function {Function} is not supported. | {Alternative} [outside_sql] |
|
|
240
|
+
| `SQL_FUNCTION_NOT_FOUND` / `unsupported_function` | Function {Function} is not supported. | [outside_sql] |
|
|
241
|
+
| `SQL_INTERVAL_LITERAL_CALENDAR_UNIT_NOT_SUPPORTED` / `interval_calendar_unit` | Calendar interval unit {Unit} is not supported. | A fixed day count is not equivalent. [outside_sql] |
|
|
242
|
+
| `SQL_INTERVAL_LITERAL_FRACTIONAL_MILLISECONDS` / `interval_precision` | The interval must be an exact whole number of milliseconds. | Whole milliseconds are supported; higher precision cannot be preserved by rounding. [outside_sql] |
|
|
243
|
+
| `SQL_INTERVAL_LITERAL_UNIT_NOT_SUPPORTED` / `interval_unit` | Interval unit {Unit} is not supported. | Use day, hour, minute, second, or millisecond units. |
|
|
244
|
+
| `SQL_UNSUPPORTED_COLUMN_TYPE` / `column_representation` | Column {Column} has type {BaseType}; {Representation}. | A supported column is required for an equivalent SQL operation. [outside_sql] |
|
|
245
|
+
| `SQL_UNSUPPORTED_OPERATOR` / `unavailable_operation` | This {Operation} is not supported. | [outside_sql] |
|
|
246
|
+
| `SQL_UNSUPPORTED_OPERATOR` / `unsupported_field_operator` | Column {Column} has type {ActualType}, which does not support {Operator}. | [outside_sql] |
|
|
247
|
+
| `SQL_UNSUPPORTED_OPERATOR` / `unsupported_operator` | Operator {Operator} is not supported for {ArgTypes}. | [outside_sql] |
|
|
248
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `aggregate_modifier` | Aggregate {Function} does not support {Modifier}. | [outside_sql] |
|
|
249
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `aggregate_separator` | The separator of {Function} must be {Requirement}. | [outside_sql] |
|
|
250
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `array_dimension` | ARRAY_LENGTH dimension must be {Form}. | Changing the dimension can change the result. [outside_sql] |
|
|
251
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `array_subquery_shape` | This ARRAY subquery shape is not supported. | Only a direct single-column UNNEST projection is supported here. [outside_sql] |
|
|
252
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `binary_operator` | Unsupported binary operator: {Operator}. | [outside_sql] |
|
|
253
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `capability_budget` | The supported limit was exceeded: {Dimension}. | Reduce this query dimension or split the operation into separate queries. |
|
|
254
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `correlated_exists` | Correlated EXISTS does not support {Predicate}. | Only supported equality correlations can be expressed in SQL. [outside_sql] |
|
|
255
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `correlated_option_array` | Correlated OPTION.name expressions inside ARRAY require a materialized input. | Compute OPTION.name in a derived table first, then construct ARRAY from that projected column. Preserve the original joins, filters, and NULL behavior. |
|
|
256
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `date_trunc_context` | DATE_TRUNC output cannot be used in {Context}. | [outside_sql] |
|
|
257
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `date_trunc_unit` | DATE_TRUNC unit {Part} is not supported because it cannot preserve timestamp identity. | [outside_sql] |
|
|
258
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `function_input_types` | Function {Function} requires TEXT arguments; received {ArgTypes}. | Use TEXT inputs for this function. |
|
|
259
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `identity_operation` | Unsupported operation: {Constraint}. | Compare identities of the same kind or use separate TEXT parameters; do not transform identity values. |
|
|
260
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `identity_output` | Output {Output} combines identities with incompatible values. | Keep USER identities, CHAT identities, and plain text in separate outputs. |
|
|
261
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `identity_parameter` | Parameter {Parameter} violates this constraint: {Constraint}. | Use separate TEXT parameters for each identity namespace and for plain text. |
|
|
262
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `location_coordinate` | LOCATION member {Member} is not supported. | An address or complete object is not an equivalent result. [outside_sql] |
|
|
263
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `named_window_reference` | Window definition {Window} is missing or duplicated. | Use a unique WINDOW definition and reference its declared name. |
|
|
264
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `nested_cte` | A nested CTE is not supported in {Context}. | [outside_sql] |
|
|
265
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `null_ordering` | Explicit NULLS ordering requires {Constraint}. | [outside_sql] |
|
|
266
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `option_member_context` | OPTION[].name cannot be used in {Context}. | An equivalent SQL rewrite preserving row multiplicity has not been verified. [outside_sql] |
|
|
267
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `protocol_shape` | Invalid compiled structure: {Shape} is not supported. | Recompile the query using the current supported contract. |
|
|
268
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `route_table_required` | The query must reference a table for execution routing. | Adding an arbitrary table can change row count. [outside_sql] |
|
|
269
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `subquery_constraint` | {Construct} requires {Constraint}. | The subquery must satisfy the stated constraint for a supported SQL rewrite. [outside_sql] |
|
|
270
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `syntax_feature` | SQL feature {Feature} is not supported. | [outside_sql] |
|
|
271
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `syntax_restriction` | {Restriction}. | [outside_sql] |
|
|
272
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `type_representation` | The query cannot represent type {ActualType}. | [outside_sql] |
|
|
273
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `unary_operator` | Unsupported unary operator: {Operator}. | [outside_sql] |
|
|
274
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `unavailable_function_syntax` | Function {Function} is not supported. | [outside_sql] |
|
|
275
|
+
| `SQL_UNSUPPORTED_SYNTAX` / `window_capability` | Window function {Function} requires {Requirement}. | [outside_sql] |
|
|
276
|
+
| `SQL_UNSUPPORTED_SYNTAX_DISTINCT_FROM` / `distinct_comparison` | IS DISTINCT FROM and IS NOT DISTINCT FROM are not supported. | [outside_sql] |
|
|
277
|
+
| `SQL_UNSUPPORTED_SYNTAX_EXCEPT` / `except_set` | EXCEPT {Quantifier} is not supported. | Duplicate and NULL behavior must be preserved. [outside_sql] |
|
|
278
|
+
| `SQL_UNSUPPORTED_SYNTAX_INTERSECT` / `intersect_set` | INTERSECT {Quantifier} is not supported. | Duplicate and NULL behavior must be preserved. [outside_sql] |
|
|
279
|
+
| `SQL_UNSUPPORTED_SYNTAX_LAG_LEAD` / `lag_lead_argument` | Argument {Argument} of {Function} has an unsupported form; expected {Form}. | Argument {Argument} requires {Form}. [outside_sql] |
|
|
280
|
+
| `SQL_UNSUPPORTED_SYNTAX_LATERAL` / `lateral_correlation` | LATERAL with {Correlation} is not supported. | [outside_sql] |
|
|
281
|
+
| `SQL_UNSUPPORTED_SYNTAX_NULL_IN_LIST` / `null_in_list` | An explicit NULL element in an IN or NOT IN list is not supported. | Removing NULL can change the result. [outside_sql] |
|
|
282
|
+
| `SQL_UNSUPPORTED_SYNTAX_RECURSIVE_CTE` / `recursive_cte` | Recursive CTE {CTE} is not supported. | [outside_sql] |
|
|
283
|
+
| `SQL_UNSUPPORTED_SYNTAX_REGEXP_REPLACE` / `regexp_replacement` | The requested replacement mode is not supported: {Mode}. | [outside_sql] |
|
|
284
|
+
| `SQL_UNSUPPORTED_SYNTAX_WINDOW_FRAME` / `window_frame` | The window specification is not supported: {Frame}. | Changing the frame can change the result. [outside_sql] |
|
|
285
|
+
|
|
286
|
+
## Syntax restriction repair policies
|
|
287
|
+
|
|
288
|
+
| Restriction | Policy | Reason | Repair |
|
|
289
|
+
|---|---|---|---|
|
|
290
|
+
| `AggregateCallForm` | `outside_sql` | This aggregate FILTER, ORDER BY, WITHIN GROUP, or variadic call form is not supported | [outside_sql] |
|
|
291
|
+
| `AggregateFilter` | `outside_sql` | FILTER requires an aggregate function | [outside_sql] |
|
|
292
|
+
| `AnyKeyType` | `outside_sql` | Expanded ANY arrays require numeric or TEXT operands | [outside_sql] |
|
|
293
|
+
| `ArrayConstructor` | `outside_sql` | This ANY operand requires an ARRAY constructor | [outside_sql] |
|
|
294
|
+
| `ArrayDimension` | `outside_sql` | ARRAY_LENGTH requires literal 1 as the dimension | [outside_sql] |
|
|
295
|
+
| `ArrayLengthArity` | `outside_sql` | Use ARRAY_LENGTH(array, 1) or CARDINALITY(array) | [outside_sql] |
|
|
296
|
+
| `ArraySubquery` | `outside_sql` | ANY array operands and elements cannot contain subqueries | [outside_sql] |
|
|
297
|
+
| `ArrayTypeModifier` | `outside_sql` | An empty ANY array requires an unmodified supported scalar array type | [outside_sql] |
|
|
298
|
+
| `BetweenBounds` | `outside_sql` | BETWEEN requires two bounds | [outside_sql] |
|
|
299
|
+
| `BooleanOperands` | `outside_sql` | A boolean expression requires operands | [outside_sql] |
|
|
300
|
+
| `BooleanOperator` | `outside_sql` | This boolean operator is not supported | [outside_sql] |
|
|
301
|
+
| `CTESearchCycle` | `outside_sql` | CTE SEARCH and CYCLE are not supported | [outside_sql] |
|
|
302
|
+
| `CaseBranch` | `outside_sql` | A CASE WHEN branch is invalid | [outside_sql] |
|
|
303
|
+
| `CastModifier` | `outside_sql` | Cast targets with modifiers or explicit array bounds are not supported | [outside_sql] |
|
|
304
|
+
| `CastTargetMissing` | `outside_sql` | CAST requires a target type | [outside_sql] |
|
|
305
|
+
| `CastValueMissing` | `outside_sql` | CAST requires a value | [outside_sql] |
|
|
306
|
+
| `ColumnAlias` | `outside_sql` | Column aliases must be non-empty identifiers | [outside_sql] |
|
|
307
|
+
| `ColumnQualification` | `outside_sql` | A column reference may have at most a table alias and a column name; use (column).field for object members | [outside_sql] |
|
|
308
|
+
| `ColumnReference` | `outside_sql` | This column reference form is not supported | [outside_sql] |
|
|
309
|
+
| `ConstantMembership` | `outside_sql` | Constant membership requires literal SELECT or UNION leaves and literal boolean filters, without ordering or pagination | [outside_sql] |
|
|
310
|
+
| `ConstantMembershipKey` | `outside_sql` | This constant membership key has no supported equivalent rewrite | [outside_sql] |
|
|
311
|
+
| `CorrelatedMembership` | `outside_sql` | Correlated membership requires equality column predicates between one inner source and current outer sources | [outside_sql] |
|
|
312
|
+
| `CorrelatedScalar` | `conditional_pattern` | Correlated scalar subqueries are not supported; aggregate the inner source and JOIN the grouped result | For an equality comparison to a grouped MAX, aggregate by the correlation key in a subquery and JOIN that result. Preserve NULL and empty-group behavior. Other correlated forms have no verified SQL rewrite. |
|
|
313
|
+
| `CurrentDate` | `outside_sql` | CURRENT_DATE is not supported; use a TIMESTAMP value or CURRENT_TIMESTAMP when equivalent | [outside_sql] |
|
|
314
|
+
| `DistinctGrouping` | `outside_sql` | GROUP BY DISTINCT grouping sets require one source, unambiguous field keys, and an aggregate for the empty grouping set | [outside_sql] |
|
|
315
|
+
| `DistinctOnNullOrdering` | `outside_sql` | DISTINCT ON with explicit NULLS ordering is not supported | [outside_sql] |
|
|
316
|
+
| `DistinctOnPrefix` | `outside_sql` | DISTINCT ON expressions must match the leftmost ORDER BY expressions | [outside_sql] |
|
|
317
|
+
| `DistinctWithGroupingSets` | `outside_sql` | SELECT DISTINCT with GROUPING SETS is not supported | [outside_sql] |
|
|
318
|
+
| `EmptyProjection` | `outside_sql` | SELECT must produce at least one column | [outside_sql] |
|
|
319
|
+
| `EqualityAny` | `outside_sql` | Array ANY supports equality comparisons only | [outside_sql] |
|
|
320
|
+
| `ExpressionForm` | `outside_sql` | This expression form is not supported | [outside_sql] |
|
|
321
|
+
| `ExpressionList` | `outside_sql` | An expression list cannot be empty | [outside_sql] |
|
|
322
|
+
| `ExpressionOperator` | `outside_sql` | This expression operator is not supported | [outside_sql] |
|
|
323
|
+
| `ExtractForm` | `outside_sql` | Use EXTRACT(field FROM expression) | [outside_sql] |
|
|
324
|
+
| `ExtremaOperator` | `outside_sql` | This LEAST or GREATEST operation is not supported | [outside_sql] |
|
|
325
|
+
| `FromFunction` | `outside_sql` | FROM table functions require exactly one UNNEST call | [outside_sql] |
|
|
326
|
+
| `FromItem` | `outside_sql` | This FROM item is not supported | [outside_sql] |
|
|
327
|
+
| `FullJoinUsing` | `outside_sql` | FULL JOIN USING is not supported; use FULL JOIN ON and project COALESCE(left_key, right_key) | [outside_sql] |
|
|
328
|
+
| `FullPartitionFrame` | `outside_sql` | LAST_VALUE requires an explicit full-partition frame | [outside_sql] |
|
|
329
|
+
| `FunctionQualification` | `outside_sql` | Schema-qualified function names are not supported | [outside_sql] |
|
|
330
|
+
| `GroupingField` | `outside_sql` | Grouping-set keys must be direct field references | [outside_sql] |
|
|
331
|
+
| `GroupingKeyType` | `outside_sql` | DISTINCT grouping-set keys must be TEXT or DOUBLE fields | [outside_sql] |
|
|
332
|
+
| `HavingAggregateMath` | `outside_sql` | Math over aggregates in HAVING requires a grouped subquery; compute the aggregate then filter its output with WHERE | [outside_sql] |
|
|
333
|
+
| `HavingRewrite` | `outside_sql` | This HAVING expression has no supported equivalent subquery rewrite | [outside_sql] |
|
|
334
|
+
| `HavingSubquery` | `outside_sql` | HAVING subqueries require ordinary GROUP BY, no CTE or window, and output-name or ordinal ordering | [outside_sql] |
|
|
335
|
+
| `JoinAliases` | `outside_sql` | JOIN aliases, NATURAL JOIN, and JOIN USING aliases are not supported | [outside_sql] |
|
|
336
|
+
| `JoinKind` | `outside_sql` | Only INNER, LEFT, RIGHT, FULL, and CROSS JOIN are supported | [outside_sql] |
|
|
337
|
+
| `JoinMembership` | `outside_sql` | JOIN membership requires inner-only joins or a two-source LEFT JOIN with qualified side-local predicates | [outside_sql] |
|
|
338
|
+
| `JoinNesting` | `outside_sql` | Right-nested or aliased JOIN groups are not supported | [outside_sql] |
|
|
339
|
+
| `JoinUsingName` | `outside_sql` | JOIN USING requires valid column names | [outside_sql] |
|
|
340
|
+
| `LiteralKind` | `outside_sql` | This literal form is not supported | [outside_sql] |
|
|
341
|
+
| `MembershipArity` | `outside_sql` | A scalar membership expression requires one operand | [outside_sql] |
|
|
342
|
+
| `MembershipCTE` | `outside_sql` | Membership CTEs must be nonrecursive and have no column alias list or nested expression subquery | [outside_sql] |
|
|
343
|
+
| `MembershipComparison` | `outside_sql` | Subquery membership supports IN and equality ANY only | [outside_sql] |
|
|
344
|
+
| `MembershipKeyType` | `outside_sql` | Membership keys must be numeric or TEXT | [outside_sql] |
|
|
345
|
+
| `MembershipOperand` | `outside_sql` | A membership operand must be a column, literal, or parameter | [outside_sql] |
|
|
346
|
+
| `MembershipSource` | `outside_sql` | This membership source requires a FROM relation | [outside_sql] |
|
|
347
|
+
| `MixedOuterJoin` | `outside_sql` | RIGHT or FULL JOIN cannot be mixed with comma-separated FROM groups; use one explicit JOIN chain | [outside_sql] |
|
|
348
|
+
| `NestedMembership` | `outside_sql` | A membership operand cannot contain nested subqueries | [outside_sql] |
|
|
349
|
+
| `NestedScalar` | `outside_sql` | Nested scalar subquery operands are not supported | [outside_sql] |
|
|
350
|
+
| `NotArity` | `outside_sql` | NOT requires one operand | [outside_sql] |
|
|
351
|
+
| `NthValueArity` | `outside_sql` | NTH_VALUE requires two arguments | [outside_sql] |
|
|
352
|
+
| `NthValueShape` | `outside_sql` | NTH_VALUE requires a direct projection over one table, a positive literal index, numeric or TEXT values, and stable ordering including rec_id | [outside_sql] |
|
|
353
|
+
| `ObjectMember` | `outside_sql` | Object member access requires exactly one field in the form (expression).field | [outside_sql] |
|
|
354
|
+
| `ObjectSubscript` | `outside_sql` | Array subscripts and empty object member names are not supported | [outside_sql] |
|
|
355
|
+
| `OperatorMissing` | `outside_sql` | An operator name is required | [outside_sql] |
|
|
356
|
+
| `OrderItem` | `outside_sql` | This ORDER BY item is not supported | [outside_sql] |
|
|
357
|
+
| `OrderUsing` | `outside_sql` | ORDER BY USING is not supported | [outside_sql] |
|
|
358
|
+
| `RecursiveShape` | `outside_sql` | A recursive CTE requires UNION or UNION ALL between its anchor and recursive term | [outside_sql] |
|
|
359
|
+
| `RowKeyType` | `outside_sql` | Row IN requires TEXT or DOUBLE keys; NOT IN also requires non-null keys on both sides | [outside_sql] |
|
|
360
|
+
| `RowLock` | `outside_sql` | SELECT row locking is not supported | [outside_sql] |
|
|
361
|
+
| `RowMembership` | `outside_sql` | Row membership requires an uncorrelated simple source and a top-level WHERE conjunct; nullable row NOT IN is not supported | [outside_sql] |
|
|
362
|
+
| `ScalarAggregateOperand` | `outside_sql` | Scalar subquery operands require a single uncorrelated COUNT, SUM, AVG, MIN, or MAX in a non-grouped context | [outside_sql] |
|
|
363
|
+
| `SelectClause` | `outside_sql` | This SELECT clause is not supported | [outside_sql] |
|
|
364
|
+
| `SelectOnly` | `outside_sql` | Only SELECT statements are supported | [outside_sql] |
|
|
365
|
+
| `SelectRelation` | `outside_sql` | A CTE or derived relation must contain SELECT | [outside_sql] |
|
|
366
|
+
| `SelectTarget` | `outside_sql` | This SELECT target is not supported | [outside_sql] |
|
|
367
|
+
| `SetBranches` | `outside_sql` | A set operation requires two SELECT branches | [outside_sql] |
|
|
368
|
+
| `SetOperation` | `outside_sql` | This set operation is not supported | [outside_sql] |
|
|
369
|
+
| `StarAlias` | `outside_sql` | A star projection cannot have an alias | [outside_sql] |
|
|
370
|
+
| `StarContext` | `outside_sql` | A star is only valid in SELECT projection | [outside_sql] |
|
|
371
|
+
| `StarJoinUsing` | `outside_sql` | SELECT * with JOIN USING requires explicit columns or a qualified alias.* | [outside_sql] |
|
|
372
|
+
| `StarQualification` | `outside_sql` | Use * or table_alias.* for a star projection | [outside_sql] |
|
|
373
|
+
| `StarUnnest` | `outside_sql` | Select the UNNEST alias explicitly instead of a star projection | [outside_sql] |
|
|
374
|
+
| `StringAggregationForm` | `outside_sql` | STRING_AGG requires a literal separator without DISTINCT, FILTER, or OVER | An equivalent SQL form preserving ordering, filtering, and duplicate behavior has not been verified. [outside_sql] |
|
|
375
|
+
| `StringAggregationSeparator` | `outside_sql` | STRING_AGG requires an ASCII separator without a zero byte | Replacing the requested separator would change the result. [outside_sql] |
|
|
376
|
+
| `SubqueryForm` | `outside_sql` | This subquery form is not supported | [outside_sql] |
|
|
377
|
+
| `SymmetricSubquery` | `outside_sql` | BETWEEN SYMMETRIC does not support subquery operands | [outside_sql] |
|
|
378
|
+
| `TableColumnAliases` | `outside_sql` | Table column alias lists are not supported | [outside_sql] |
|
|
379
|
+
| `TableQualification` | `outside_sql` | Schema-qualified table names are not supported | [outside_sql] |
|
|
380
|
+
| `TemporalLiteral` | `outside_sql` | Only TIMESTAMP and INTERVAL typed literals are supported | [outside_sql] |
|
|
381
|
+
| `TextPosition` | `outside_sql` | Character-based text position functions are not supported | [outside_sql] |
|
|
382
|
+
| `TrimCharacters` | `outside_sql` | TRIM with PostgreSQL character semantics is not supported | Changing the trim spelling does not enable this operation. [outside_sql] |
|
|
383
|
+
| `TypeName` | `outside_sql` | This type name is not supported | [outside_sql] |
|
|
384
|
+
| `UnnestArity` | `outside_sql` | UNNEST requires exactly one argument | [outside_sql] |
|
|
385
|
+
| `UnnestForm` | `outside_sql` | UNNEST WITH ORDINALITY, ROWS FROM, and column definitions are not supported | [outside_sql] |
|
|
386
|
+
| `ValueFunction` | `outside_sql` | This SQL value function is not supported | [outside_sql] |
|
|
387
|
+
| `ValueMemberKey` | `outside_sql` | Value membership requires TEXT or DOUBLE keys; computed INT keys are not supported | [outside_sql] |
|
|
388
|
+
| `ValueSubqueryType` | `outside_sql` | Value subqueries require scalar numeric or TEXT operands without outer aggregates or windows | [outside_sql] |
|
|
389
|
+
| `WindowInheritance` | `outside_sql` | A window cannot copy a frame or override inherited PARTITION BY or ORDER BY | [outside_sql] |
|
|
390
|
+
| `WindowName` | `outside_sql` | A WINDOW definition must have a name | [outside_sql] |
|
|
391
|
+
| `WithTies` | `outside_sql` | FETCH FIRST WITH TIES is not supported | [outside_sql] |
|
|
392
|
+
|
|
393
|
+
## Rewrites that must not be substituted
|
|
394
|
+
|
|
395
|
+
- `SQL_UNSUPPORTED_SYNTAX`: A SELECT subquery does not make the rejected comparison executable.
|
|
396
|
+
- `SQL_UNSUPPORTED_SYNTAX`: Changing dimension 2 to dimension 1 changes NULL into an array length. Changing the dimension can change the result.
|
|
397
|
+
- `SQL_UNSUPPORTED_SYNTAX`: Returning an object or address does not preserve a numeric coordinate. An address or complete object is not an equivalent result.
|
|
398
|
+
- `SQL_UNSUPPORTED_SYNTAX`: An unqualified UNNEST recommendation can change row multiplicity; no general equivalent is proved. An equivalent SQL rewrite preserving row multiplicity has not been verified.
|
|
399
|
+
- `SQL_UNSUPPORTED_SYNTAX`: Adding an arbitrary FROM relation changes row count, including on empty input. Adding an arbitrary table can change row count.
|
|
400
|
+
- `SQL_INVALID_CAST`: The formatted timestamp differs by eight hours between Base SQL execution and the PostgreSQL query; do not recommend this SQL as equivalent. Calendar fields and the intended timezone must be validated before conversion; no equivalent SQL format has been verified.
|
|
401
|
+
- `SQL_FUNCTION_NOT_FOUND`: Base SQL does not accept IS NOT DISTINCT FROM, which this rewrite needs to match NULL partition keys; no equivalent SQL rewrite has been verified. Preserve the first value under the intended ordering and NULL semantics.
|
|
402
|
+
- `SQL_FUNCTION_NOT_FOUND`: Base SQL does not accept IS NOT DISTINCT FROM, which this rewrite needs to match NULL partition keys; no equivalent SQL rewrite has been verified. Preserve the last value under the intended ordering and NULL semantics.
|
|
403
|
+
- `SQL_FUNCTION_NOT_FOUND`: Base SQL does not accept IS NOT DISTINCT FROM, which this rewrite needs to match NULL partition keys; no equivalent SQL rewrite has been verified. Preserve the requested position and return NULL for short partitions.
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Database Function 能力边界
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
在判断查询能力或处理编译与运行期错误时,以服务端诊断及[目录生成的错误与替代写法](base-sql-errors.generated.md)为事实源。这里保留参数协议和生成原则,不维护第二份函数或语法支持清单。
|
|
4
|
+
|
|
5
|
+
## 判断与默认路径
|
|
6
|
+
|
|
7
|
+
原则:先确认业务要保留的结果语义,再选择查询形式。判定时按诊断的位置、语义码和 Catalog 类型定位问题;默认采用生成参考中与当前条件匹配、已有验证的形式,并逐项核对其前提。
|
|
8
|
+
|
|
9
|
+
例外:目录没有等价 SQL、前提不成立或改写会改变空值、行数及排序时,转到[SQL 外实现放在哪](../SKILL.md#sql-外实现放在哪)选择消费结果的实现位置。单个组合失败不代表组成它的所有能力都不可用;版本或运行环境不一致时,保留诊断和 LogID,先核对事实源。
|
|
4
10
|
|
|
5
11
|
## Stored Query 与分页
|
|
6
12
|
|
|
@@ -8,39 +14,16 @@
|
|
|
8
14
|
- 不把 `OPTION`、`USER`、`CHAT`、`FILE`、`LOCATION`、`URL` 等对象类型声明为业务参数;参数只使用六种基础类型及其一维数组,允许的 null 位置以生成的 Schema 为准。
|
|
9
15
|
- 不通过移除服务端筛选、读取固定前 N 条后在 Page 分页来声称完整分页或全量导出。
|
|
10
16
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- `||`、`CONCAT` 两侧都必须是 `TEXT`,不会把数字隐式转为文本;`COALESCE`、`NULLIF`、集合运算只在 `INT` 与 `DOUBLE` 之间统一为 `DOUBLE`,其他类型要先写成同类型。
|
|
25
|
-
- 条件聚合:不要写 `SUM/AVG(CASE WHEN ... THEN 1 ELSE 0 END)`;改用 `SUM(CASE WHEN ... THEN 1.0 ELSE 0.0 END)`。
|
|
26
|
-
- `ILIKE`、`NOT ILIKE`:字段支持不统一,正常查询使用 `LIKE`、`NOT LIKE`。
|
|
27
|
-
- 相关标量子查询在 WHERE、投影、HAVING、ORDER BY 中均不支持;先在派生表按关联键 GROUP BY,再 JOIN 回外层(复杂组合应拆成两个 Database Function)。非相关子查询只使用已校验的形态,不将这一限制泛化为所有子查询都不可用。
|
|
28
|
-
- 子查询表达式:`EXISTS` 在投影、`ORDER BY`、`OR` / `CASE` 下的形态默认不生成;相关子查询的非等值关联(例如 `inner.t < outer.t`)。改用派生表 JOIN,或用单独 Database Function 查询后在 Page/FaaS 合并。`WHERE` 中的 `IN` / `NOT IN` / `EXISTS` 子查询和等值相关子查询可用。
|
|
29
|
-
- 聚合与窗口函数:`PERCENTILE_CONT` / `PERCENTILE_DISC`、`MEDIAN`、`WITHIN GROUP`、聚合内 `ORDER BY`;带 `ORDER BY` 的聚合窗口(逐行累计)、`CURRENT ROW` 或有界的窗口范围、未写整分区范围的 `LAST_VALUE`;`STDDEV` / `VARIANCE` 作为窗口函数。`STDDEV`、`VARIANCE` 作为普通聚合可用,`ROW_NUMBER`、`RANK` 等排名窗口可用。
|
|
30
|
-
- 字符串函数:`LENGTH`、`CHAR_LENGTH`、`LEFT`、`RIGHT`、`SUBSTRING`、`LPAD`、`RPAD`、`TRIM` / `LTRIM` / `RTRIM`、`SPLIT` / `SPLIT_PART`、`REGEXP` / `RLIKE` / `REGEXP_REPLACE`;`STRPOS` / `POSITION` 取具体位置(只能与 0 或 1 比较,用于判断是否包含)。`REPLACE` 可用。
|
|
31
|
-
- 数字函数:`POWER`、`SQRT`、`LOG`、`EXP`、`TRUNC`;`MOD` 的参数不是整数。
|
|
32
|
-
- 日期函数:`DATEDIFF`、`AGE`,以及其他未列入支持集的时间间隔函数;月、季、年单位的 `INTERVAL`;`EXTRACT` / `DATE_PART` 的 `dow`、`doy`、`week`、`quarter`;`DATE_PART('epoch', ts)`(改写为 `EXTRACT(EPOCH FROM ts)`);`DATE_TRUNC` 截到时、分、秒,以及 `DATE_TRUNC` 结果再参与比较、相减或 `EXTRACT`。
|
|
33
|
-
- `rec_id`、`TEXT`、Phone:顺序比较、`BETWEEN`、`NOT BETWEEN`。文本日期字符串不能用 `<`、`<=`、`>`、`>=` 做范围筛选;需要日期范围时把字段建成 DateTime/TIMESTAMP,或改用 Text 支持的 `=`、`IN`、`LIKE` 后在 Page/FaaS 中判断范围。
|
|
34
|
-
- Checkbox:`IN`、顺序比较、`BETWEEN`、`NOT BETWEEN`。
|
|
35
|
-
- DateTime:`IN`、`NOT IN`、`LIKE`、`ILIKE`。
|
|
36
|
-
- SingleSelect:与 TEXT、`.name` 或 `.id` 等成员标量之间的隐式比较,顺序比较、`BETWEEN`、`LIKE`、`ILIKE`,以及与 `''` 空字符串比较;动态选项名筛选显式使用 `.name` 和 `TEXT` 参数。
|
|
37
|
-
- MultiSelect:`LIKE`。
|
|
38
|
-
|
|
39
|
-
- 参数化数组成员判断仅支持 `TEXT表达式 = ANY($n)`,且 `$n` 声明为 `TEXT[]`。其他类型先用同类型标量参数展开为等值条件;不要用 `IN ($n)` 展开数组参数。
|
|
40
|
-
|
|
41
|
-
## 不要误判为整体不支持
|
|
42
|
-
|
|
43
|
-
- `LIKE $1` 本身可用,参数携带 `%`;复合查询失败时分别检查参数 kind 与错误节点,不因单条失败就判定参数化 `LIMIT/OFFSET` 不支持。
|
|
44
|
-
- OPTION 与同类型 OPTION 可以直接比较;与固定选项名或 `TEXT` 参数比较时必须显式访问 `.name` 或 `.id`。其他 UDT 同样不能和其成员标量隐式比较。
|
|
45
|
-
- 参数化 `LIMIT $n` / `OFFSET $n` 可用;页面输入不能直接决定返回规模,确需动态条数时由 Page/FaaS 先校验为非负整数并限制最大值。
|
|
46
|
-
- 支持集内的 `CASE`、`COALESCE`、`INNER JOIN`、`LEFT JOIN`、`CROSS JOIN`、非递归顶层 CTE、派生标量列、`FROM` 子查询、`WHERE` 中的 `IN` / `EXISTS` 子查询、逗号连接或 `CROSS JOIN` 形态的 `UNNEST`、`TIMESTAMP` 字面量、固定时长的 `INTERVAL`、`EXTRACT`、`TO_CHAR`、时间间隔运算、`ARRAY_AGG`、`STRING_AGG`、排名窗口、`CEIL` 和 `FLOOR` 可以使用;某个复合查询失败时先按错误节点缩小,不把这些能力整体降级。
|
|
17
|
+
## 查询生成边界
|
|
18
|
+
|
|
19
|
+
默认逐列投影,保持输出 Schema 稳定;连接的每一侧使用明确的表或带别名的派生表,分阶段表达复杂查询。常规生成优先简单连接、顶层查询与带别名的派生表,而不是依靠深层组合表达全部业务逻辑。确需复杂组合时,依据生成参考和目标环境验证决定,而不将生成偏好当作平台能力结论。
|
|
20
|
+
|
|
21
|
+
Database Function 需要 Catalog 中真实表依赖,以确定数据上下文;与 Base 数据无关的计算按[SQL 外实现放在哪](../SKILL.md#sql-外实现放在哪)处理。动态返回规模由调用方校验为非负整数并限制最大值;服务端资源预算以诊断中的实际限制为准。
|
|
22
|
+
|
|
23
|
+
## 按位置取值
|
|
24
|
+
|
|
25
|
+
先明确分区、排序、并列值与空分区的业务含义,再查[生成参考中的修复策略](base-sql-errors.generated.md)。默认只采用满足前提的已验证形式;没有等价形式时沿用[SQL 外实现选择原则](../SKILL.md#sql-外实现放在哪)。
|
|
26
|
+
|
|
27
|
+
## NULL 与数值边界
|
|
28
|
+
|
|
29
|
+
改写前明确空值、空集合、数值精度和错误行为是否属于结果契约。默认保留业务所需语义,并按[生成参考的前提与验证说明](base-sql-errors.generated.md)选择修法;防护写法会改变错误行为时,先确认业务接受该变化。需要 SQL 外处理的部分统一按[实现位置原则](../SKILL.md#sql-外实现放在哪)决定,不把截断结果或丢失空值的结果当作等价替代。
|
|
@@ -151,7 +151,7 @@ WHERE f."分组" = ANY($1)
|
|
|
151
151
|
LIMIT 30
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
对应参数声明为 `{"kind":"TEXT[]"}`,例如调用 `params: [["重点", "普通"]]
|
|
154
|
+
对应参数声明为 `{"kind":"TEXT[]"}`,例如调用 `params: [["重点", "普通"]]`。本例左侧为 `TEXT`,右侧为一维 `TEXT[]` 位置参数;其他形态按[生成参考](base-sql-errors.generated.md)判定。空数组不会选中记录。数组含 `null` 时不保证 PostgreSQL 三值语义,具体结果与预处理规则见[NULL 与数值边界](database-function-limitations.md#null-与数值边界)。成员判断与数组展开的区别及修法以[生成参考](base-sql-errors.generated.md)为准。
|
|
155
155
|
|
|
156
156
|
无参数 Function 可以省略 `meta` 或 `meta.params`;归档统一补成 `{"params":[]}`。
|
|
157
157
|
|
|
@@ -159,45 +159,20 @@ Database Function 的 `inputSchema` 由 CLI 根据参数顺序与 kind 生成固
|
|
|
159
159
|
|
|
160
160
|
## 查询约束
|
|
161
161
|
|
|
162
|
-
只编写只读 `SELECT
|
|
162
|
+
只编写只读 `SELECT`,页面输入只能进入位置参数。具体能力、拒绝条件与修法以[目录生成的错误与替代写法](base-sql-errors.generated.md)为准;生成原则见[能力边界](database-function-limitations.md#查询生成边界)。
|
|
163
163
|
|
|
164
164
|
- 每条查询的最终查询计划必须引用至少一个 Catalog 中的真实表,用于 Project 执行时选择可路由的表依赖。根 `FROM` 可以是带别名的 `FROM (SELECT ...) AS alias` 派生表,但该派生表或它依赖的 CTE 必须读取真实表。
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
- 连接使用 `INNER JOIN`、`LEFT JOIN`、`CROSS JOIN` 或逗号连接。每个 JOIN 的右侧保持为一个表或一个带别名的派生表;`UNNEST` 只能写成逗号连接或 `CROSS JOIN UNNEST(...)`,禁止生成 `LEFT JOIN UNNEST` 或 `INNER JOIN UNNEST`。不要把含 `GROUP BY`、`COUNT`、`SUM`、`AVG`、`MIN` 或 `MAX` 的聚合派生表再 `JOIN` 回主表。单条查询的 JOIN 总数不超过 10。
|
|
168
|
-
- 非递归顶层 CTE 可用;正常建站优先用带别名的 `FROM (SELECT ...) AS alias`,不要写递归 CTE 或嵌套 CTE。
|
|
169
|
-
- 子查询优先作为带别名的 `FROM` 派生表使用,外层通过派生表输出列名引用结果。成员判断可以直接写 `WHERE x IN (SELECT ...)`、`NOT IN`、`EXISTS`、`NOT EXISTS`;相关子查询只使用等值关联(`inner.k = outer.k`)。投影、`ORDER BY`、`OR` 或 `CASE` 之下的标量子查询和 `EXISTS` 默认不生成,需要时拆成派生表或单独查询。
|
|
165
|
+
- 默认逐列投影并使用 `AS snake_case`,保持输出 Schema 稳定;连接的每一侧保持为一个表或带别名的派生表。常规生成优先简单连接、顶层查询和带别名的派生表,复杂组合依据生成参考及验证结果决定。
|
|
166
|
+
- 子查询优先作为带别名的 `FROM` 派生表使用,外层通过输出列名引用结果。需要其他形态时先核对业务语义与生成参考,不把默认生成偏好当作支持清单。
|
|
170
167
|
- 列表使用有界 `LIMIT` 和稳定排序;排序值可能重复时最后按 `rec_id` 排序。不把截断结果的前端分页视为完整分页或全量导出。
|
|
171
|
-
- 返回字段逐列列出并使用 `AS snake_case`。
|
|
172
168
|
- 搜索写 `field LIKE $1`,由参数携带 `%`。
|
|
173
|
-
-
|
|
174
|
-
- UDT
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- 时间条件使用 Catalog 中确认为 `TIMESTAMP` 的字段和 `TIMESTAMP` 位置参数;当前时间使用 `CURRENT_TIMESTAMP`。查询结果固定为 Base 执行时区下的 `YYYY-MM-DD HH:mm:ss.SSS` 字符串。`EXTRACT(EPOCH FROM timestamp_expr)` 返回保留小数秒的 `DOUBLE`;明确只需整数秒时再写 `::bigint`。不要对 `TEXT` 日期字符串使用顺序比较;若业务必须做日期范围筛选,把 Base 字段建成 DateTime/TIMESTAMP。
|
|
181
|
-
- 时间格式化与分桶:按月、按天展示写 `TO_CHAR(ts, 'YYYY-MM')`,格式只使用 `YYYY`、`MM`、`DD`、`HH24`、`MI`、`SS` 及分隔符;按天、周、月、季、年分组也可写 `DATE_TRUNC('month', ts)`,其结果只用于投影、`GROUP BY`、`ORDER BY`,不再参与比较或运算。时间偏移使用固定时长的 `INTERVAL`(毫秒到周),不使用月、年单位;需要按自然月计算的范围由 Page/FaaS 算好边界后作为 `TIMESTAMP` 参数传入。`EXTRACT` / `DATE_PART` 返回 `DOUBLE`。
|
|
182
|
-
- 聚合函数使用 `COUNT(*)`、`COUNT(expr)`、`SUM(NUMBER)`、`AVG(NUMBER)`、`MIN(scalar)`、`MAX(scalar)`;`ARRAY_AGG(expr)` 可用但默认少生成。聚合结果需要回填到列表行时,拆成列表查询、聚合查询和必要的明细查询,在 Page/FaaS 按稳定业务键合并。
|
|
183
|
-
- 条件计数、通过率等聚合写 `SUM(CASE WHEN cond THEN 1.0 ELSE 0.0 END)`;不要生成 `SUM/AVG(CASE WHEN cond THEN 1 ELSE 0 END)`。行数统计用 `COUNT(*)` / `COUNT(expr)`。
|
|
184
|
-
- 窗口函数可用:`ROW_NUMBER`、`RANK`、`DENSE_RANK`、`PERCENT_RANK`、`CUME_DIST`、`NTILE(n)`、`LAG` / `LEAD`、`FIRST_VALUE`,以及 `COUNT` / `SUM` / `AVG` / `MIN` / `MAX` 作为整个分区的汇总。“每组最新一条”写派生表 `ROW_NUMBER() OVER (PARTITION BY k ORDER BY t DESC, rec_id DESC) AS rn`,外层 `WHERE rn = 1`。窗口只支持整个分区的计算范围:带 `ORDER BY` 的聚合窗口(逐行累计)、`ROWS/RANGE BETWEEN ... CURRENT ROW` 等范围不支持,累计值在 Page/FaaS 中计算;`LAST_VALUE` 只能配合 `ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING`。
|
|
185
|
-
- 字符串函数使用 `LOWER(TEXT)`、`UPPER(TEXT)`、`CONCAT(TEXT, ...)`、`CONCAT_WS(sep, TEXT, ...)`、`REPLACE`、`STARTS_WITH`,拼接也可写 `||`(两侧都是 `TEXT`)。包含判断写 `STRPOS(text, 'x') > 0`,结尾匹配写 `text LIKE '%x'`;`STRPOS` 只能与 0 或 1 比较,不能取具体位置。`LENGTH`、`LEFT`、`RIGHT`、`SUBSTRING`、`LPAD`、`RPAD`、`TRIM` / `LTRIM` / `RTRIM` 和正则函数不支持,长度、截取、去空白、拆分在 Page/FaaS 中处理。
|
|
186
|
-
- 数字计算使用 `+`、`-`、`*`、`/`、`%` / `MOD`(仅整数)、`ABS`、`CEIL`、`FLOOR`、`ROUND(x)`;保留 n 位小数写 `ROUND(x::numeric, n)`,不写 `ROUND(x, n)`。两个整数相除按 PostgreSQL 做整数除法(`7 / 2 = 3`,`COUNT(a) / COUNT(*)` 也是整数除法),比例、通过率写 `COUNT(a)::float8 / COUNT(*)` 或 `SUM(CASE WHEN cond THEN 1.0 ELSE 0.0 END) / COUNT(*)`。
|
|
187
|
-
|
|
188
|
-
字段筛选使用以下支持形态:
|
|
189
|
-
|
|
190
|
-
| 字段类型 | 支持的筛选形态 |
|
|
191
|
-
|---|---|
|
|
192
|
-
| `rec_id`、`TEXT`、Phone | `=`、`IN`、`NOT IN`、`LIKE`、`NOT LIKE` |
|
|
193
|
-
| `INT`、`DOUBLE` | `=`、`IN`、`NOT IN`、`<`、`<=`、`>`、`>=`、`BETWEEN` |
|
|
194
|
-
| `BOOL` | `= TRUE`、`= FALSE` |
|
|
195
|
-
| `TIMESTAMP` | 与 `TIMESTAMP` 参数使用 `=`、`!=`、`<`、`<=`、`>`、`>=`、`BETWEEN` |
|
|
196
|
-
| `OPTION` | 显式比较 `.name` 或 `.id`;整个 OPTION 只与 OPTION 比较 |
|
|
197
|
-
| `AUTONUMBER` | `.sequence` 做数值比较、排序和计算;`.number` 做文本展示或等值筛选 |
|
|
198
|
-
| 单值关联(Catalog `sqlType.kind = TEXT`) | 按 `TEXT` 使用 `=`、`IN`、`NOT IN`、`LIKE`、`NOT LIKE` |
|
|
199
|
-
| 多选、多值关联等集合(Catalog `sqlType.kind = ARRAY`) | 只使用 `@>`、`<@`、`&&`;UDT 数组先显式访问 `.id` / `.name` 成员数组 |
|
|
200
|
-
| `USER`、`CHAT`、`FILE`、`URL` | 使用括号语法比较已声明的标量子字段;FILE 为 `.token/.name/.mime_type/.size`,URL 为 `.text/.link`;多值对象只有逐元素明细语义才展开 |
|
|
169
|
+
- 当前访问者使用 `CURRENT_USER_ID()`,不由页面传入用户 ID。权限关系的实现边界按[权限设计](permission-design.md#读路径database-function-就是策略面)。
|
|
170
|
+
- UDT 列成员使用 PostgreSQL 复合类型括号语法:无表别名写 `("负责人").id`、`("链接").link`,带表别名写 `(t."负责人").id`。FILE 的成员为 `.token/.name/.mime_type/.size`;逐元素读取后的 range alias 成员写 `u.id`。
|
|
171
|
+
- 集合字段的 PostgreSQL 数组运算符含义为:`@>`(包含)、`<@`(被包含)、`&&`(有交集)。先用 Catalog 的 `sqlType` 区分标量与集合,再按生成参考判断操作是否适用;展开集合前确认业务是否允许改变主表行数。
|
|
172
|
+
- 时间条件使用 Catalog 中确认为 `TIMESTAMP` 的字段和 `TIMESTAMP` 位置参数;当前时间使用 `CURRENT_TIMESTAMP`。查询结果固定为 Base 执行时区下的 `YYYY-MM-DD HH:mm:ss.SSS` 字符串。`EXTRACT(EPOCH FROM timestamp_expr)` 返回保留小数秒的 `DOUBLE`;明确只需整数秒时再写 `::bigint`。
|
|
173
|
+
- 窗口、聚合、字符串、日期和数值计算先明确结果契约,再查[目录生成的修法与已验证 SQL](base-sql-errors.generated.md)。默认采用满足前提的形式;例外是没有等价 SQL 或改写改变所需语义,此时统一按[SQL 外实现放在哪](../SKILL.md#sql-外实现放在哪)选择实现位置。
|
|
174
|
+
|
|
175
|
+
字段类型和成员来自 Catalog,输入按本节参数协议声明;适用的字段操作与修复路径查[生成参考](base-sql-errors.generated.md),而不是从字段名称推断。示例演示参数和结果消费,不作为完整能力清单。
|
|
201
176
|
|
|
202
177
|
条件聚合示例:
|
|
203
178
|
|
|
@@ -286,7 +261,7 @@ ORDER BY o."订单号" DESC, o.rec_id DESC
|
|
|
286
261
|
LIMIT 20
|
|
287
262
|
```
|
|
288
263
|
|
|
289
|
-
如果没有真实目标表可 JOIN
|
|
264
|
+
如果没有真实目标表可 JOIN,又需要保留空集合主表行,先核对[生成参考中的语义前提](base-sql-errors.generated.md);没有等价形式时按[SQL 外实现选择原则](../SKILL.md#sql-外实现放在哪)处理。拆分后的输入若在开始时已经确定,应并发调用。
|
|
290
265
|
|
|
291
266
|
搜索、筛选、关联和聚合尽量在查询中完成。没有关系、不同步消费或需要隔离失败语义的结果集可以拆分;拆分后的输入若在开始时已经确定,应并发调用。
|
|
292
267
|
|
|
@@ -303,7 +278,7 @@ await invokeDatabaseFunction<{ rows: unknown[] }>(
|
|
|
303
278
|
)
|
|
304
279
|
```
|
|
305
280
|
|
|
306
|
-
FaaS handler 内部使用 context,projectId
|
|
281
|
+
FaaS handler 内部使用 context,projectId 为当前应用的工程常量:
|
|
307
282
|
|
|
308
283
|
```ts
|
|
309
284
|
await context.invokeFunction({
|
|
@@ -329,12 +304,11 @@ await context.invokeFunction({
|
|
|
329
304
|
"record_id": "recxxx",
|
|
330
305
|
"title": "准备评审",
|
|
331
306
|
"status": "待处理",
|
|
332
|
-
"due_at":
|
|
307
|
+
"due_at": "2026-07-18 10:00:00.000"
|
|
333
308
|
}
|
|
334
309
|
],
|
|
335
310
|
"columns": [],
|
|
336
311
|
"row_count": 1,
|
|
337
|
-
"fxdb_version": "...",
|
|
338
312
|
"log_id": "..."
|
|
339
313
|
},
|
|
340
314
|
"code": 0,
|
|
@@ -86,7 +86,7 @@ metadata 只声明输入,因此生成文件只约束调用参数。调用结
|
|
|
86
86
|
|
|
87
87
|
## Page 调用
|
|
88
88
|
|
|
89
|
-
默认 Page 的 `page/index.html` 需要把 `<title>`
|
|
89
|
+
默认 Page 的 `page/index.html` 需要把 `<title>` 设置为本次生成的应用名称,不留空。
|
|
90
90
|
|
|
91
91
|
默认 Page 必须引用并渲染 `page/src/components/floating-button/index.tsx` 中的 `FloatingButton` 组件。该组件自行解析应用 token,不接受 `projectId`。悬浮控件仅在正式环境向服务端判定有管理权限的访问者提供「编辑应用」入口。
|
|
92
92
|
|
|
@@ -233,7 +233,7 @@ AI 与 Base 数据组合时保持既有边界:先用 Database Function 读取
|
|
|
233
233
|
| Page `invokeDatabaseFunction` | 检查一次顶层 `code`,再校验 operation 的 `data` |
|
|
234
234
|
| Database Function | `data` 为 ResultJSON,包含 rows 等查询信息 |
|
|
235
235
|
| FaaS handler | 返回 `{data,code,msg}`,data 为业务结果,不再由 Page 二次解包 |
|
|
236
|
-
| FaaS 下游记录写入 | 检查下游 envelope 和各 batch 的结果语义,见[FaaS 协议](faas.md
|
|
236
|
+
| FaaS 下游记录写入 | 检查下游 envelope 和各 batch 的结果语义,见[FaaS 协议](faas.md#应用记录写入协议) |
|
|
237
237
|
|
|
238
238
|
不要把 SDK 的 `code===0` 套在 CLI 外层,也不要将 CLI 外层的 data 当作 handler 业务数据。raw API 的命令封装与业务响应按当前 lark-cli reference 分别解析。
|
|
239
239
|
|