Commit Graph

1120 Commits

Author SHA1 Message Date
silverqx 710cdb5358 used decltype() to obtain a type 2022-05-16 14:25:29 +02:00
silverqx d4557fc705 added database seeder 🔥🎉
The db:seed command invokes the root seeder DatabaseSeeder which can
invoke another seeders using the call() related methods. The root seeder
can be set by the --class command-line option and also by the --seeder
cmd. line option on some other commands like migrate:fresh/refresh.

Seeders can be passed to the Tom application in the similar way like the
migrations using the TomApplication::seeders<>() method or through the
constructor.

Arguments can be passed to the call<>() method, then the seeders run()
method will not be called using the virtual dispatch but using the type
traits. Of course the arguments passed to the call<>() method has to
match with the run() method parameters.

Others:

 - unified usingConnection() across all commands, this functionality was
   extracted to own class, previous it was a part of the Migrator class,
   so now every command even if it doesn't use Migrator can call
   the usingConnection() and it correctly sets a default connection and
   SQL queries debugging on the base of the -vvv command-line argument
 - a default database connection is now required, if not set then
   the exception will be thrown
 - added example seeders to the Tom application
2022-05-16 14:25:29 +02:00
silverqx 1b3b431873 extracted Model unguarded to own class
Extracting these guard related methods to own class allows to call
GuardedModel::unguarded() regardless of a template parameters needed
on the Model class, before was needed to call
Model<Torrent, Relations..>::unguarded().

 - also made the g_unguarded atomic
 - bugfix reguard() try-catch-finally in GuardedModel::unguarded()
2022-05-16 14:25:24 +02:00
silverqx ad818845d1 removed duplicate code 2022-05-16 10:28:38 +02:00
silverqx c238e3fd33 made some methods static 2022-05-16 10:27:46 +02:00
silverqx bf44d45573 added commented code 2022-05-16 10:22:26 +02:00
silverqx aa39fc7e76 fixed clang-tidy warning 2022-05-15 22:44:50 +02:00
silverqx ee6f802935 enhanced comment 2022-05-15 22:44:03 +02:00
silverqx 99dca5411f added -Clean parameter to Lint-TinyORM.ps1 2022-05-15 22:42:06 +02:00
silverqx 9a06a5a92f cmake used absolute path 2022-05-12 16:11:46 +02:00
silverqx d4a2dec3f0 enhanced Lint-TinyORM.ps1 related scripts 2022-05-12 16:06:36 +02:00
silverqx 5366e6452c added migrations to linters 2022-05-12 16:05:56 +02:00
silverqx 063c9bca23 bugfix workflows migrate:install for tom example 2022-05-12 14:34:40 +02:00
silverqx ba8b83ce0c docs, enhanced migrations
- note about compiled migrations
 - tip about the -vvv command-line argument
 - links to the tom example and tom migrations for unit tests source
   code
2022-05-12 14:23:20 +02:00
silverqx da9608202d avoid migrations table names collision
tom example, main unit tests migrations and migrations table used during
unit testing have different names.
2022-05-12 13:52:23 +02:00
silverqx 2d0212f9c1 added TOM_TESTS_ENV to tst_migrate 2022-05-12 13:38:49 +02:00
silverqx 407c389cc8 added a new tom related env. variables to dotfiles 2022-05-12 13:38:11 +02:00
silverqx 27a4d7a7ee docs changed documents order 2022-05-12 13:13:18 +02:00
silverqx 91c2a0b591 bugfix in workflow tom_testdata filename 2022-05-12 13:09:08 +02:00
silverqx 285f654278 bugfix in skip-mysql-migrate condition 2022-05-12 13:01:11 +02:00
silverqx 3b05cd1bed used own tom migrations in unit tests 🎉 2022-05-12 12:25:22 +02:00
silverqx cf7c76d6d7 workflows added no-ansi for tom and testing env. 2022-05-12 10:54:42 +02:00
silverqx ed85de0cc0 updated todo task 2022-05-12 10:32:27 +02:00
silverqx 2b20f64899 docs added caution about Visual Studio 2022 2022-05-12 10:22:56 +02:00
silverqx aa5b6f2ea9 bugfix don't show debug sql for db:wipe command 2022-05-12 10:22:04 +02:00
silverqx b816c932dc removed unused code 2022-05-12 10:20:02 +02:00
silverqx 43c676a64d fixtypo 2022-05-12 10:19:02 +02:00
silverqx 94c0e793af fixtypo 2022-05-12 10:18:40 +02:00
silverqx 7d236c93d0 docs, fixtypo
[skip ci]
2022-05-11 15:33:30 +02:00
silverqx 3ddc6c45bd updated docs
[skip ci]
2022-05-11 15:25:26 +02:00
silverqx ca3c217eaa docs updated TINYTOM_MIGRATIONS_DIR value
[skip ci]
2022-05-10 18:24:52 +02:00
silverqx 306796bc29 renamed TINY/TOM_MIGRATIONS_DIR
Renamed cmake option and macro from the TINY/TOM_MIGRATIONS_PATH to the
TINY/TOM_MIGRATIONS_DIR.

 - updated documentation
 - extracted init. code for the TINYTOM_MIGRATIONS_DIR to the own cmake
   macro
