mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-01-06 10:59:31 -06:00
The MySQL >=8.0.19 supports aliases in the VALUES and SET clauses of INSERT INTO ... ON DUPLICATE KEY UPDATE statement for the row to be inserted and its columns. It also generates warning from >=8.0.20 if an old style used. This enhancement detects the MySQL version and on the base of it uses alias during the upsert call. Also a user can override the version through the MySQL database configuration. It helps to save/avoid one database query (select version()) during the upsert method call or during connecting to the MySQL database (version is needed if strict mode is enabled). - added unit and functional tests - updated number of unit tests to 1402 - updated upsert docs - added ConfigUtils to avoid duplicates Others: - added the version database configuration everywhere - docs added few lines about MySQL version configuration option - docs updated database configurations, added a new missing options
7.7 KiB
7.7 KiB
TinyORM
TinyORM is a modern ORM library that makes interacting with a database extremely simple.
The code is written in the modern c++20 way and is well tested with the unit and functional tests. Almost all the query builder methods are unit tested. The TinyORM's query builder code and the code which is responsible for obtaining relationships, is tested by functional tests against all supported databases. The code coverage is good enough to guarantee API and behavior compatibility.
Documentation
Whole library is documented as markdown documents:
Features Summary
- simple database connections management 🧬
- database manager that helps with the database connections management
Orm::DBfacade class for nicer and shorter syntax- MySQL, SQLite, and PostgreSQL support for all features
- multi-threading support 👀
- overhauled 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
- 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 🚀
- all query builder methods are proxied to the model instances and also to the relation instances 🤯 (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, default models, and default model attributes
- querying relationships existence/absence using the has, whereHas, and hasNested methods (using dot notation for selecting nested relationships users.posts.comments)
- 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
tomconsole application with tab completion for all shells (pwsh, bash, zsh) 🥳- scaffolding of models, migrations, and seeders
- overhauled models scaffolding, every feature that is supported by models can be generated using the
tom make:modelcli command
- a huge amount of code is unit tested, currently 1402 unit tests 🤯
- C++20 only, with all the latest features used like concepts/constraints, ranges, smart pointers (no
newkeyword 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 📃
- ...



