Back to Turso

Experimental Features

docs/sql-reference/experimental-features.mdx

0.5.33.3 KB
Original Source

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

FeatureFlagDescription
ViewsviewsCREATE VIEW and CREATE MATERIALIZED VIEW
Custom Typescustom_typesCREATE TYPE and DROP TYPE for STRICT tables
TriggerstriggersCREATE TRIGGER and DROP TRIGGER
EncryptionencryptionAt-rest encryption via PRAGMA cipher / hexkey
Index Methodsindex_methodCREATE INDEX ... USING for FTS and custom index types
AutovacuumautovacuumAutomatic database file compaction
AttachattachATTACH DATABASE and DETACH DATABASE

CLI

Pass --experimental-<feature> flags when starting tursodb:

bash
tursodb --experimental-views --experimental-triggers database.db

Multiple flags can be combined:

bash
tursodb \
  --experimental-views \
  --experimental-custom-types \
  --experimental-triggers \
  --experimental-encryption \
  --experimental-index-method \
  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_triggers(true)
    .experimental_materialized_views(true)
    .experimental_custom_types(true)
    .experimental_index_method(true)
    .experimental_attach(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,triggers,custom_types",
)

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", "triggers", "custom_types", "encryption"],
});

Go SDK

Set the ExperimentalFeatures field as a comma-separated string:

go
db, err := turso.NewDatabase(turso.TursoDatabaseConfig{
    Path: "database.db",
    ExperimentalFeatures: "views,triggers,custom_types",
})

The Go driver also supports DSN query parameters:

go
db, err := sql.Open("turso", "database.db?experimental=views,triggers")

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