added support for PostgreSQL schema builder 🎉👌

- added a new config. option dont_drop, allows to define table that
   will be excluded during dropAllTables(), has a default value
   spatial_ref_sys for PostGIS
 - implemented fluent commands, used only by the PostgreSQL Comment
   command
 - added tests for PostgreSQL schema builder
 - reworked tst_Migrate to be able to run on all supported connections,
   currently PostgreSQL and MySQL
 - updated docs

Unrelated:

 - added a new reference class IndexDefinitionReference for a nice API
   during index definition, contains algorithm and language
 - unified selectFromWriteConnection() in schema builders
This commit is contained in:
silverqx
2022-05-23 09:18:15 +02:00
parent 767b369148
commit 0bcbcd2431
40 changed files with 3382 additions and 238 deletions

View File

@@ -38,7 +38,7 @@ The TinyORM `Schema` facade provides database agnostic support for creating and
`Tom` migrations is a small console application that depends on the `TinyORM` library. All migrations logic is compiled so recompilation is needed after adding a new migration class.
:::caution
Currently, TinyORM's schema builder provides first-party support for the MySQL database only. Support for the PostgreSQL and SQLite databases is not implemented 😢.
Currently, TinyORM's schema builder provides first-party support for the MySQL and PostgreSQL database. Support for the SQLite databases is not implemented 😢.
:::
## Generating Migrations
@@ -253,7 +253,7 @@ You may check for the existence of a table or column using the `hasTable` and `h
If you want to perform a schema operation on a database connection that is not your application's default connection, use the `connection` method or `on` alias:
Schema::connection("sqlite").create("users", [](Blueprint &table)
Schema::connection("postgres").create("users", [](Blueprint &table)
{
table.id();
});

View File

@@ -19,6 +19,10 @@ TinyORM includes the ability to seed your database with data using seed classes.
[Mass assignment protection](tinyorm/getting-started.mdx#mass-assignment) is automatically disabled during database seeding.
:::
:::note
Because seeding is independent of the schema builder, it supports all [supported databases](database/getting-started.mdx#introduction) out of the box.
:::
## Writing Seeders
To generate a seeder, execute the `make:seeder` `tom` command. A new seeder will be placed in the `database/seeders` directory relative to the current <abbr title='Current working directory'>pwd</abbr>:

View File

@@ -7,7 +7,7 @@ description: Platform requirements and supported compilers for TinyORM c++ libra
# Supported Compilers
Following compilers are backed up by the GitHub Action [workflows](https://github.com/silverqx/TinyORM/tree/main/.github/workflows) (CI pipelines), these workflows also include more then 920 unit tests.
Following compilers are backed up by the GitHub Action [workflows](https://github.com/silverqx/TinyORM/tree/main/.github/workflows) (CI pipelines), these workflows also include more then 973 unit tests 😮.
Windows >=10: