MyGit

v1.8.2

fnc12/sqlite_orm

版本发布时间: 2023-03-24 21:55:01

fnc12/sqlite_orm最新发布版本:v1.9(2024-08-24 10:26:18)

⭐ 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 https://github.com/fnc12/sqlite_orm/pull/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

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-03-24发行的版本