Files
turso/docs/sql-reference/compatibility.mdx
Claude 8618d9a555 docs: document NULLS FIRST/LAST in indexes and constraints
Cover the new NULLS FIRST/LAST support in CREATE INDEX and in table
PRIMARY KEY and UNIQUE constraints: syntax, storage placement defaults,
sort elision, the rowid alias and WITHOUT ROWID cases where the clause
has no effect, and the warning that stock SQLite cannot open a schema
that uses it. List it as a Turso extension on the compatibility page
and note that upsert conflict targets still reject it.

Also fix wrong claims that predate this feature: the SELECT page said
the default NULL placement was NULLS LAST for ASC and NULLS FIRST for
DESC (it is the opposite), and the language reference book said NULLS
LAST was a parse error and showed COLLATE after ASC/DESC in ordering
terms (the parser only accepts it before).

Tests: verified every documented example and default against tursodb,
including EXPLAIN QUERY PLAN showing sort elision for matching
placements and a sorter fallback for mismatched ones.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VpGXUdx42eQrq5ZXEqCRNz
2026-08-03 19:27:20 +00:00

35 lines
2.3 KiB
Plaintext

---
title: SQLite Compatibility
description: Turso compatibility with SQLite - supported features, known differences, and limitations
sidebarTitle: Compatibility
---
# SQLite Compatibility
The authoritative compatibility reference is maintained at [`COMPAT.md`](https://github.com/tursodatabase/turso/blob/main/COMPAT.md) in the repository root. It tracks the support status for every SQL statement, expression, function, PRAGMA, C API function, VDBE opcode, and extension.
Refer to that document for the current state of compatibility. It is updated alongside code changes to stay accurate.
## Turso-Specific Extensions
These features extend Turso beyond SQLite compatibility:
| Feature | Description |
|---------|-------------|
| [CREATE TYPE](/docs/sql-reference/statements/create-type) | User-defined types for STRICT tables |
| [CREATE MATERIALIZED VIEW](/docs/sql-reference/statements/create-materialized-view) | Live materialized views with incremental maintenance |
| [BEGIN CONCURRENT](/docs/sql-reference/statements/transactions#begin-concurrent) | Optimistic concurrent write transactions (MVCC) |
| [Vector functions](/docs/sql-reference/functions/vector) | Vector storage, distance calculations, similarity search |
| [Full-text search](/docs/sql-reference/functions/fts) | Tantivy-powered FTS with BM25 scoring |
| [CDC](/docs/sql-reference/pragmas#change-data-capture) | Change Data Capture via PRAGMA |
| [Encryption](/docs/sql-reference/pragmas#encryption) | At-rest database encryption |
| [Custom index methods](/docs/sql-reference/statements/create-index#using-method) | CREATE INDEX ... USING for FTS and custom access methods |
| [NULL ordering in indexes](/docs/sql-reference/statements/create-index#nulls-first-last) | NULLS FIRST/LAST in CREATE INDEX and in table PRIMARY KEY and UNIQUE constraints. A schema using it cannot be opened by stock SQLite |
| stddev() | Standard deviation aggregate function |
| [DEFAULT in VALUES](/docs/sql-reference/statements/insert#default-keyword-in-values) | SQL-standard DEFAULT keyword in INSERT VALUES lists |
## See Also
- [Experimental Features](/docs/sql-reference/experimental-features) for how to enable experimental features
- [COMPAT.md](https://github.com/tursodatabase/turso/blob/main/COMPAT.md) for the full compatibility matrix