Skip to main content
This page is a formal grammar reference for Sync Rules: it shows the syntax accepted for parameter queries and data queries using railroad diagrams. This page complements the Supported SQL guide, which explains in prose what you can write, with examples and restrictions. When to use this page: If you need to check whether a construct is valid, see how parameter vs data query syntax differs, or you’re used to grammar specs, use the diagrams and the “Used by” / “References” links to navigate. For most users just getting started, see Supported SQL and the Sync Rules docs.

ParameterQuery

References: StaticParameterQuery, TableParameterQuery, TableValuedParameterQuery

TableValuedParameterQuery

References: Identifier, JsonEachCall, SelectItem, WhereClause

TableParameterQuery

References: Reference, SelectItem, WhereClause

StaticParameterQuery

References: SelectItem, WhereClause

DataQuery

References: Reference, SelectItem, WhereClause

SelectItem

References: Expression, Identifier

JsonEachCall

References: Expression

WhereClause

References: Predicate, WhereClause

Predicate

References: Expression

Expression

Operators

Binary operators supported in scalar expressions, listed from highest to lowest precedence.
PowerSync evaluates all binary operators with equal precedence (left to right). Use parentheses to control evaluation order.
References: PrimaryExpression, PropertyAccess

PropertyAccess

References: IntegerLiteral, StringLiteral

Reference

References: Identifier

CastExpression

References: Expression

FunctionCall

References: Expression, Reference

PrimaryExpression

References: CastExpression, Expression, FunctionCall, NumericLiteral, Reference, StringLiteral

Lexical Rules

Identifier

Bare identifiers are normalized to lower case and may contain letters, digits, and underscores. Double-quoted identifiers (“name”) allow any printable character and support escaped quotes ("").

StringLiteral

Single-quoted string literal. Embedded single quotes are escaped by doubling them (”).

IntegerLiteral

One or more decimal digits (0-9).

NumericLiteral

Decimal number: one or more digits with an optional fractional part (.digits).