Skip to main content

Features Summary

Summary Listโ€‹

The following list fastly summarizes all the TinyORM features.

  • simple database connections management ๐Ÿงฌ
    • database manager that helps with the database connections management
    • Orm::DB facade class for nicer and shorter syntax
    • MySQL, MariaDB, SQLite, and PostgreSQL support for all features ๐Ÿ’Ž
    • multi-threading support ๐Ÿ‘€
    • SSL connections support ๐Ÿ”’
  • impressive query builder ๐Ÿ”ง
    • allows passing sub-queries and raw expressions practically everywhere, to column names, values, and to every SQL clause as select, where, joins, group by, having, order by ๐Ÿ”ฅ
    • a logical grouping that offers to wrap logical groups in parenthesis
    • chunked results for lower memory footprint โœจ
    • raw methods for all SQL clauses
    • all join types (left, right, cross, inner) and also join where clause support ๐Ÿซค
    • aggregate methods min, max, sum, increment, decrement, ...
    • whereExists and exists methods for an existence queries
    • transactions and pessimistic locking ๐Ÿ”’
    • of course, insert, update, and delete SQL clauses support
    • correct QDateTime time zone using the qt_timezone connection configuration option ๐Ÿ“… (returned QDateTime instances will have the correct time zone, and also works for an ORM)
      • this feature allows you to set up the database server time zone to the UTC and all returned QDateTime instances will have the correct UTC time zone
  • clever ORM with all relation types support ๐ŸŽ‰
    • one-to-one, one-to-many, and many-to-many relation types (also inverse relationships) ๐Ÿงจ
    • eager and lazy loading with custom select and constraints ๐Ÿš€
    • fluent ModelsCollection that expose a variety of map / reduce operations that may be chained using an intuitive interface โœจ
    • all query builder methods are proxied from the model instances and also from the relation instances back to the query builder ๐Ÿคฏ (everything that can be called on the query builder can also be called on the model and relation instances)
    • clean active record pattern
    • advanced features like timestamps, touching parent timestamps, soft deleting, default models, default model attributes, and attribute casting ๐Ÿค“
    • querying relationships existence/absence using the has, whereHas, and hasNested methods (using dot notation for selecting nested relationships users.posts.comments)
    • serializing models and collection of models including all nested relations to JSON and converting to vectors and maps ๐Ÿชก
      • supports controlling a custom date format during serialization
      • supports hiding and appending attributes
  • compiled database migrations and seeders ๐Ÿ•บ
    • create, update, drop, and rename database tables
    • create, drop, and rename table columns
    • extensive schema builder that allows creating of all possible column types
    • terser syntax for creating foreign keys and foreign key constraints
    • supports creating, and dropping column indexes (primary, unique, fulltext, spatial)
  • the tom console application with tab completion for all shells (pwsh, bash, zsh) ๐Ÿฅณ
    • scaffolding of models, migrations, and seeders
    • impressive models scaffolding, every feature that is supported by models can be generated using the tom make:model cli command
  • a huge amount of code is unit tested, currently 3366 unit tests ๐Ÿคฏ
  • C++20 only, with all the latest features used like concepts/constraints, ranges, smart pointers (no new keyword in the whole code ๐Ÿ˜Ž), folding expressions
  • qmake and CMake build systems support
    • CMake FetchContent module support ๐Ÿค™
  • vcpkg support (also the vcpkg port, currently not committed to the vcpkg repository โ˜น๏ธ)
  • it's really fast, you can run 1000 complex queries in 500ms (heavily DB dependant, the PostgreSQL is by far the fastest) โŒš
  • extensive documentation ๐Ÿ“ƒ
  • ...

See the TinyDrivers Features summary.

Showcase Imagesโ€‹

Tom console applicationโ€‹
TinyORM - Tom console application - Showcase
Passed all unit tests ๐Ÿฅณโ€‹
TinyORM - Passed all unit tests - Showcase


The TinyOrmPlayground project is my personal project where I have tested all the TinyORM database queries in the early development phases, currently, it executes ~1600 database queries across the whole TinyORM framework. Every query has a nice title header, is logged to the console, and is counted and measured (elapsed time). Every query also runs on all supported databases.

The TinyOrmPlayground project can be compiled in a single-threaded or multi-threaded mode. In the multi-threaded mode, every database connection runs in its own thread. At the end of every database connection is logged a connection summary and before an exit is logged the application summary. Whole TinyOrmPlayground application is configurable through the src/configuration.hpp class.

TinyOrmPlayground single-threadedโ€‹
TinyORM - Invoked TinyOrmPlayground single-threaded - Showcase
TinyOrmPlayground multi-threadedโ€‹
TinyORM - Invoked TinyOrmPlayground multi-threaded - Showcase