mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-05-25 04:08:23 -05:00
added comments
This commit is contained in:
@@ -408,11 +408,11 @@ namespace Grammars
|
||||
/*! The default string length for migrations. */
|
||||
static int DefaultStringLength;
|
||||
|
||||
/*! The storage engine that should be used for the table. */
|
||||
/*! The storage engine that should be used for the table (MySQL). */
|
||||
QString engine {};
|
||||
/*! The default character set that should be used for the table. */
|
||||
/*! The default character set that should be used for the table (MySQL). */
|
||||
QString charset {};
|
||||
/*! The collation that should be used for the table. */
|
||||
/*! The collation that should be used for the table (MySQL). */
|
||||
QString collation {};
|
||||
|
||||
protected:
|
||||
|
||||
@@ -275,6 +275,8 @@ namespace Grammars
|
||||
QString modifySrid(const ColumnDefinition &column) const;
|
||||
};
|
||||
|
||||
/* public */
|
||||
|
||||
bool MySqlSchemaGrammar::supportsSchemaTransactions() const noexcept
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace Orm::SchemaNs::Grammars
|
||||
QString getType(const ColumnDefinition &column) const override;
|
||||
};
|
||||
|
||||
/* public */
|
||||
|
||||
bool PostgresSchemaGrammar::supportsSchemaTransactions() const noexcept
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -112,8 +112,12 @@ namespace Grammars
|
||||
virtual QString typeComputed(const ColumnDefinition &column) const;
|
||||
};
|
||||
|
||||
/* public */
|
||||
|
||||
SchemaGrammar::~SchemaGrammar() = default;
|
||||
|
||||
/* others */
|
||||
|
||||
template<ColumnContainer T>
|
||||
QVector<QString>
|
||||
SchemaGrammar::prefixArray(const QString &prefix, const T &values) const
|
||||
|
||||
@@ -60,6 +60,7 @@ QVector<QString> Blueprint::toSql(const DatabaseConnection &connection,
|
||||
|
||||
const BasicCommand &Blueprint::create()
|
||||
{
|
||||
// First {} is for the base class
|
||||
return addCommand({{}, Create});
|
||||
}
|
||||
|
||||
@@ -283,6 +284,7 @@ ColumnDefinitionReference<> Blueprint::longText(const QString &column)
|
||||
return addColumn(ColumnType::LongText, column);
|
||||
}
|
||||
|
||||
// CUR schema, fix and unify real/double/float types with latest standard and remove deprecated APIs, what I have understood from the MySQL and PostgreSQL docs it should be like this; I should have real and double (double precision) types without any total, places or precision params and then I should have float type that should have precision param, currently this total and places params are depreceted as described in https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html and will be removed in future, also add this column types to tests and to the playground also check numeric/decimal type, its different animal silverqx
|
||||
ColumnDefinitionReference<>
|
||||
Blueprint::Float(const QString &column, const std::optional<int> total,
|
||||
const std::optional<int> places, const bool isUnsigned)
|
||||
|
||||
@@ -7,6 +7,8 @@ TINYORM_BEGIN_COMMON_NAMESPACE
|
||||
namespace Orm::SchemaNs::Grammars
|
||||
{
|
||||
|
||||
/* public */
|
||||
|
||||
/* Compile methods for the SchemaBuilder */
|
||||
|
||||
QString PostgresSchemaGrammar::compileEnableForeignKeyConstraints() const
|
||||
|
||||
@@ -9,6 +9,10 @@ TINYORM_BEGIN_COMMON_NAMESPACE
|
||||
namespace Orm::SchemaNs::Grammars
|
||||
{
|
||||
|
||||
/* public */
|
||||
|
||||
/* Compile methods for the SchemaBuilder */
|
||||
|
||||
QString SchemaGrammar::compileCreateDatabase(const QString &/*unused*/,
|
||||
DatabaseConnection &connection) const
|
||||
{
|
||||
@@ -48,6 +52,8 @@ QString SchemaGrammar::compileTableExists() const
|
||||
throw Exceptions::RuntimeError(NotImplemented);
|
||||
}
|
||||
|
||||
/* Compile methods for commands */
|
||||
|
||||
QVector<QString>
|
||||
SchemaGrammar::compileFullText(const Blueprint &/*unused*/,
|
||||
const IndexCommand &/*unused*/) const
|
||||
@@ -97,6 +103,8 @@ SchemaGrammar::compileDropFullText(const Blueprint &/*unused*/,
|
||||
"This database driver does not support dropping databases.");
|
||||
}
|
||||
|
||||
/* Others */
|
||||
|
||||
QString SchemaGrammar::wrap(const ColumnDefinition &column, bool prefixAlias) const
|
||||
{
|
||||
return BaseGrammar::wrap(column.name, prefixAlias);
|
||||
|
||||
@@ -7,6 +7,8 @@ TINYORM_BEGIN_COMMON_NAMESPACE
|
||||
namespace Orm::SchemaNs
|
||||
{
|
||||
|
||||
/* public */
|
||||
|
||||
QStringList PostgresSchemaBuilder::getColumnListing(const QString &table) const
|
||||
{
|
||||
auto [schema, table_] = parseSchemaAndTable(table);
|
||||
|
||||
Reference in New Issue
Block a user