Skip to content

v1.3

Compare
Choose a tag to compare
@fnc12 fnc12 released this 11 Aug 21:44
· 2462 commits to master since this release
24283f6
⭐ 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 syntax storage.select(asterisk<T>()) returns std::tuple of mapped members' types

  • CAST(expression AS type) expression with cast<T>(expression) syntax

  • ⭐ added julianday function

  • 🚀 FOREIGN KEY now works with composite PRIMARY 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 with std::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