Commit Graph

8 Commits

Author SHA1 Message Date
silverqx
a2714be30e added schema builder 🔥🚀
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
2022-03-22 09:53:33 +01:00
silverqx
89f8566d33 replaced TINYORM_COMMON_NAMESPACE with macro 2021-10-19 19:40:17 +02:00
silverqx
4b0d23dcc3 used rvalue for DB connection resolver 2021-09-18 19:19:02 +02:00
silverqx
84e456060b added support for table prefixes
- also added tests
2021-05-28 18:23:05 +02:00
silverqx
3ca6a7b0e2 fixed clazy warnings
function-args-by-value, function-args-by-ref
2021-05-10 07:34:30 +02:00
silverqx
0792c78b19 renamed schema grammars and builders
- renamed to avoid the same name conflicts
 - removed object_parallel_to_source from qmake CONFIG
2021-04-11 18:56:18 +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
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