---
sidebar_position: 8
sidebar_label: 📄 Features Summary
hide_table_of_contents: true
description: List that quickly summarizes all TinyORM features.
keywords: [c++ orm, tinyorm, features, summary, features summary]
---

# Features Summary

- [Summary List](#summary-list)
- [Showcase Images](#showcase-images)

## Summary List

The following list quickly 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 attributes 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
    - supports defining __Accessors__ (transform attribute value when it is accessed; eg. building value from multiple attributes)
- __compiled database migrations and seeders__ 🕺
  - create, update, drop, and rename database tables
  - create, __update__, 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)__ 🥳
  - tab completion is as accurate as possible
    - completes commands, long and short parameters, argument values
    - even connection names can be completed
  - migrate, fresh, refresh, rollback, and reset migrate operations
  - install and uninstall migration repository (table that tracks migrations and batches; table name can be customized)
  - seed and wipe database operations
  - 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
- __others__ 🛝
  - a huge amount of code is unit tested, currently __3378 unit tests__ 🤯
  - C++20 only, with all the latest features used like concepts/constraints, ranges, __smart pointers__ (no `new` keyword in the whole code base 😎), folding expressions
  - qmake and CMake build systems support
    - CMake __FetchContent__ module support 🤙
    - __LTO__ support (backed up by CI)
  - vcpkg support (official [tinyorm](https://github.com/microsoft/vcpkg/tree/master/ports/tinyorm) vcpkg port)
    - official port doesn't allow to have alternative implementations so it doesn't contain __TinyDrivers__
    - unofficial [tinyorm](https://github.com/silverqx/TinyORM/tree/main/cmake/vcpkg/ports/tinyorm) vcpkg port with __TinyDrivers__ support (currently MySQL only)
  - it's really fast, you can run 1000 complex queries in 500ms (heavily DB dependent, the PostgreSQL is by far the fastest) ⌚
  - extensive documentation 📃
  - ...

:::info
See the `TinyDrivers` [Features summary](tinydrivers/getting-started#features-summary).
:::

## Showcase Images

###### Tom console application

<img src={require('./database/assets/img/migrations/tom_cli.png').default}
    alt='TinyORM - Tom console application - Showcase'
    title='Tom console application' />

###### Passed all unit tests 🥳

<img src={require('./assets/img/features-summary/tinyorm-passed_all_unit_tests.png').default}
    alt='TinyORM - Passed all unit tests - Showcase'
    title='Passed all unit tests' width='700' className='no-blurry' />

#### TinyOrmPlayground

The [TinyOrmPlayground](https://github.com/silverqx/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](database/getting-started.mdx#introduction).

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. The connection summary is logged at the end of every database connection and the application summary is logged before an exit. Whole TinyOrmPlayground application is configurable through the [src/configuration.hpp](https://github.com/silverqx/TinyOrmPlayground/blob/main/src/configuration.hpp) class.

###### TinyOrmPlayground single-threaded

<img src={require('./assets/img/features-summary/tinyormplayground-single-threaded.png').default}
    alt='TinyORM - Invoked TinyOrmPlayground single-threaded - Showcase'
    title='Invoked TinyOrmPlayground single-threaded' />

###### TinyOrmPlayground multi-threaded

<img src={require('./assets/img/features-summary/tinyormplayground-multi-threaded.png').default}
    alt='TinyORM - Invoked TinyOrmPlayground multi-threaded - Showcase'
    title='Invoked TinyOrmPlayground multi-threaded' />