2022-05-10 18:16:31 +02:00
silverqx f7e6a22df7 reverted silent in common.pri
This config option was removed by mistake.
2022-05-10 18:14:08 +02:00
silverqx e574bee5d8 fixtypo 2022-05-10 18:13:12 +02:00
silverqx 30905da177 bugfix bad path for tom version.hpp 2022-05-10 18:12:48 +02:00
silverqx 380ca1c11d updated CMake options in NOTES.txt 2022-05-10 18:12:21 +02:00
silverqx ea54b114c8 removed todo tasks 2022-05-10 18:11:56 +02:00
silverqx 923d54567e cmake removed useless BUILD_INTERFACE 2022-05-10 16:08:45 +02:00
silverqx be6a77eb74 docs, unified Consume TinyOrm library (qmake)
[skip ci]
2022-05-06 17:28:16 +02:00
silverqx 2a43df8afe fixed clang-tidy warning on linux 2022-05-06 16:55:40 +02:00
silverqx c65378fcb0 docs, moved source code sections 2022-05-06 16:40:42 +02:00
silverqx b09931b203 enhanced TinyOrm.pri and tom.pri
They can now also set up include directories and link against
the TinyORM library. It's accomplished by the TINYORM_BUILD_TREE
variable.

 - also updated all examples in the documentation
 - manually tried to recompile all the examples on all supported
   platforms
 - enhanced tiny_version_numbers.prf, throw error when the version file
   was not found or when the parsing failed
 - used qmake/common.pri in the TinyOrm.pri and tom.pri,
   the consequences are that the user can use eg "CONFIG += disable_orm"
   and all others supported qmake configurations on his own project, so
   if the TinyORM was compiled with some set of flags then the same set
   of flags has to be used on the compiled project, CMake is doing this
   automatically of course
 - added Configure using .qmake.conf to the hello world example
2022-05-06 16:14:33 +02:00
silverqx cdbd7c296c docs, number of unit tests
[skip ci]
2022-05-05 22:28:15 +02:00
silverqx 5fb7858433 docs, small fixes
[skip ci]
2022-05-05 22:18:45 +02:00
silverqx ddb3c02a0f docs, updated url to the main branch
[skip ci]
2022-05-05 22:15:09 +02:00
silverqx 527a55b58c updated README.md
[skip ci]
2022-05-05 22:12:31 +02:00
silverqx e6cb56a680 docs, updated supported compilers
[skip ci]
2022-05-05 22:12:17 +02:00
silverqx f7bbd743f5 fixed globals in tests
[skip ci]
2022-05-05 22:02:36 +02:00
silverqx 94ec2a195d bump TinyORM version to v0.3.0 v0.3.0 2022-05-05 21:02:00 +02:00
silverqx c3cf8ac184 docs, fixes on building migrations page
Fixes discovered during following this tutorial step by step.
2022-05-05 18:51:29 +02:00