Commit Graph

551 Commits

Author SHA1 Message Date
silverqx b285f54430 added support to pass sslmode for PostgreSQL
It can be passed by the DB_PGSQL_SSLMODE env. variable.
2023-01-21 18:35:23 +01:00
silverqx 5ab041512c tom whitespaces 2023-01-19 14:22:21 +01:00
silverqx 85dddfbcaf fixtypo cmake comments 2023-01-17 16:52:46 +01:00
silverqx 612437e8f2 tests used constants 2023-01-11 18:00:10 +01:00
silverqx f63ebf9f19 bugfix tests use charset and collate from env.
When the DB_MYSQL_CHARSET or DB_MYSQL_COLLATION was changed then tests
started failing, so to verify queries use these values from
env. variables.
2023-01-11 17:57:18 +01:00
silverqx cb803fede6 tests added MySQL quotes 2023-01-10 12:07:12 +01:00
silverqx a83dd8ce50 suppressed clang tidy warnings
Primarily in models and in one test case.
2023-01-06 21:22:18 +01:00
silverqx eae7e12981 removed unused #include 2023-01-06 19:30:09 +01:00
silverqx 636b4d1ead added support for SSL connections
If the DB_MYSQL_SSL_CERT/KEY/CA env. variables are set then used them
for the MySQL SSL connections in all tests, tom, and tom_testdata.
2023-01-06 19:12:35 +01:00
silverqx 4145de89a9 wrapped include in macro 2022-12-20 16:15:44 +01:00
silverqx ec89b88ef8 tests whitespaces
[skip ci]
2022-12-19 19:40:51 +01:00
silverqx ba6551daf8 bump versions to TinyORM v0.26.0 and tom v0.5.2
Last two TinyORM and tom releases was about performance optimizations.

Practically no performance gain, especially in production builds,
the MSVC optimized builds are amazing.

Some perf. gain in debug builds, but only few milliseconds,
from 50-200ms, and so many perf. optimizations done. 😵‍💫

 - bump also to TinyUtils v0.2.1 (forgotten version bump)
2022-12-19 18:57:17 +01:00
silverqx f0948e8305 tests renamed test methods 2022-12-19 11:07:10 +01:00
silverqx 10262774bb renamed local variable 2022-12-17 21:15:14 +01:00
silverqx a7a8dea944 used << instead of append() for lists everywhere 2022-12-15 11:17:25 +01:00
silverqx 3246c8ad89 added reserve() 2022-12-12 18:58:56 +01:00
silverqx 9bf9888a15 moved all Q_GLOBAL_STATIC from anonym. namespace 2022-12-11 14:16:41 +01:00
silverqx 9e22233c15 tests made method static 2022-12-05 18:57:20 +01:00
silverqx 534d27eb1b bugfix access model using qualified-id 2022-12-05 17:09:20 +01:00
silverqx 05bd76acb2 tests made bunch of methods static
- also suppressed warnings for all auto test methods
2022-12-05 16:59:13 +01:00
silverqx 482eebabe7 tests bugfix occasional failure (<5% rate)
The not-dirty model will not be updated that was the reason
for occasional failures.
2022-11-21 17:47:52 +01:00
silverqx 3d068f1164 tests used string constants for common strings 2022-11-21 17:12:41 +01:00
silverqx 3b5b2dcb8c tests whitespaces 2022-11-21 16:39:46 +01:00
silverqx 8910412df4 tests unified .insertGetId() formatting 2022-11-21 16:35:32 +01:00
silverqx 5032fcddae tests used QDateTime ctor instead of fromString
For all QDateTime-s with time zone, whole TinyORM project doesn't
contain even one QDateTime::fromString() method call. 😮
2022-11-21 15:58:34 +01:00
silverqx 2f3f3c9552 tests QDateTime ctor instead of fromString
For all UTC and a local time QDateTime instances, except eg. +02:00
QDateTime-s with time zone.
2022-11-19 14:17:42 +01:00
silverqx 5d6f39df7a tests QDateTime ctor instead of fromString 2022-11-19 11:31:22 +01:00
silverqx f115c99272 tests changed to QDate ctor instead of fromString 2022-11-19 11:07:16 +01:00
silverqx 7095da30c4 tests used QCOMPARE instead of QVERIFY 2022-11-19 09:25:28 +01:00
silverqx c644a9f591 added whereDate/Time/Month/Day/Year
- added also whereEqXyz() and orWhereXyz() inline shortcuts
 - added all proxy methods
 - added unit and functional tests
