Commit Graph

900 Commits

Author SHA1 Message Date
silverqx e5c3675507 used Parent/RelatedKeyType alias everywhere 2022-08-21 15:44:02 +02:00
silverqx f4fbcc64fa updated todo task 2022-08-21 15:32:34 +02:00
silverqx 847eddd9ca bump version to TinyORM v0.18.1 2022-08-21 15:23:03 +02:00
silverqx 39e1c7f921 tests added Model::replicate tests
- also extracted common code to
   AttributeUtils::exceptAttributesForReplicate
2022-08-21 14:17:41 +02:00
silverqx 13bba6f2fc added Model::operator==() 😮 2022-08-20 16:20:52 +02:00
silverqx a55e4c2595 added noexcept to getters 2022-08-20 15:55:26 +02:00
silverqx 4d90719670 reordered methods 2022-08-20 15:44:38 +02:00
silverqx 39f6b810df added section comments 2022-08-20 15:42:38 +02:00
silverqx 4261d477c7 whitespaces 2022-08-20 15:42:07 +02:00
silverqx fc0f1b79de added section comments 2022-08-20 11:07:24 +02:00
silverqx da724693a2 added section comments 2022-08-20 11:03:05 +02:00
silverqx 3324cfa968 bump version to TinyORM v0.18.0 2022-08-19 19:42:38 +02:00
silverqx 96b80488d0 added HasOne/BelongsTo::is/isNot
It allows comparing a related model without issuing a query to retrieve
that model.

 - added functional tests for both HasOne and also BelongsTo relations
 - added docs

Others:

 - added the new unit test case tst_Relations_Connection_Independent
2022-08-19 16:31:38 +02:00
silverqx 58fd7dd01a enhanced Model::is/isNot
- better inline comments
 - check the table first
 - added ModelConcept for ModelToCompare template parameter
2022-08-19 14:52:28 +02:00
silverqx 9d8c15bf29 whitespaces and formatting 2022-08-19 14:50:41 +02:00
silverqx cc585638c6 added missing getters to BelongsTo relation 2022-08-19 14:43:44 +02:00
silverqx 6e603de56f whitespaces 2022-08-19 08:44:03 +02:00
silverqx 30dd9e823d added section comment 2022-08-19 08:10:57 +02:00
silverqx 20c54933f9 removed todo task 2022-08-19 07:39:20 +02:00
silverqx a59b78b392 updated todo task 2022-08-19 07:39:07 +02:00
silverqx 3a09be42e6 formatting, operators on the same line 2022-08-19 07:37:00 +02:00
silverqx f69f2eb543 removed std::optional for replicate except param. 2022-08-19 07:27:54 +02:00
silverqx 523601264c added Model::replicate
- also added move overload for Model::setRawAttributes
2022-08-18 21:07:23 +02:00
silverqx d54b041d81 added whereBetween and whereBetweenColumns
- added proxies
 - added unit and functional tests
 - added docs
 - updated number of unit tests to 1417
2022-08-18 11:12:48 +02:00
silverqx 31d606d59d bump versions to TinyORM v0.17.0 and tom v0.4.2 2022-08-17 18:14:30 +02:00
silverqx 43abc32192 removed constexpr 2022-08-17 17:12:37 +02:00
silverqx e6566fc474 used constFirst or front instead of at(0) 2022-08-17 13:45:29 +02:00
silverqx b3106b048a reordered methods in DB and DatabaseManager 2022-08-17 13:37:29 +02:00
silverqx 94d5b49adf added operator-> for conn. and config. hashes
Added operator-> for the DatabaseConfigurations/DatabaseConnectionsMap
hashes.

 - also made operator*, operator->, and get() constexpr and noexcept
2022-08-17 10:59:46 +02:00
silverqx f64f62902a fixtypo 2022-08-16 22:50:51 +02:00
silverqx 2c987ead90 bugfix tom count configs. instead of connections
Count registered connection configurations instead of opened
connections. 🫤

 - renamed connectionsSize to DB/DM::openedConnectionsSize()
 - added DB/DM::originalConfigsSize()
2022-08-16 21:15:51 +02:00
silverqx 3e6e3af9a0 made DM/DB::ConfigurationsType public 2022-08-16 21:09:36 +02:00
silverqx 05bdfda2b6 fixtypo 2022-08-16 21:08:00 +02:00
silverqx c86bc6a48f bump version to TinyORM v0.16.1 2022-08-15 14:08:57 +02:00
silverqx bc51c4733a renamed/unified connection parameters 2022-08-13 15:11:33 +02:00
silverqx bcb6d033aa added section comments 2022-08-13 15:10:50 +02:00
silverqx 2b1bed5e2a fixtypo 2022-08-13 15:09:17 +02:00
silverqx 45b94a77ec added TinyBuilder::upsert and proxies
The upsert method needed modification in the TinyBuilder, it has to also
manage model timestamps.

 - also added proxies
 - added functional test that also tests timestamps
 - added functional test on the BelongsToMany relation
 - updated number of unit tests to 1408
2022-08-13 14:06:01 +02:00
silverqx 59c046d743 whitespace 2022-08-13 13:20:06 +02:00
silverqx d0958e9a83 used auto instead of type 2022-08-13 13:19:52 +02:00
silverqx 502a0be478 avoid unnecessary variable initialization 2022-08-12 21:09:21 +02:00
silverqx 568ed37599 whitespace 2022-08-12 20:19:42 +02:00
silverqx ad25d7866f fixtypo 2022-08-12 20:19:35 +02:00
silverqx c388a0be18 bugfix missing include 2022-08-12 18:26:58 +02:00
silverqx 9a1646ff7c renamed parameter and variable 2022-08-12 17:35:28 +02:00
silverqx 5550d68eee added connection configuration getters to DB/DM
Added getters for obtaining connection configuration.

 - original configurations from the DatabaseManager
 - and configurations from the DatabaseConnection
2022-08-12 17:34:55 +02:00
silverqx 19c355cb00 changed method order 2022-08-12 16:08:57 +02:00
silverqx e436d9f63a extracted throwIfXyz method in DM 2022-08-12 15:39:10 +02:00
silverqx 5ff160dec5 use upsert alias on MySQL
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
2022-08-12 15:37:56 +02:00
silverqx d8a024a937 removed unused forward declarations 2022-08-12 11:57:51 +02:00