* Returns the Postgres cast needed to compare a JSONB text value of the given * column type, or `null` when text comparison is correct. Single source of * truth for both filter range operators and sort ordering — keeps the two * paths from drifting apart.
(type: ColumnType | undefined)
| 38 | * paths from drifting apart. |
| 39 | */ |
| 40 | function jsonbCastForType(type: ColumnType | undefined): 'numeric' | 'timestamptz' | null { |
| 41 | switch (type) { |
| 42 | case 'number': |
| 43 | return 'numeric' |
| 44 | case 'date': |
| 45 | return 'timestamptz' |
| 46 | default: |
| 47 | return null |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Maps a column's **stable id** (the JSONB storage key, via `getColumnId`) to |
no outgoing calls
no test coverage detected