Skip to content

Releases: jiftechnify/valq

0.3.0

17 Dec 14:49
5d26177

Choose a tag to compare

What's Changed

Added

  • query_value_result! macro for Result-returning queries (#56)
  • transpose_tuple! helper macro for transposing tuples of Results/Options (#58)

0.2.0

17 Dec 14:49
0f8c1d3

Choose a tag to compare

What's Changed

Added

  • Deserialization operator (>>) for deserializing queried values into arbitrary types (#46)

    • Deserialize queried values into any type implementing serde::Deserialize
    • Syntax: query_value!(obj.field >> (Type))
      • Don't forget to wrap the destination type with parentheses!
  • Null coalescing operator (??) for unwrapping query results with default values (#50)

    • ... ?? <expr> to provide a custom default value
    • ... ?? default to use Default::default() as the fallback

Changed

  • Arbitrary type casting with -> operator (#46)

    • No longer limited to hard-coded conversions!
    • Any as_xxx() method available on the value type can be used
  • Made syntax more JS-like (#47)

    • More flexible bracket notation [...]
      • Put arbitrary Rust expressions and enjoy unlimited dynamic queries!
      • Removed ."key" syntax in favor of revamped bracket notation
    • ?? operator for unwrapping Options

Documentation

  • Removed tedious enumeration of macro matching patterns from documentation (#49)
  • Added comprehensive examples for all major features
  • Clarified query syntax specification

Full Changelog: 0.1.0...0.2.0