Cutelyst 2.13 and ASql 0.19 released

Cutelyst the C++/Qt Web Framework and ASql the ASync SQL library for Qt applications got new versions.

Thanks to the work on ASql Cutelyst got some significant performance improvements on async requests, as well as a new class called ASync, which automatically detaches the current request from the processing chain, and attaches later on when it goes out of scope.

With the ASync class you capture it on your ASql lambda and once the query result arrives and the lambda is freed and the ASync object gets out of scope and continues the processing action chain.

KDAB's fix on a 10 year old bug raised my attention back to a note on QTcpSocket documentation:

Note: TCP sockets cannot be opened in QIODevice::Unbuffered mode.

Which is actually wrong, according to the source code, Cutelyst has been using buffered mode since always due that, so hopefully this new version will be a bit faster and consume less memory, it's important to notice that once the Kernel tells it's going to block QTcpSocket writes get buffered anyway.

Now talking about ASql you might notice the jump on release versions, this is because I've been experimenting some changes and didn't want to write a post at each new feature.

ASql is now at the closest API I'd like it to be, unfortunately one of my goals that would be to be able to handle it's AResult object to Grantlee/Cutelee and be able to iterate over it's records just once, but the call QVariant::canConvert with QVariantList must succeed and the class be able to be casted to QAssociativeIterable or QSequentialIterable, which I didn't managed to get it working in a way I like.

But AResult has hash() and hashes() methods that convert the data to a format that can be used in templating.

On the plus side I added iterators (if you have experience with iterators please review my code as this was the first time I wrote this kind of code) that also work on for ranged loops, and they also have faster type conversion methods, instead converting the data to a QVariant type, and them using QVariant to get the data out of it, one can just call toInt() which will get the int straight from the result set without checking each time if it's an int.

Added AMigrations which is an awesome database maintenance class that is both simple and helpful to maintain database schemas.

  • ACache class to cache special queries
  • Support for data inside QJsonValue
  • Single Row mode (the lambda get's called once per result)
  • Prepared Queries
  • Scoped Transaction class
  • Notifications - this is my favorite PostgreSQL feature, it's hard to image some other big databases lack such an useful feature.

Oh, and Cutelyst results on TechEmpower already got better thanks to ASql, hoping to see even better results when I update the tests to 2.13 that has Unbuffered and faster async handlying.

https://github.com/cutelyst/asql/releases/tag/v0.19.0

https://github.com/cutelyst/cutelyst/releases/tag/v2.13.0