---------- PostgreSQL ----------
(column, key string)
| 122 | // ---------- PostgreSQL ---------- |
| 123 | |
| 124 | func (d *postgresDialect) JSONFieldText(column, key string) string { |
| 125 | return fmt.Sprintf("(CASE jsonb_typeof(%s->'%s')"+ |
| 126 | " WHEN 'string' THEN %s->>'%s'"+ |
| 127 | " WHEN 'boolean' THEN %s->>'%s'"+ |
| 128 | " WHEN 'number' THEN trim_scale((%s->'%s')::numeric)::text"+ |
| 129 | " END)", column, key, column, key, column, key, column, key) |
| 130 | } |
| 131 | |
| 132 | func (d *postgresDialect) JSONFieldEquals(column, key, arg string) (string, []any) { |
| 133 | return joinFieldEquals(d.JSONFieldEqualsParts(column, key, arg)) |