Commit Graph

12 Commits

Author SHA1 Message Date
silverqx 36ed085381 updated markdown documentation
- added missing documentation for 'Inserting & Updating Related Models'
   in TinyORM: Relationships
 - added missing documentation for 'Deleting Models'
   in TinyORM: Getting Started
 - re-compared all documentation against latest Eloquent version
2021-04-10 16:24:03 +02:00
silverqx 20c03828ff added Mass Assignment feature
- added u_fillable on models used in tests that need it
 - added documentation for mass assignment
 - added tests for mass assignment feature
 - added new Torrent models for tests, which have set up u_fillable and
   u_guarded differently
 - added schema grammar, query post-processor, and schema builder, they
   was needed for database column listing during a mass assignment
   guarded attributes check, used to check if the given attribute is
   a valid guardable column
2021-04-09 10:19:19 +02:00
silverqx 4c77f3d9b3 used using alias declarations in doc examples 2021-04-06 11:03:54 +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 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 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 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