The supported client-side SQLite types are:

  1. null
  2. integer: a 64-bit signed integer
  3. real: a 64-bit floating point number
  4. text: An UTF-8 text string
  5. blob: Binary data

Postgres Type Mapping

Binary data in Postgres can be accessed in Sync Rules, but cannot be synced directly to clients (it needs to be converted to hex or base64 first — see below), and cannot be used as bucket parameters.

Postgres values are mapped according to this table:

Postgres Data TypePowerSync / SQLite Column TypeNotes
text, varchartext
int2, int4, int8integer
numeric / decimaltextThese types have arbitrary precision in Postgres, so can only be represented accurately as text in SQLite
boolinteger1 for true, 0 for false
float4, float8real
enumtext
uuidtext
timestamptztextFormat: YYYY-MM-DD hh:mm:ss.sssZ. This is compatible with ISO8601 and SQLite’s functions. Precision matches the precision used in Postgres. -infinity becomes 0000-01-01 00:00:00Z and infinity becomes 9999-12-31 23:59:59Z.
timestamptextFormat: YYYY-MM-DD hh:mm:ss.sss. In most cases, timestamptz should be used instead. -infinity becomes 0000-01-01 00:00:00 and infinity becomes 9999-12-31 23:59:59.
date, timetext
json, jsonbtextThere is no dedicated JSON type — JSON functions operate directly on text values.
intervaltext
macaddrtext
inettext
byteablobCannot sync directly to client — convert to hex or base64 first. See Operators & Functions.
geometry (PostGIS)texthex string of the binary data Use the ST functions to convert to other formats

There is no dedicated boolean data type. Boolean values are represented as 1 (true) or 0 (false).

json and jsonb values are treated as text values in their serialized representation. JSON functions and operators operate directly on these text values.

MongoDB (Alpha) Type Mapping

This section is a work in progress. More details for MongoDB connections are coming soon. In the meantime, check our MongoDB guide to try out our MongoDB alpha support, and ask on our Discord server if you have any questions.

BSON TypePowerSync / SQLite Column TypeNotes
Stringtext
Int, Longinteger
Doublereal
Decimal128text
ObjecttextConverted to a JSON string
ArraytextConverted to a JSON string
ObjectIdtextLower-case hex string
UUIDtextLower-case hex string
Booleaninteger1 for true, 0 for false
DatetextFormat: YYYY-MM-DD hh:mm:ss.sss
Nullnull
BinaryblobCannot sync directly to client — convert to hex or base64 first. See Operators & Functions.
Regular ExpressiontextJSON text in the format {"pattern":"...","options":"..."}
TimestampintegerConverted to a 64-bit integer
Undefinednull
DBPointertextJSON text in the format {"collection":"...","oid":"...","db":"...","fields":...}
JavaScripttextJSON text in the format {"code": "...", "scope": ...}
Symboltext
MinKey, MaxKeynull
  • Data is converted to a flat list of columns, one column per top-level field in the MongoDB document.
  • Special BSON types are converted to plain SQLite alternatives.
  • For example, ObjectId, Date, UUID are all converted to a plain TEXT column.
  • Nested objects and arrays are converted to JSON arrays, and JSON operators can be used to query them (in the Sync Rules and/or on the client-side).
  • Binary data nested in objects or arrays is not supported.

MySQL (Alpha) Type Mapping

This section is a work in progress. More details for MySQL connections are coming soon. In the meantime, ask on our Discord server if you have any questions.