File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,18 @@ const { sql } = getEvents({
5959Result:
6060
6161``` sql
62- SELECT event_id, event_name
63- FROM prod_events
64- WHERE status = ' active'
62+ SELECT
63+ event_id,
64+ event_name
65+ FROM
66+ prod_events
67+ WHERE
68+ status = ' active'
6569 AND created_at >= ' 2022-02-22'
66- ORDER BY created_at
67- LIMIT 99
70+ ORDER BY
71+ created_at
72+ LIMIT
73+ 99
6874```
6975
7076## Schema Validation
@@ -104,7 +110,7 @@ const { sql } = getEvents({
104110| ` schema.uuid ` | RFC 4122 UUID | ` '550e8400-e29b-41d4-a716-446655440000' ` |
105111| ` schema.positiveInt ` | Positive integer | ` 100 ` |
106112| ` schema.enum(...) ` | Whitelist of allowed values | ` schema.enum('asc', 'desc') ` |
107- | ` schema.s3Path ` | S3 URI | ` 's3://bucket/path /' ` |
113+ | ` schema.s3Path ` | S3 URI | ` 's3://athena-results/queries /' ` |
108114
109115### Custom Schema Types
110116
@@ -162,7 +168,7 @@ import { SQL_INJECTION_PATTERNS } from 'sql-render';
162168| Schema mismatch | ` Schema missing definitions for template variables: [id] ` |
163169| Missing params | ` Missing variables in params: [tableName, limit] ` |
164170| Extra params | ` Extra variables not in template: [foo] ` |
165- | Schema validation | ` Schema validation failed for 'status' ` |
171+ | Schema validation | ` Schema validation failed for 'status': received string ("invalid") ` |
166172| Type validation | ` SQL injection pattern detected in 'status': ... ` |
167173| Null/undefined | ` Validation failed for 'key': value cannot be null or undefined ` |
168174| Invalid descriptor | ` Invalid schema descriptor for 'key': must have a validate(val) method ` |
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ Schema mode validates at define-time (schema keys must match template tokens) an
5858- `schema.uuid` - RFC 4122 UUID
5959- `schema.positiveInt` - integer greater than 0
6060- `schema.enum(...values)` - whitelist of allowed string values
61- - `schema.s3Path` - S3 URI (s3://bucket/path )
61+ - `schema.s3Path` - S3 URI (s3://athena-results/queries/ )
6262
6363### Custom schema types
6464
You can’t perform that action at this time.
0 commit comments