sync docs

[skip ci]
This commit is contained in:
silverqx
2023-04-16 09:56:46 +02:00
parent 8a9998a4ba
commit 931a759f27
3 changed files with 11 additions and 5 deletions

View File

@@ -69,7 +69,7 @@ All these three console applications the `tom` example, `tom` migrations for uni
## Prerequisites
Working MySQL database server as the `tom` migrations currently provides support only for the MySQL database.
Any of the [supported databases](database/getting-started.mdx#introduction), `tom` is able to generate <a href='https://en.wikipedia.org/wiki/Data_definition_language' title='Data Definition Language'>DDL</a> queries for all these databases.
Install required dependencies and build the `TinyORM` library with the `tom` (it's enabled by default) as is described [here](building/hello-world.mdx#install-dependencies) and [here](building/tinyorm.mdx).
@@ -191,6 +191,8 @@ And paste the following code.
{charset_, qEnvironmentVariable("DB_MYSQL_CHARSET", UTF8MB4)},
{collation_, qEnvironmentVariable("DB_MYSQL_COLLATION", UTF8MB40900aici)},
{timezone_, TZ00},
// Specifies what time zone all QDateTime-s will have
{"qt_timezone", QVariant::fromValue(Qt::UTC)},
{prefix_, EMPTY},
{prefix_indexes, false},
{strict_, true},
@@ -199,11 +201,11 @@ And paste the following code.
{Version, {}}, // Autodetect
{options_, QVariantHash()},
},
QStringLiteral("tinyorm_tom"));
QStringLiteral("tinyorm_tom")); // shell:connection
}
:::tip
If you have defined more database connections then you can tag the lines with the database connection names with the `// shell:connection` comment and this connection names will be provided to the bash/zsh/pwsh completion for the `--database=` option, [example](https://github.com/silverqx/TinyORM/blob/main/examples/tom/main.cpp#L74).
If you have defined more database connections then you can tag the lines with the database connection names with the `// shell:connection` comment and this connection names will be provided to the bash, zsh, pwsh completions for the `--database=` option 😎, [example](https://github.com/silverqx/TinyORM/blob/main/examples/tom/main.cpp#L74).
:::
### Migrations

View File

@@ -542,6 +542,10 @@ On `Linux`, you can install the `range-v3` library and some other [dependencies]
I recommend creating a new [`Session`](https://doc.qt.io/qtcreator/creator-project-managing-sessions.html) in the `QtCreator`, this way you will have all the examples in one place and as a bonus, everything will be in the same place when you close and reopen `QtCreator IDE`. You can name it `tinyorm.org` or `TinyORM examples`, it is up to you.
:::
:::tip
If you are using sessions, you can use a single `clangd` instance for all projects in this session in the `QtCreator IDE`. One significant advantage of this method is that the `.qtc_clangd/` folder will not be created in the build folder, but will be stored globally in the Roaming profile. You can enable it in the `Settings` - `C++` - `Clangd` - `Sessions with a single clangd instance`.
:::
#### Configure TinyORM
Now you are ready to configure the `TinyORM` library. The `qmake` does not support auto-configuration of dependencies out of the box, to configure TinyORM's `qmake` build dependencies you have to copy the `conf.pri.example` file to the `conf.pri` and manually edit the `INCLUDEPATH` and `LIBS`. This way you can override any `qmake` build options or variables.