- added a new config. option dont_drop, allows to define table that
will be excluded during dropAllTables(), has a default value
spatial_ref_sys for PostGIS
- implemented fluent commands, used only by the PostgreSQL Comment
command
- added tests for PostgreSQL schema builder
- reworked tst_Migrate to be able to run on all supported connections,
currently PostgreSQL and MySQL
- updated docs
Unrelated:
- added a new reference class IndexDefinitionReference for a nice API
during index definition, contains algorithm and language
- unified selectFromWriteConnection() in schema builders
This command is very similar to the make:migration command except
the --create and --table command-line parameters. It provides the same
functionality but for seeders.
- updated docs TINYTOM_SEEDERS_DIR macro and TOM_SEEDERS_DIR for cmake
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
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()
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
Use utf8 on MinGW and ANSI with msvc.
The core of the problem is in the $$cat() and write_file() qmake
functions they don't know process UTF-8 encoded files, they use
the ANSI encoding.
Enhanced migration name detection for the make:migration, practically
all the possible combinations are allowed and handled correctly 👀😎.
Now is possible to pass the full migration name with the datetime prefix
and with the filename extension. All possible combinations are
supported.
Summarize, so an user can pass:
- classname that will be converted to the studly case
- filename without the datetime prefix (with or w/o extension)
- filename with the datetime prefix (with or w/o extension)
make:migration command is able to guess the table name and creation
status from the passed migration name on the command line.
If the migration name begins with the create_ string then the create
migration stub will be used.
If the migration name contains the (to|from|in)_ pattern then the update
migration stub will be used.
In all other cases an empty migration stub will be used.
Created own tomconstants for the Tom namespace (folder tom/) and used
them everywhere.
Others:
- removed Q_GLOBAL_STATIC_WITH_ARGS() in migrationcreator.cpp and used
getter with the local static const
User can provide a custom migrations path for the make:migration
command.
Default path is at database/migrations relative to the tom example
executable.
This allows to use the tom example as a real migration application and
the user doesn't have to create his own migration project.
Using:
- TomApplication::migrationsPath()
- TINYTOM_MIGRATIONS_PATH preprocessor macro, will be stringified
- TOM_MIGRATIONS_PATH CMake PATH option
Only partial names no matter of case can be passed, eg. mi:st for
the migrate:status, or m for the migrate command.
If the passed name is ambiguous then the error wall with all ambiguous
commands or namespaces is displayed, ambiguous commands also contain
a description.
Following positional arguments support guessing:
- main command name at 0 position
- command name passed to the help command
- namespace name passed to the list command
Added practically everything I wanted to have in except for updating
columns.
Needed to name the schema namespace as Orm::SchemaNs to avoid collision
with the Orm::Schema class.
- unit tests with great coverage
- new schema constants
- a new prefix_indexes and engine DB conncetion configurations
Others:
- IsModel tag
- enhanced columnize in the BaseGrammar
- used a new columnize logic in all grammars
- new constants
- new container utils class for joining containers
- new DB::driver() getter for QSqlDriver
- avoid possible crash in tests with pretend, added empty log checks
- clang tidy, excluded to word from short variable names
Transactions extracted to the Concerns::ManagesTransactions base class.
- bugfix includes
- logConnected()/logDisconnected() code wrapped in TINYORM_MYSQL_PING
- hitTransactionalCounters() extracted to Concerns::CountsQueries
- convertNamedToPositionalBindings() extracted to Concerns::LogsQueries
Queries counters extracted to the Concerns::CountsQueries base class.
- removed ConnectionInterface 😕😎🙌
- all methods are returning DatabaseConnection & instead of
ConnectionInterface
- includes cleanup after extraction
- explicit QStringLiteral and QChar
- fixed macro guard names
- inline from defn. to decl.
- whitespaces and comments
- added Q_DISABLE_COPY()
- removed friend class DB; from DM
- removed schemagrammar.cpp, was empty
While ORM can be disabled, Orm::Utils has been split into Orm::Utils
and Orm::Tiny::Utils (Orm::Tiny::TinyUtils alias).
So when ORM is disabled then utils used only in the ORM will be
excluded from a final build.
- bugfix cmake undefined ORM option in TinySources
Added TINYORM_DISABLE_ORM macro controlled by ORM for CMake and
disable_orm for qmake. When TINYORM_DISABLE_ORM macro is defined then
only the query builder without ORM is compiled.
Also excludes ORM-related unit tests.
Overrides default detection logic for thread_local and disable it
forcefully.
In qmake can be configured by "CONFIG+=disable_thread_local".
For Cmake DISABLE_THREAD_LOCAL option was added.
- allow using an environment variable VCPKG_ROOT instead of
CMAKE_TOOLCHAIN_FILE command-line option
- set VCPKG_TARGET_TRIPLET when VCPKG_DEFAULT_TRIPLET env. variable is
defined
- initial g++/clang build, ctest on MSYS2 UCRT64 on Windows Server 2022
- initial cmake build/ctest on Ubuntu 20.40
- initial cmake build/ctest on MSVC on Windows Server 2019
changed driver to QPSQL in tst_databasemanager
This avoids crash when QMYSQL driver's dll is unavailable.
QMYSQL driver is not shipped by default by Qt Windows MSVC installer.