fix: integrate people archive, report reader and western chart corrections
Validate on Linux Node 22 and PostgreSQL 17: 3894 frontend tests and 64 database tests pass, with no removed test names or new failures. Preserve static Home, bounded gzip, assertion-change records and manual acceptance gaps. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ type Filter =
|
||||
|
||||
export type PostgrestOrNode =
|
||||
| Readonly<{ kind: "cmp"; column: string; op: CmpOp; value: unknown }>
|
||||
| Readonly<{ kind: "is"; column: string; value: null | boolean }>
|
||||
| Readonly<{ kind: "and"; nodes: readonly PostgrestOrNode[] }>;
|
||||
|
||||
type Mutation =
|
||||
@@ -114,6 +115,10 @@ function parsePostgrestTerm(term: string): PostgrestOrNode {
|
||||
if (andMatch?.[1] != null) {
|
||||
return { kind: "and", nodes: splitTopLevel(andMatch[1]).map(parsePostgrestTerm) };
|
||||
}
|
||||
const isMatch = /^([a-z_][a-z0-9_]*)\.is\.(null|true|false)$/.exec(term);
|
||||
if (isMatch) {
|
||||
return { kind: "is", column: isMatch[1], value: isMatch[2] === "null" ? null : isMatch[2] === "true" };
|
||||
}
|
||||
const cmp = /^([a-z_][a-z0-9_]*)\.(eq|neq|lt|gt|lte|gte)\.([\s\S]*)$/.exec(term);
|
||||
if (!cmp) throw new Error(`unsupported or filter: ${term}`);
|
||||
return {
|
||||
@@ -136,6 +141,7 @@ function compilePostgrestNode(
|
||||
if (node.kind === "and") {
|
||||
return `(${node.nodes.map((child) => compilePostgrestNode(child, parameters, types)).join(" and ")})`;
|
||||
}
|
||||
if (node.kind === "is") return compileUnaryIsClause(node.column, node.value, false);
|
||||
identifier(node.column);
|
||||
parameters.push(databaseValue(types.get(node.column), node.value));
|
||||
return `${identifier(node.column)} ${SQL_CMP[node.op]} $${parameters.length}`;
|
||||
|
||||
Reference in New Issue
Block a user