mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-05-04 23:49:25 -05:00
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
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include "orm/sqliteconnection.hpp"
|
||||
|
||||
#include "orm/query/grammars/sqlitegrammar.hpp"
|
||||
#include "orm/query/processors/sqliteprocessor.hpp"
|
||||
#include "orm/schema/grammars/sqlitegrammar.hpp"
|
||||
#include "orm/schema/sqlitebuilder.hpp"
|
||||
|
||||
#ifdef TINYORM_COMMON_NAMESPACE
|
||||
namespace TINYORM_COMMON_NAMESPACE
|
||||
@@ -20,13 +23,35 @@ SQLiteConnection::SQLiteConnection(
|
||||
of the database abstraction, so we initialize it to the default value
|
||||
while starting. */
|
||||
useDefaultQueryGrammar();
|
||||
|
||||
useDefaultPostProcessor();
|
||||
}
|
||||
|
||||
std::unique_ptr<SchemaBuilder> SQLiteConnection::getSchemaBuilder()
|
||||
{
|
||||
if (!m_schemaGrammar)
|
||||
useDefaultSchemaGrammar();
|
||||
|
||||
return std::make_unique<Schema::SQLiteBuilder>(*this);
|
||||
}
|
||||
|
||||
std::unique_ptr<QueryGrammar> SQLiteConnection::getDefaultQueryGrammar() const
|
||||
{
|
||||
// FEATURE table prefix silverqx
|
||||
return std::make_unique<Query::Grammars::SQLiteGrammar>();
|
||||
}
|
||||
|
||||
std::unique_ptr<SchemaGrammar> SQLiteConnection::getDefaultSchemaGrammar() const
|
||||
{
|
||||
// FEATURE table prefix silverqx
|
||||
return std::make_unique<Schema::Grammars::SQLiteGrammar>();
|
||||
}
|
||||
|
||||
std::unique_ptr<QueryProcessor> SQLiteConnection::getDefaultPostProcessor() const
|
||||
{
|
||||
return std::make_unique<Query::Processors::SQLiteProcessor>();
|
||||
}
|
||||
|
||||
} // namespace Orm
|
||||
#ifdef TINYORM_COMMON_NAMESPACE
|
||||
} // namespace TINYORM_COMMON_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user