You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reject index key sort direction (`ASC`/`DESC`) in `CREATE INDEX` at dev time. DSQL does not allow a sort direction on index keys ("specifying sort order not supported for index keys"), but the PGlite-based local mock previously accepted it, so the error only surfaced on deploy. Migration and mock validation now fail locally instead. (`NULLS FIRST/LAST` is supported by DSQL and is not rejected.)
{pattern: /\bCOLLATE\b/i,message: 'DSQL only supports C collation.',severity: 'error'},
86
86
{pattern: /(?<!::)\bJSONB\b/i,message: 'DSQL does not support JSONB columns. Use JSON instead (JSONB is available as a query runtime cast via ::jsonb).',severity: 'error'},
87
87
{pattern: /(@>|<@|\?\||\?&)/,message: 'JSONB operators lack GIN index acceleration in DSQL.',severity: 'warn'},
88
+
// DSQL rejects a sort direction (ASC/DESC) on index keys — it isn't in the
89
+
// CREATE INDEX ASYNC grammar (only `NULLS FIRST|LAST`, which IS supported, is).
90
+
// `[^;]*` keeps the match inside a single statement; ASC/DESC cannot otherwise
91
+
// appear in a CREATE INDEX. Caveat: stripLiteralsAndComments doesn't strip
92
+
// double-quoted identifiers, so a column literally named "desc"/"asc" would
93
+
// false-positive — niche, and shared with other single-keyword rules here.
94
+
{pattern: /\bCREATE\s+(?:UNIQUE\s+)?INDEX\b[^;]*\b(?:ASC|DESC)\b/i,message: 'DSQL does not support sort order (ASC/DESC) on index keys. Remove it — ordering is enforced by ORDER BY in queries (NULLS FIRST/LAST is allowed). (DSQL: "specifying sort order not supported for index keys")',severity: 'error'},
88
95
];
89
96
90
97
/** Validate a SQL statement for DSQL compatibility. Throws on unsupported features. */
0 commit comments