mirror of
https://github.com/allankoechke/turso.git
synced 2026-12-01 01:27:37 +00:00
Fill the gaps in docs/sql-reference that were still stale after the 0.7 release. Verified every claim against the v0.7.0 source (COMPAT.md, core/function.rs, the parser AST, and cli/). - window: row_number() and FILTER (WHERE ...) are supported now - scalar: add unistr, unistr_quote, turso_version() - vector: add vector32_sparse; note the experimental sparse vector index - transactions: document SAVEPOINT / RELEASE / ROLLBACK TO - add REINDEX statement page - create-trigger: drop the experimental banner (triggers are stable); mark INSTEAD OF as not yet supported - create-table: reclassify WITHOUT ROWID and GENERATED as experimental flags; note locale/custom collations - create-index: document COLLATE and link REINDEX - select: correct the window ranking note (row_number available) - experimental-features: triggers are no longer experimental; add generated_columns, without_rowid, mvcc_passive_checkpoint - extensions: document the crypto, fuzzy, and ipaddr extensions - pragmas: add data_sync_retry, require_where/i_am_a_dummy, mvcc_checkpoint_threshold, mvcc_gc_threshold - cli: drop --experimental-triggers; add the new experimental flags
139 lines
4.3 KiB
Plaintext
139 lines
4.3 KiB
Plaintext
---
|
|
title: Experimental Features
|
|
description: How to enable experimental features in the CLI and each SDK
|
|
sidebarTitle: Experimental Features
|
|
---
|
|
|
|
# Experimental Features
|
|
|
|
Some Turso features are still experimental and must be explicitly enabled before use. Experimental features are stable enough for testing but their API may change in future releases.
|
|
|
|
## Experimental Features List
|
|
|
|
| Feature | Flag | Description |
|
|
|---------|------|-------------|
|
|
| Views | `views` | [CREATE VIEW](/docs/sql-reference/statements/create-view) and [CREATE MATERIALIZED VIEW](/docs/sql-reference/statements/create-materialized-view) |
|
|
| Custom Types | `custom_types` | [CREATE TYPE](/docs/sql-reference/statements/create-type), [DROP TYPE](/docs/sql-reference/statements/drop-type), [CREATE DOMAIN](/docs/sql-reference/statements/create-domain), and [DROP DOMAIN](/docs/sql-reference/statements/drop-domain) for STRICT tables |
|
|
| Encryption | `encryption` | At-rest encryption via [PRAGMA cipher / hexkey](/docs/sql-reference/pragmas#encryption) |
|
|
| Index Methods | `index_method` | [CREATE INDEX ... USING](/docs/sql-reference/statements/create-index#using-clause) for FTS and custom index types |
|
|
| Autovacuum | `autovacuum` | Automatic database file compaction |
|
|
| Vacuum | `vacuum` | In-place [VACUUM](/docs/sql-reference/statements/vacuum) compaction |
|
|
| Attach | `attach` | [ATTACH DATABASE](/docs/sql-reference/statements/attach-database) and [DETACH DATABASE](/docs/sql-reference/statements/detach-database) |
|
|
| Generated Columns | `generated_columns` | Virtual [`GENERATED ALWAYS AS`](/docs/sql-reference/statements/create-table) columns |
|
|
| Without Rowid | `without_rowid` | `WITHOUT ROWID` tables |
|
|
| Multi-Process WAL | `multiprocess_wal` | [Multi-Process Access](/docs/sql-reference/multiprocess-access) — share a database file between OS processes via a shared WAL coordinator |
|
|
| MVCC Passive Checkpoint | `mvcc_passive_checkpoint` | Passive checkpointing under MVCC (`journal_mode=mvcc`) |
|
|
|
|
<Info>
|
|
Triggers are no longer experimental as of Turso 0.7 — [CREATE TRIGGER](/docs/sql-reference/statements/create-trigger) and [DROP TRIGGER](/docs/sql-reference/statements/drop-trigger) work without any flag.
|
|
</Info>
|
|
|
|
## CLI
|
|
|
|
Pass `--experimental-<feature>` flags when starting `tursodb`:
|
|
|
|
```bash
|
|
tursodb --experimental-views --experimental-custom-types database.db
|
|
```
|
|
|
|
Multiple flags can be combined:
|
|
|
|
```bash
|
|
tursodb \
|
|
--experimental-views \
|
|
--experimental-custom-types \
|
|
--experimental-encryption \
|
|
--experimental-index-method \
|
|
--experimental-vacuum \
|
|
database.db
|
|
```
|
|
|
|
## Rust SDK
|
|
|
|
The Rust binding uses a fluent `Builder` API:
|
|
|
|
```rust
|
|
use turso::Builder;
|
|
|
|
let db = Builder::new_local("database.db")
|
|
.experimental_encryption(true)
|
|
.experimental_materialized_views(true)
|
|
.experimental_custom_types(true)
|
|
.experimental_index_method(true)
|
|
.experimental_vacuum(true)
|
|
.experimental_attach(true)
|
|
.experimental_multiprocess_wal(true)
|
|
.build()?;
|
|
```
|
|
|
|
## Python SDK
|
|
|
|
Pass a comma-separated string to the `experimental_features` parameter:
|
|
|
|
```python
|
|
import turso
|
|
|
|
conn = turso.connect(
|
|
"database.db",
|
|
experimental_features="views,custom_types,vacuum",
|
|
)
|
|
```
|
|
|
|
## JavaScript / Node.js SDK
|
|
|
|
Pass an array of feature strings to the `experimental` option:
|
|
|
|
```typescript
|
|
import { Database } from "@tursodatabase/libsql";
|
|
|
|
const db = new Database("file:database.db", {
|
|
experimental: ["views", "custom_types", "encryption", "vacuum"],
|
|
});
|
|
```
|
|
|
|
## Go SDK
|
|
|
|
Set the `ExperimentalFeatures` field as a comma-separated string:
|
|
|
|
```go
|
|
db, err := turso.NewDatabase(turso.TursoDatabaseConfig{
|
|
Path: "database.db",
|
|
ExperimentalFeatures: "views,custom_types,vacuum",
|
|
})
|
|
```
|
|
|
|
The Go driver also supports DSN query parameters:
|
|
|
|
```go
|
|
db, err := sql.Open("turso", "database.db?experimental=views,vacuum")
|
|
```
|
|
|
|
## Java SDK
|
|
|
|
The Java binding currently supports encryption through a dedicated method:
|
|
|
|
```java
|
|
TursoDB db = TursoDB.openWithEncryption(
|
|
"database.db",
|
|
OpenFlags.CREATE,
|
|
"aegis256",
|
|
"your-hex-key-here"
|
|
);
|
|
```
|
|
|
|
## .NET SDK
|
|
|
|
The .NET binding currently supports encryption through the C FFI:
|
|
|
|
```csharp
|
|
var db = Database.OpenWithEncryption(
|
|
"database.db",
|
|
"aegis256",
|
|
"your-hex-key-here"
|
|
);
|
|
```
|
|
|
|
## See Also
|
|
|
|
- [Compatibility](/docs/sql-reference/compatibility) for the full feature support matrix
|