Skip to content

Releases: ashitikov/wasm-sql

0.1.5

29 Jan 14:01

Choose a tag to compare

v0.1.5

SQLite support

Full SQLite database support with type codecs via the new wasm-sql:sqlite/host WIT world.

SQLite codecs:

  • Raw storage types: int64, float64, string, blob
  • Semantic types: bool, json, uuid, date, time, datetime, datetime-utc

Usage:

[dependencies]
wasm-sql = { version = "0.1.5", features = ["sqlite"] }

Shared codec utilities

Common codec logic (json, uuid, date, time) extracted into codec_utils module, shared between PostgreSQL and SQLite implementations. This reduces duplication and ensures consistent behavior across databases.

PostgreSQL dependency cleanup

PostgreSQL-only dependencies (bigdecimal, ipnet, mac_address) are now behind the postgres feature flag and no longer pulled in for SQLite builds.

0.1.0

27 Jan 07:47

Choose a tag to compare

🚀 v0.1.0 - Initial Release

First public release of wasm-sql — Wasmtime host capability for SQL database access from WebAssembly components.

✨ Features

Core

  • Connection pooling via sqlx
  • Full transaction support (begin/commit/rollback) with automatic rollback on drop
  • Async API using wasmtime component model
  • Explicit release() for connection resources (useful for guest languages with GC)
  • Pool state inspection

🐘 PostgreSQL Codecs

Full set of type codecs for encoding query arguments and decoding results:

Category Types
Integers int16, int32, int64
Floats float32, float64
Text string, json
Boolean bool
Identifiers uuid
Key-Value hstore
Date/Time date, time, timestamp, timestamptz, interval
Network inet, cidr, macaddr
Numeric numeric (arbitrary precision)

All codecs support NULL values via Option types.

⚠️ Requirements

This library uses experimental async features from the wasmtime component model:

  • wasmtime 0.41+
  • wit-bindgen 0.51+

📦 Installation

[dependencies]
wasm-sql = { version = "0.1", features = ["postgres"] }

🔜 Roadmap

  • SQLite support (driver ready, codecs pending)
  • MySQL support (driver ready, codecs pending)