2022-11-18 18:26:28 +01:00
silverqx 6b6b192a82 used QLatin1Char everywhere
Except short parameters for tom because it would make code formatting
and code look much worse. 🫤
2022-11-12 03:19:09 +01:00
silverqx b4bb44e2a4 removed useless private 2022-11-11 09:49:44 +01:00
silverqx 097ac505e5 bugfix release build 2022-11-09 19:18:57 +01:00
silverqx b20c337765 tests avoided crash if MySQL TZ tables are empty
Use the +00:00 time zone instead of the UTC TZ if MySQL time zone tables
are empty.
2022-11-09 10:17:45 +01:00
silverqx 4d77307d38 tests used +00:00 for MySQL instead of UTC
MySQL database in GitHub actions images (Windows/Linux) doesn't have
populated TZ tables, so tests are failing, I'm not 100% about this, but
will see.
2022-11-08 19:47:40 +01:00
silverqx b56d68543b added DatabaseConnection::scalar()
- added tests
2022-11-08 09:01:17 +01:00
silverqx b8f10e2347 added Model::only()
Get a subset of the model's attributes.

 - also added functional tests
2022-11-07 14:43:32 +01:00
silverqx b277a2ffbe finished refactor to Orm::SqlQuery
Changed the DatabaseConnection::insert()/statement() return value to
the Orm::SqlQuery, after this lot of code had to be updated
to the SqlQuery.

 - updated also tests for BuildsQueries each/chunk/...
2022-11-07 11:17:19 +01:00
silverqx f6e33f1e67 enhanced and fixed Model instantiation
- primarily fixed instantiation with Default Attribute values with
   the QDateTime
 - revisited ctors and instance methods
 - added instanceHeap methods, create model instance on the heap
 - added instance method overloads with the connection override param.
 - added tests for all these new and old methods and ctor-s
 - used Model::instance() related methods all over the TinyORM to
   correctly support Model instantiation with Default Attribute values
   with the QDateTime
 - added a new Model constructor with the DontFillDefaultAttributes tag
   that instantiates a Model class without fill default attributes, to
   bypass CRTP problem with the QDateTime; this ctor is called from
   the instance()-related methods and the fill() method is called on
   already instantiated Model
   methods
 - updated NOTES.txt where the raw Model ctor-s were called
2022-11-05 18:45:31 +01:00
silverqx 23253155ee tests bugfix forgot to change to NullVariant-s 2022-11-01 11:06:07 +01:00
silverqx a8f70f847f tests test fixed timezone on Custom Pivot model
Testing whether fixing the QDateTime's timezone works correctly
on Custom Pivot model.

 - also tested the QtTimeZoneType::DontConvert, so when
   the fixing/converting behavior is disabled
2022-11-01 10:46:59 +01:00
silverqx 34951db030 fixtypo 2022-11-01 10:44:40 +01:00
silverqx 13244d6fa6 fixtypo 2022-11-01 10:39:52 +01:00
silverqx 86ac4ba5d1 tests casting attributes on Custom Pivot model
Testing withCasts() on many-to-many and u_casts on Custom Pivot model.
2022-11-01 10:27:55 +01:00
silverqx e6b5b07f42 used using decl. instead of alias for Helpers 2022-11-01 08:36:36 +01:00
silverqx 61c4b51b67 bugfix fixed timezone in pretended queries
Call DatabaseConnection::prepareBindinds() also for the pretended
queries.

The DatabaseConnection::prepareBindinds() call in DC::run<>() called
early only once to avoid calling it two or more times for performance
reasons.

 - fixed tests
 - also added Helpers::set/convertTimeZone() static helper methods
   that fix time zone according to the given connection name
2022-11-01 08:29:10 +01:00
silverqx 54882518c1 tests added test for QtTimeZoneType::DontConvert 2022-10-31 16:34:46 +01:00
silverqx 5f4b3f11bb updated comment for return_qdatetime 2022-10-31 16:34:29 +01:00
silverqx 9eb9197f79 tests fixtypo 2022-10-31 14:55:53 +01:00
silverqx 95d0b0c7f1 updated NOTES.txt - Handling integer values 2022-10-31 10:39:32 +01:00