Back to Sxt Proof Of Sql

PoSQL SQL Syntax

docs/SQLSyntaxSpecification.md

0.129.13.3 KB
Original Source

PoSQL SQL Syntax

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.

CategoryFeatureProverEVM Verification
DataTypesBool / Boolean
Uint8 (8 bits)
TinyInt (8 bits)
SmallInt (16 bits)
Int / Integer (32 bits)
BigInt (64 bits)
Int128
Decimal751
Varchar2
Varbinary2
Timestamp
OperatorsAND, OR
NOT
+, –, *
/
=, !=
>, ≥, <, ≤
Aggregate Functions3SUM
COUNT
SELECT SyntaxWHERE clause
GROUP BY clause
LIMIT clause
OFFSET clause
UNION ALL operator
JOIN clause4

For more details please refer to DataFusion SELECT syntax.

Reserved keywords

The following keywords may not be used as aliases:

  • count

Footnotes

  1. Currently, we only support decimals up to 75 digits of precision and inequality operators only operate on decimals up to 38 digits of precision.

  2. Currently, we do not support any string or binary operations beyond = and !=. 2

  3. Currently there are restrictions on aggregations we support.

  4. Currently, we only support some inner joins on one column.