From 24296dd4b32a9dc35111cdd12dda86609a38dadc Mon Sep 17 00:00:00 2001 From: silverqx Date: Sat, 26 Mar 2022 16:54:17 +0100 Subject: [PATCH] fixtypo - also updated comment --- include/orm/schema/columndefinition.hpp | 5 +++-- include/orm/schema/schemaconstants_extern.hpp | 2 +- include/orm/schema/schemaconstants_inline.hpp | 2 +- include/orm/tiny/concerns/hasrelationstore.hpp | 4 ++-- include/orm/tiny/model.hpp | 1 + src/orm/schema/schemaconstants_extern.cpp | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/orm/schema/columndefinition.hpp b/include/orm/schema/columndefinition.hpp index 6d9d8ed89..2c7c34ee3 100644 --- a/include/orm/schema/columndefinition.hpp +++ b/include/orm/schema/columndefinition.hpp @@ -73,7 +73,7 @@ namespace Orm::SchemaNs QString algorithm {}; }; - /*! Foreign key constrains command. */ + /*! Foreign key constraints command. */ class ForeignKeyCommand : public CommandDefinition { public: @@ -184,7 +184,8 @@ namespace Orm::SchemaNs own struct for every or very similar commands. They are now allocated on the heap to save space because sizeof(ColumnDefinition) was 736 and that is too much, eg. if schema would contain 100 columns it would take - 73KB. + 73KB. After a commands extraction sizeof(ColumnDefinition) have decreased + to 496 bytes (~40% decrease) 😁. I have decided not to use polymorphic commands, I wanted to use designated initializers with aggregates, the consequence of this is usage of reinterpret_cast() :/, but it works great. diff --git a/include/orm/schema/schemaconstants_extern.hpp b/include/orm/schema/schemaconstants_extern.hpp index 475893e7e..bca3f9176 100644 --- a/include/orm/schema/schemaconstants_extern.hpp +++ b/include/orm/schema/schemaconstants_extern.hpp @@ -43,7 +43,7 @@ namespace Constants SHAREDLIB_EXPORT extern const QString SpatialIndex; SHAREDLIB_EXPORT extern const QString Foreign; - // Foreign constrains + // Foreign constraints SHAREDLIB_EXPORT extern const QString Cascade; SHAREDLIB_EXPORT extern const QString Restrict; SHAREDLIB_EXPORT extern const QString SetNull; diff --git a/include/orm/schema/schemaconstants_inline.hpp b/include/orm/schema/schemaconstants_inline.hpp index 59b63d63e..348e6b983 100644 --- a/include/orm/schema/schemaconstants_inline.hpp +++ b/include/orm/schema/schemaconstants_inline.hpp @@ -43,7 +43,7 @@ namespace Constants inline const QString SpatialIndex = QStringLiteral("spatialIndex"); inline const QString Foreign = QStringLiteral("foreign"); - // Foreign constrains + // Foreign constraints inline const QString Cascade = QStringLiteral("cascade"); inline const QString Restrict = QStringLiteral("restrict"); inline const QString SetNull = QStringLiteral("set null"); diff --git a/include/orm/tiny/concerns/hasrelationstore.hpp b/include/orm/tiny/concerns/hasrelationstore.hpp index 679e0bb13..3eaac9614 100644 --- a/include/orm/tiny/concerns/hasrelationstore.hpp +++ b/include/orm/tiny/concerns/hasrelationstore.hpp @@ -470,7 +470,7 @@ namespace Orm::Tiny::Concerns Look at the Relation::m_parent for additional info. */ auto dummyModel = this->m_hasRelationStore.model().newInstance(); - /* We want to run a relationship query without any constrains so that we will + /* We want to run a relationship query without any constraints so that we will not have to remove these where clauses manually which gets really hacky and error prone. We don't want constraints because we add eager ones. */ auto relationInstance = @@ -636,7 +636,7 @@ namespace Orm::Tiny::Concerns "How did this happen? Is a mystery 😎, a Related type has to be " "the same as a RelatedFromMethod."); - // We want to run a relationship query without any constrains + // We want to run a relationship query without any constraints auto relationInstance = Relations::Relation::noConstraints( [this, &method] diff --git a/include/orm/tiny/model.hpp b/include/orm/tiny/model.hpp index a7c8804a3..3ad3a0bdb 100644 --- a/include/orm/tiny/model.hpp +++ b/include/orm/tiny/model.hpp @@ -1323,3 +1323,4 @@ TINYORM_END_COMMON_NAMESPACE // SEC fix LoadLibrary() before qsql plugin loads? https://www.qt.io/blog/security-advisory-qlockfile-qauthenticator-windows-platform-plugin silverqx // CUR1 connection, control disable/enable logging at runtime silverqx // CUR cmake, make TinyUtils_target in TinyTestCommon.cmake optional, not always needed to link to silverqx +// CUR docs, info about unsupported json column by qtsql drivers and link to schema.mdx Default Expressions silverqx diff --git a/src/orm/schema/schemaconstants_extern.cpp b/src/orm/schema/schemaconstants_extern.cpp index 9165890e5..d11a762eb 100644 --- a/src/orm/schema/schemaconstants_extern.cpp +++ b/src/orm/schema/schemaconstants_extern.cpp @@ -30,7 +30,7 @@ namespace Orm::SchemaNs::Constants const QString SpatialIndex = QStringLiteral("spatialIndex"); const QString Foreign = QStringLiteral("foreign"); - // Foreign constrains + // Foreign constraints const QString Cascade = QStringLiteral("cascade"); const QString Restrict = QStringLiteral("restrict"); const QString SetNull = QStringLiteral("set null");