docs/SQLSyntaxSpecification.md
Proof of SQL uses sqlparser to parse SQL. It currently supports the following syntax. The syntax support is rapidly expanding, and we are happy to take suggestions about what should be added. Anyone submitting a PR must ensure that this is kept up to date.
| Category | Feature | Prover | EVM Verification |
|---|---|---|---|
| DataTypes | Bool / Boolean | ✅ | ✅ |
| Uint8 (8 bits) | ✅ | ✅ | |
| TinyInt (8 bits) | ✅ | ✅ | |
| SmallInt (16 bits) | ✅ | ✅ | |
| Int / Integer (32 bits) | ✅ | ✅ | |
| BigInt (64 bits) | ✅ | ✅ | |
| Int128 | ✅ | ✅ | |
| Decimal751 | ✅ | ✅ | |
| Varchar2 | ✅ | ✅ | |
| Varbinary2 | ✅ | ✅ | |
| Timestamp | ✅ | ✅ | |
| Operators | AND, OR | ✅ | ✅ |
| NOT | ✅ | ✅ | |
| +, –, * | ✅ | ✅ | |
| / | ❌ | ❌ | |
| =, != | ✅ | ✅ | |
| >, ≥, <, ≤ | ✅ | ✅ | |
| Aggregate Functions3 | SUM | ✅ | ✅ |
| COUNT | ✅ | ✅ | |
| SELECT Syntax | WHERE clause | ✅ | ✅ |
| GROUP BY clause | ✅ | ✅ | |
| LIMIT clause | ✅ | ✅ | |
| OFFSET clause | ✅ | ✅ | |
| UNION ALL operator | ✅ | ✅ | |
| JOIN clause4 | ✅ | ✅ |
For more details please refer to DataFusion SELECT syntax.
The following keywords may not be used as aliases:
countCurrently, we only support decimals up to 75 digits of precision and inequality operators only operate on decimals up to 38 digits of precision. ↩
Currently, we do not support any string or binary operations beyond = and !=. ↩ ↩2
Currently there are restrictions on aggregations we support. ↩
Currently, we only support some inner joins on one column. ↩