Commit Graph

19 Commits

Author SHA1 Message Date
silverqx
4c77f3d9b3 used using alias declarations in doc examples 2021-04-06 11:03:54 +02:00
silverqx
d5d25d73b2 added docs for SQLite connetions 2021-04-06 10:32:56 +02:00
silverqx
782c95c134 added documentation for default attribute values 2021-04-06 09:31:53 +02:00
silverqx
68446e3530 added SQLite database support 🔥🚀
- 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
2021-03-26 18:49:50 +01:00
silverqx
d5e8a7f0be added models used in many-to-many docs 2021-03-26 18:48:38 +01:00
silverqx
74579ce909 added documentation for many-to-many relations 2021-03-26 18:48:38 +01:00
silverqx
2fe171b4b3 changed position of friend and using BaseModel
Changed in all models and the documentation was updated too.
2021-03-26 18:44:04 +01:00
silverqx
0976e36d37 added the many-to-many type relationship
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
2021-03-26 18:07:21 +01:00
silverqx
ed6ca7961e updated documentation after added missing proxies 2021-03-26 18:07:20 +01:00
silverqx
ebe4ac56d0 added Common Rules to relationships documentation 2021-03-26 18:07:20 +01:00
silverqx
1a9b626f7e verified code examples in TinyORM documentation
- TinyORM: Getting Started
 - TinyORM: Relationships
2021-03-26 18:07:19 +01:00
silverqx
5c19409851 verified links in the documentation 2021-03-26 18:07:19 +01:00
silverqx
ccdaf8f835 fixed internal cross documentation links 2021-03-26 18:07:19 +01:00
silverqx
8fac2eb19a partially revisited TinyORM: Relations docs 2021-03-26 18:07:19 +01:00
silverqx
8e127e3e0b revisited TinyORM: Getting Started documentation 2021-03-26 18:07:19 +01:00
silverqx
b4eef2eee0 fixed documentation links 2021-03-26 18:07:18 +01:00
silverqx
8a810f87a4 revisited documentation
Database: Getting Started docs and updated README.md files
2021-03-26 18:07:18 +01:00
silverqx
c6469df3a8 updated README.md files 2021-03-26 18:07:18 +01:00
silverqx
24ff919f99 added documentation
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
2021-03-26 18:07:18 +01:00