sqlite_orm v1.3 Release Notes

Release Date: 2019-08-11 // over 4 years ago
  • ⭐ Complex subqueries

    SELECT cust\_code, cust\_name, cust\_city, gradeFROM customerWHERE grade=2 AND EXISTS (SELECT COUNT(\*) FROM customer WHERE grade=2GROUP 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\_idFROM dept\_master EXCEPTSELECT dept\_idFROM emp\_master
    

    is just

    auto rows = storage.select(except(select(&DeptMaster::deptId), select(&EmpMaster::deptId)));
    

    and

    SELECT dept\_idFROM dept\_master INTERSECTSELECT dept\_idFROM 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