- refactored PostgreSQL grammar for generated columns
- unified nullable() on generated columns, now it behaves the same for
all supported databases and also behaves the same as everywhere else
- used an optional "generated always as" for all databases instead of
only "as ()" because it better expresses what it means, "as ()" looks
very similar like a column alias
- temporarily disabled logic in MySQL::nullable() for MariaDB, I'm
going to prepare and set up the MariaDB dev. env. to correctly
support it, then I will finish it
- added tests
Others:
- tests for MySQL and PostgreSQL added tests to test multiple
auto-increment starting values (startingValue() or from() alias)
Used TinyORM modifiers to set a default value and for the MySQL also
"on update" value for the datetime and timestamp column types.
Previously, the SQL for a default value and for the "on update" was
generated right away, now, the ColumnDefinition instance is modified
and later in the SQL generation process will be this clauses generated.
- updated tests, the order of the null value and default values were
switched
- refactored SchemaBuilder instantiation
- added connection name to Exceptions::QueryError
- tom added --pending option to migrate:status
- tom added --batch=X option to migrate:rollback
- docs added migrate --pending and --batch sections
- schema added ability to add table comment
- schema added ability to call comment() on SQLite
- optimized eager loading when no keys to be loaded
- dropped return value for connectEagerly()
- allowed to pass QueryBuilder to whereExists
- allowed to pass expression to pluck()
- schema added datetimes and softDeletesDatetime
- renamed to Blueprint::datetime/Tz()
- schema added withoutForeignKeyConstraints()
- added dropDatetimes() and dropSoftDeletesDatetime()
Refactored whereExists() to accept the std::shared_ptr<QueryBuilder> and
QueryBuilder &.
- added unit and functional test
- updated docs
- updated all proxies
The table comment can be added for the MySQL and PostgreSQL databases.
The SQLite database doesn't support it.
- added unit and functional tests
- added docs
Made it pure virtual in the DatabaseConnection and instances are created
only in the derived Connection classes, used the same pattern like for
the SchemaGrammar or QueryGrammar.
So now the SchemaBuilder instance is saved in the DatabaseConnection
itself instead of the cache in the Schema as it was before.
Changed from the 'schema' configuration option to the 'search_path',
the 'schema' config. option was dropped and currently throws exception
with a suggestion to use the 'search_path' instead.
The new 'search_path' config. option can be the QString or QStringList
and also supports to set an empty search_path using '' or empty QString
or QStringList.
This search_path config. option is correctly parsed and quoted.
Setting the search_path is initiated from the PostgresConnector
right after the database connection is established.
The PostgresSchemaBuilder is actively using the search_path during
practically all method calls (dropAllTables(), getColumnListing(),
hasTable(), ...). If the search_path is not defined then it queries
the database for the real search_path because the search_path can be
changed anytime and the search_path configuration option value can be
incorrect (out of sync).
It also works correctly with the empty search_path, in this case a fully
qualified table names are required. If the table name is not fully
qualified then the SearchPathEmptyError exception is thrown.
And it also works correctly with the "$user" PostgreSQL's variable, this
variable is resolved to the config["username"] during obtaining
the search_path from the database.
In the pretend mode it behaves little different, if pretending then
the 'search_path' is obtained from the connection configuration and
if the 'search_path' is not defined in the config. the 'public' will
be used as the default.
- added many new unit and functional tests which are testing all the
above described scenarios
- added new functional test case tst_PostgreSQL_SchemaBuilder_f
- added new functional test case tst_SchemaBuilder
- added new tests for dropAllTable(), dropAllViews(), hasTable(),
getColumnListing(), createDatabase(), dropDatabaseIfExists()
for ALL supported databases
- added new search_path constant
- renamed env. variable to DB_PGSQL_SEARCHPATH (from DB_PGSQL_SCHEMA)
- added new search_path and dont_drop configuration validations to
check correct type (QString or QStringList)
- added new 'schema' config. option validation
- added new exception SearchPathEmptyError
- started the TinyUtils::Databases refactor