Commit Graph

39 Commits

Author SHA1 Message Date
silverqx
867a5f6587 added missing raw methods
or/whereRaw(), groupByRaw(), or/havingRaw(), orderByRaw().

 - added docs
 - tested manually in Playground
2021-07-06 18:28:58 +02:00
silverqx
c65379d80f added docs for Subquery Joins 2021-07-06 11:04:40 +02:00
silverqx
d8e54d1b62 docs for Aggregates and Raw methods 2021-07-06 09:34:05 +02:00
silverqx
4dbc564704 small docs update 2021-07-05 11:26:16 +02:00
silverqx
23e0564313 updated docs 2021-06-02 21:42:05 +02:00
silverqx
890cc1a6f8 updated docs
Clarified the Relation name in belongsTo/belongsToMany relations.
2021-05-27 10:14:01 +02:00
silverqx
8e90efca99 minor docs update 2021-05-25 12:07:47 +02:00
silverqx
bd1c1e917f updated docs, Constraining Eager Loads and withOnly 2021-05-25 10:46:53 +02:00
silverqx
e17f64a1ac added isolation_level to docs 2021-05-24 12:01:37 +02:00
silverqx
ef4db51c4b updated docs, relations related changes
After the following changes:

 - get rid of Model::relationVisitor() in models
 - changed Model::u_with type to QVector<QString>
2021-05-24 11:49:34 +02:00
silverqx
c7e53bc1bc updated docs after non-affecting statements
After the following change:

 - return values for non-affecting statements.
2021-05-24 10:37:51 +02:00
silverqx
a313196feb updated README.md 2021-05-24 08:11:24 +02:00
silverqx
2a2f072ccf added BelongsToMany::save/saveMany/create/createMany
- added tests
 - updated documentation
 - added missing std::move in HasOneOrMany::save()
2021-04-30 22:13:33 +02:00
silverqx
02ebf6fce5 simplified many-to-many relation definition
- dynamic_cast() is not needed anymore, this is the result of following
   change:
   - relation factory methods return actual creating type instead
     of the general base Relation type"
 - also docs updated
2021-04-16 17:54:40 +02:00
silverqx
9ade54a539 added Default Models for HasOne and BelongsTo
The HasOne and BelongsTo can now return default model instead
of the nullptr.

 - also added tests
 - added documentation
 - updated test db structure, null foreign key in previewable files
 - to the test db into the previewable files added row without parent
 - relation factory methods return actual creating type instead of
   the general base Relation type
2021-04-16 13:29:42 +02:00
silverqx
c15eaab7bb renamed model.hpp include in documentation 2021-04-12 13:14:09 +02:00
silverqx
efb45346c3 renamed Model and Derived in documentation
- from BaseModel to Model
 - template parameter from Model to Derived

Result is Model<Derived, AllRelations...>.
2021-04-12 12:38:52 +02:00
silverqx
da749b0c88 added Pessimistic Locking
- QueryBuilder::lock/sharedLock/lockForUpdate
 - also added tests
 - added documentation
2021-04-11 12:26:52 +02:00
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
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