Skip to content

v1.8.2

Latest
Compare
Choose a tag to compare
@fnc12 fnc12 released this 24 Mar 13:55
ff7c878
⭐ Indexes support expressions
make_index<User>("idx", json_extract<bool>(&User::name, "$.field"))

means

CREATE INDEX IF NOT EXISTS \"idx\" ON \"users\" (JSON_EXTRACT(\"name\", '$.field'))
⭐ Dynamic set

Dynamic set is the same things as static set function (it is not a container, it is function which is used in update_all expressions) but it has variable amount of arguments which can be changed at runtime. dynamic_set is a similar thing like dynamic_order_by.

auto set = dynamic_set(storage);
expression.push_back(assign(&User::id, 5));
if (...) {
    expression.push_back(assign(&User::name, nameVariable));
}
storage.update_all(set, where(...));

dynamic_set can be used just like set (the static one) but please beware that get functions will work incorrectly with it cause get needs expressions fully known at compile time. Also dynamic_set has one minor limitation: dynamic_set prints literal arguments as ? instead of real values. It may be fixed in future releases.

⭐ Daisy chaining concatenation operator
select(c("first name") || " " || "last name");

means

SELECT 'first name' || ' ' || 'last name'
⭐ Multi-table select

One can run

select(columns(asterisk<X>(), asterisk<Y>()), ...);

to get columns of several tables.

Curated list of corrections and improvements
  • ⚙️ Removed dependency on RTTI
  • ⚙️ Compilation time improvement #1161
  • ⚙️ Corrected library dependencies on Catch2 and sqlite3 in CMake, which improves the process of finding or building them
  • ⚙️ Fixed a bunch of warnings (unqualified call to std::move() and std::forward(), unused parameters)
  • ⚙️ Fixed sync'ing the eponymous virtual table dbstat
  • ⚙️ Fixed a bunch of errors in C++20 mode in environments that lack C++20 library features
  • ⚙️ Fixed serialization of EXISTS clause, which must be always enclosed in parentheses
🐞List of bug fixes