- all tests are ran against SQLite test database too 🎉🔥
- removed default models connection for tests, because I'm testing
models for all database connections and the connection is controlled
by global test data, so every test is ran against all the
supported databases
- added test code controlled by TINYORM_TESTS_CODE preprocessor macro,
which enables connection override in the BaseModel
- build tests only when the "CONFIG += build_tests" was added to the
qmake command
added php script to create databases
- script creates MySQL and SQLite databases
- script populate this databases with test data
- connection credentials are provided through the DB_ env. variables
other changes
- added api to enable statement counters for the given connections
- added BaseModel::truncate test
Relationship can be created by the BaseModel::belongsToMany method.
Added common Pivot model class for a pivot table that extends
the BasePivot<PivotModel>, so a user can extend this class to define
custom pivot model class.
Pivot relation is saved under the pivot key and can be customized by
the BelongsToMany::as method.
Can be selected custom columns in the pivot table by the help with
the withPivot() method.
Can be selected default or custom timestamp columns with withTimestamps
method.
Added example model classes Tag and Tagged for the pivot table, which
demonstrates all implemented features.
Pivot model relations are ignored during refresh.
- added torrent_tags and tag_torrent tables to the test database
- added tag_properties to the test table to test eager load relations
on the pivot table
- added Tag model and Tagged pivot model
- used friend declaration instead of friend class
- fixed typos and whitespaces
- removed unnecessary empty cpp files, without any implementation
methods
- used using BaseModel::BaseModel in all models
- fixed template parameter names in the Relation class
- moved the getKeys method up to the Relation class
Huge commit, added following documentation pages:
- Database: Getting Started
- Database: Query Builder
- TinyORM: Getting Started
- TinyORM: Relationships
Also fixed and added many features to match behavior described
in the documentation.
- added Orm::DB facade
- made DatabaseManager strict singleton
- added BaseModel/TinyBuilder::without method and also tests
- bugfix affecting statements always returned 1
- removed defaultConnection argument from the DatabaseManager::create
- added many proxy methods from DatabaseManager -> DatabaseConnection,
for transactions, select, update, remove, ... type methods and
DB::raw method
- added JoinClause::orOn method
- added QueryBuilder::groupBy overload
- added where type proxy methods to the Tiny::Relations::Relation
- added some missing where and order type proxy methods
to the TinyBuilder
- fixed typos and some minor fixes in a comment texts
- added feature which logs also transaction queries
- added a new exception class SqlTransactionError
- added overloaded methods to the
ConnectionInterface::savepoint/rollbackToSavepoint that takes size_t