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
This commit is contained in:
silverqx
2022-03-22 09:53:33 +01:00
parent a7ace30999
commit a2714be30e
75 changed files with 6939 additions and 117 deletions

View File

@@ -30,7 +30,7 @@ std::unique_ptr<SchemaBuilder> SQLiteConnection::getSchemaBuilder()
if (!m_schemaGrammar)
useDefaultSchemaGrammar();
return std::make_unique<Schema::SQLiteSchemaBuilder>(*this);
return std::make_unique<SchemaNs::SQLiteSchemaBuilder>(*this);
}
std::unique_ptr<QueryGrammar> SQLiteConnection::getDefaultQueryGrammar() const
@@ -46,7 +46,7 @@ std::unique_ptr<QueryGrammar> SQLiteConnection::getDefaultQueryGrammar() const
std::unique_ptr<SchemaGrammar> SQLiteConnection::getDefaultSchemaGrammar() const
{
// Ownership of a unique_ptr()
auto grammar = std::make_unique<Schema::Grammars::SQLiteSchemaGrammar>();
auto grammar = std::make_unique<SchemaNs::Grammars::SQLiteSchemaGrammar>();
withTablePrefix(*grammar);