tursodatabase/turso

how to use encryption in the browser with WASM

開放

#5,361 建立於 2026年2月17日

 (3 則留言) (0 個反應) (0 位負責人)Rust (1,001 個分叉)github user discovery
encryptiongood first issue

倉庫指標

星標
 (19,103 顆星)
PR 合併指標
 (平均合併 2天 11小時) (30 天內合併 147 個 PR)

描述

'm messing around with the Turso Database in the browser with WASM. I can get it working and can create tables add rows and such but only without encryption. When I try to enable encryption using:
await db.exec(PRAGMA hexkey = '${ENCRYPTION_KEY}');
await db.exec(PRAGMA cipher = 'aegis256';);
I get an error saying: "failed to consume stmt: Invalid argument supplied: encryption is an opt in feature. enable it via passing --experimental-encryption"
How can I pass in that parameter through the connect method? I've been searching the GitHub and the docs and I cannot find how to pass in the param or any other way to enable encryption when using Turso Database with WASM in the browser.

https://discord.com/channels/933071162680958986/1100485216520376410/threads/1464706723485843650

  1. we need to improve error message
  2. make sure we are passing encryption params to wasm build
  3. add an example of wasm with encryption in /examples

貢獻者指南