Skip to content

v0.0.3

Choose a tag to compare

@kimolalekan kimolalekan released this 29 Jun 19:16

v0.0.4 — Typed Rust API & Comprehensive Documentation

This release introduces a fully typed query API for the Rust crate — no string parsing required. All query operations are now available as direct methods on Liven (embedded) and LivenClient (wire protocol), plus a complete API reference published to docs.rs.

New: Typed Rust API

Write queries with Rust types and builder patterns instead of raw DSL strings:

use liven::query::{Pipeline, Filter};

db.filter("events", Filter::field("type").eq("click"))?;
db.run(Pipeline::from("orders").filter(Filter::field("amount").gte(100)).limit(10))?;

Added to Liven (embedded) and LivenClient (wire):

  • CRUD: insert, upsert, update, delete, get, clear, drop_stream, insert_many, upsert_many
  • Pipeline: filter, limit, count, sort, page, page_cursor, map, window, group, distinct
  • Joins: enrich, correlate, chain, sequence
  • Vector: vector_filter
  • Meta: streams, status, explain
  • Pipeline mutations: pipeline_update, pipeline_delete
  • Pipeline builder with .build(), .build_listen(), .build_update(), .build_delete()

New: Typed Filter Builder

Filter::field("status").eq("active")
Filter::field("amount").between(10.0, 100.0)
Filter::and(vec![Filter::field("role").eq("admin"), Filter::field("age").gte(18)])

New: Comprehensive API Reference

A complete usage guide covering all functions for both embedded and wire modes is now included in the crate documentation at docs.rs/liven.

Wire Protocol Serialization

All typed queries can be serialized back to the LIVEN DSL string for wire transmission via Query::to_dsl_string(). This enables the LivenClient to use the same typed API as the embedded mode.

Full changelog

  • Add src/query.rsPipeline, Filter, Query constructors, AggregateStrategy helpers
  • Add Liven::run() — execute typed Query directly (bypass string parsing)
  • Add convenience methods on Liven and LivenClientinsert(), get(), filter(), enrich(), etc.
  • Add Query::to_dsl_string(), PipelineStage::to_dsl_string(), FilterExpr::to_dsl_string() — serialize typed queries back to DSL strings for wire transmission
  • Add #![doc = include_str!("rust-crate-api.md")] — full API reference published to docs.rs
  • Fix rustdoc HTML tag warning in types.rs