v1.3
版本发布时间: 2019-08-12 05:44:44
fnc12/sqlite_orm最新发布版本:v1.9(2024-08-24 10:26:18)
⭐ Complex subqueries
SELECT cust_code, cust_name, cust_city, grade
FROM customer
WHERE grade=2 AND EXISTS
(SELECT COUNT(*)
FROM customer
WHERE grade=2
GROUP BY grade
HAVING COUNT(*)>2);
now can be called with this way:
auto rows = storage.select(columns(&Customer::code, &Customer::name, &Customer::city, &Customer::grade),
where(is_equal(&Customer::grade, 2)
and exists(select(count<Customer>(),
where(is_equal(&Customer::grade, 2)),
group_by(&Customer::grade),
having(greater_than(count(), 2))))));
⭐ EXCEPT and INTERSECT
All compound operators now are available:
SELECT dept_id
FROM dept_master
EXCEPT
SELECT dept_id
FROM emp_master
is just
auto rows = storage.select(except(select(&DeptMaster::deptId),
select(&EmpMaster::deptId)));
and
SELECT dept_id
FROM dept_master
INTERSECT
SELECT dept_id
FROM emp_master
is just
auto rows = storage.select(intersect(select(&DeptMaster::deptId),
select(&EmpMaster::deptId)));
-
⭐ Column aliases
-
⭐
SELECT * FROM table
with syntaxstorage.select(asterisk<T>())
returnsstd::tuple
of mapped members' types -
⭐
CAST(expression AS type)
expression withcast<T>(expression)
syntax -
⭐ added
julianday
function -
🚀
FOREIGN KEY
now works with compositePRIMARY KEY
🚀 added simple arithmetic types biding to WHERE conditions
bool myFilterIsOn = getMyFilterValue();
auto values = storage.get_all<User>(where(!myFilterIsOn and like(&User::name, "Adele%")));
- 🚀 improved performance - replaced
std::shared_ptr
withstd::unique_ptr
inside storage, view iterator and aggregate functions - ⚙️ added Windows CI with Appveyor (thanks to @soroshsabz)
- 🐞 Bug fixes - fixed runtime error which can be faced during
storage::iterate()
call - ⚠️ Minor warning fixes
1、 sqlite_orm.h 358.09KB