Skip to content

Commit 144dfdf

Browse files
committed
docs categorized documentation
- moved docs to categories - updated all links [skip ci]
1 parent 5ca76d6 commit 144dfdf

24 files changed

+87
-70
lines changed

docs/README.mdx

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Prologue
32
sidebar_position: 0
3+
sidebar_label: 🔥 Prologue
44
slug: /
55
hide_table_of_contents: true
66
description: TinyORM is a modern c++ ORM library that makes interacting with a database extremely simple. It depends on the QtCore and QtSql libraries. The code is written in the modern c++20 way and is well tested with the unit and functional tests.
@@ -14,12 +14,12 @@ The code is written in the modern c++20 way and is well tested with the unit and
1414

1515
- [Dependencies](dependencies.mdx)
1616
- [Supported Compilers](supported-compilers.mdx)
17-
- [Database: Getting Started](database.mdx)
18-
- [Database: Query Builder](query-builder.mdx)
19-
- [Database: Migrations](migrations.mdx)
20-
- [Database: Seeding](seeding.mdx)
21-
- [TinyORM: Getting Started](tinyorm.mdx)
22-
- [TinyORM: Relationships](tinyorm-relationships.mdx)
23-
- [Building: TinyORM](building-tinyorm.mdx)
24-
- [Building: Hello world](building-hello-world.mdx)
25-
- [Building: Migrations](building-migrations.mdx)
17+
- [Database: Getting Started](database/getting-started.mdx)
18+
- [Database: Query Builder](database/query-builder.mdx)
19+
- [Database: Migrations](database/migrations.mdx)
20+
- [Database: Seeding](database/seeding.mdx)
21+
- [TinyORM: Getting Started](tinyorm/getting-started.mdx)
22+
- [TinyORM: Relationships](tinyorm/relationships.mdx)
23+
- [Building: TinyORM](building/tinyorm.mdx)
24+
- [Building: Hello world](building/hello-world.mdx)
25+
- [Building: Migrations](building/migrations.mdx)

docs/building/_category_.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
position: 5
2+
label: '🚧 Building'

docs/building-hello-world.mdx docs/building/hello-world.mdx

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
sidebar_position: 10
2+
sidebar_position: 2
3+
sidebar_label: Hello world
34
description: Hello world example created in the terminal and QtCreator IDE.
45
---
56

@@ -40,7 +41,7 @@ import {
4041

4142
We will try to create the simplest working application in the terminal with the `CMake` and in the `QtCreator` IDE with the `qmake`.
4243

43-
The `HelloWorld` example also expects the following [folders structure](building-tinyorm.mdx#folders-structure), let's create them.
44+
The `HelloWorld` example also expects the following [folders structure](building/tinyorm.mdx#folders-structure), let's create them.
4445

4546
<Tabs groupId={shell}>
4647
<TabItem value={pwsh} label={pwsh_label}>
@@ -75,7 +76,7 @@ select * from posts;"
7576

7677
## Install dependencies
7778

78-
First, install the `vcpkg` package manager as is described [here](building-tinyorm.mdx#vcpkg).
79+
First, install the `vcpkg` package manager as is described [here](building/tinyorm.mdx#vcpkg).
7980

8081
The `range-v3` and `tabulate` libraries are required dependencies because `TinyORM` uses them in header files, you have to install them before you can use `TinyORM`. The `tabulate` library is only needed in the `tom` migrations it's used by the `migrate:status` command.
8182

@@ -294,7 +295,7 @@ cmake --build . --target all
294295

295296
### Execute Hello world {#execute-hello-world-cmake}
296297

297-
Do not forget to add `TinyOrm0d.dll` on the path on Windows and on the `LD_LIBRARY_PATH` on Linux, so `HelloWorld` application can find it during execution, as is described [here](building-tinyorm.mdx#tinyorm-on-path-cmake).
298+
Do not forget to add `TinyOrm0d.dll` on the path on Windows and on the `LD_LIBRARY_PATH` on Linux, so `HelloWorld` application can find it during execution, as is described [here](building/tinyorm.mdx#tinyorm-on-path-cmake).
298299

299300
<Tabs groupId={shell} name='tinyorm-on-path'>
300301
<TabItem value={pwsh} label={pwsh_label}>
@@ -309,7 +310,7 @@ Do not forget to add `TinyOrm0d.dll` on the path on Windows and on the `LD_LIBRA
309310
</TabItem>
310311
</Tabs>
311312

312-
Create a symbolic link to the `HelloWorld.sqlite3` database inside the build folder. If you do not have enabled symbolic links without `Administrator` rights on your `Windows`, you can just simply copy the `HelloWorld.sqlite3` database or [`Allow symbolic links unprivileged`](building-tinyorm.mdx#allow-symbolic-links-unprivileged).
313+
Create a symbolic link to the `HelloWorld.sqlite3` database inside the build folder. If you do not have enabled symbolic links without `Administrator` rights on your `Windows`, you can just simply copy the `HelloWorld.sqlite3` database or [`Allow symbolic links unprivileged`](building/tinyorm.mdx#allow-symbolic-links-unprivileged).
313314

314315
<Tabs groupId={shell} name='tinyorm-on-path'>
315316
<TabItem value={pwsh} label={pwsh_label}>
@@ -412,7 +413,7 @@ unix:!macx: \
412413
```
413414

414415
:::caution
415-
The exact [folders structure](building-tinyorm.mdx#folders-structure) is crucial in this example because the paths to the `TinyORM` source and build folders are relative.
416+
The exact [folders structure](building/tinyorm.mdx#folders-structure) is crucial in this example because the paths to the `TinyORM` source and build folders are relative.
416417
:::
417418

418419
:::tip
@@ -440,21 +441,21 @@ Configuring with the `.qmake.conf` file has one big advantage that is that you d
440441
### Build Hello world {#build-hello-world-qmake}
441442

442443
:::tip
443-
I recommend creating a new `Session` in the `QtCreator IDE` as is described [here](building-tinyorm.mdx#open-qtcreator-ide).
444+
I recommend creating a new `Session` in the `QtCreator IDE` as is described [here](building/tinyorm.mdx#open-qtcreator-ide).
444445
:::
445446

446447
Now you can open the `HelloWorld.pro` project in the `QtCreator IDE`.
447448

448-
This will open the `Configure Project` tab, select some kit and update build folder paths to meet our [folders structure](building-tinyorm.mdx#folders-structure) or like you want.
449+
This will open the `Configure Project` tab, select some kit and update build folder paths to meet our [folders structure](building/tinyorm.mdx#folders-structure) or like you want.
449450

450-
<img src={require('./assets/img/building-hello-world/qmake-configure_project.png').default}
451+
<img src={require('./assets/img/hello-world/qmake-configure_project.png').default}
451452
alt='HelloWorld - QtCreator - Configure Project' width='760' />
452453

453454
You are ready to configure build options, hit <kbd>Ctrl</kbd>+<kbd>5</kbd> to open `Project Settings` tab and select `Build` in the left sidebar to open the `Build Settings`, it should look similar to the following picture.
454455

455456
Disable `QML debugging and profiling` and `Qt Quick Compiler`, they are not used.
456457

457-
<img src={require('./assets/img/building-hello-world/qmake-build_settings.png').default}
458+
<img src={require('./assets/img/hello-world/qmake-build_settings.png').default}
458459
className='no-blurry' alt='HelloWorld - QtCreator - Build Settings' width='760' />
459460

460461
Everything is ready to build, you can press <kbd>Ctrl</kbd>+<kbd>b</kbd> to build the project.
@@ -465,7 +466,7 @@ The `QtCreator` takes care about all the necessary configuration, sets up the bu
465466

466467
Only one thing you might want to change is to run the `HelloWorld` example in the new terminal window. To do so, hit <kbd>Ctrl</kbd>+<kbd>5</kbd> to open the `Project Settings` tab and select `Run` in the left sidebar to open the `Run Settings`, then in the `Run` section select the `Run in terminal` checkbox.
467468

468-
Create a symbolic link to the `HelloWorld.sqlite3` database inside the build folder. If you do not have enabled symbolic links without `Administrator` rights on your `Windows`, you can just simply copy the `HelloWorld.sqlite3` database or [`Allow symbolic links unprivileged`](building-tinyorm.mdx#allow-symbolic-links-unprivileged).
469+
Create a symbolic link to the `HelloWorld.sqlite3` database inside the build folder. If you do not have enabled symbolic links without `Administrator` rights on your `Windows`, you can just simply copy the `HelloWorld.sqlite3` database or [`Allow symbolic links unprivileged`](building/tinyorm.mdx#allow-symbolic-links-unprivileged).
469470

470471
<Tabs groupId={shell} name='tinyorm-on-path'>
471472
<TabItem value={pwsh} label={pwsh_label}>

docs/building-migrations.mdx docs/building/migrations.mdx

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
sidebar_position: 11
2+
sidebar_position: 3
3+
sidebar_label: Migrations
34
description: How to compile the TinyORM migrations (tom) c++ console application on Windows and Linux.
45
---
56

@@ -42,7 +43,7 @@ import {
4243

4344
We will try to create a working migrations console application called as <abbr title='TinyORM migrations'>`tom`</abbr> in the terminal with the `CMake` and in the `QtCreator` IDE with the `qmake`.
4445

45-
The `tom` console application also expects the following [folders structure](building-tinyorm.mdx#folders-structure), let's create them.
46+
The `tom` console application also expects the following [folders structure](building/tinyorm.mdx#folders-structure), let's create them.
4647

4748
<Tabs groupId={shell}>
4849
<TabItem value={pwsh} label={pwsh_label}>
@@ -69,11 +70,11 @@ All these three console applications the `tom` example, `tom` migrations for uni
6970

7071
Working MySQL database server as the `tom` migrations currently provides support only for the MySQL database.
7172

72-
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).
73+
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).
7374

7475
### vcpkg.json manifest {#vcpkg-json-manifest}
7576

76-
Whole section about the `vcpkg` dependencies is described in the [Install dependencies](building-hello-world.mdx#install-dependencies).
77+
Whole section about the `vcpkg` dependencies is described in the [Install dependencies](building/hello-world.mdx#install-dependencies).
7778

7879
Create a `vcpkg.json` file with the following content. `CMake` example below uses this method.
7980

@@ -201,7 +202,7 @@ And paste the following code.
201202

202203
### Migrations
203204

204-
If you have already built the `tom` application then you can generate a migrations using the [`make:migration`](migrations.mdx#generating-migrations) command 😎.
205+
If you have already built the `tom` application then you can generate a migrations using the [`make:migration`](database/migrations.mdx#generating-migrations) command 😎.
205206

206207
```bash
207208
tom make:migration create_posts_table
@@ -278,7 +279,7 @@ If you want, you can also build the `tom` application without the migrations, si
278279

279280
### Seeders
280281

281-
If you have already built the `tom` application then you can generate a seeder using the [`make:seeder`](seeding.mdx#writing-seeders) command 😎.
282+
If you have already built the `tom` application then you can generate a seeder using the [`make:seeder`](database/seeding.mdx#writing-seeders) command 😎.
282283

283284
```bash
284285
tom make:seeder PostSeeder
@@ -328,7 +329,7 @@ And paste the following code.
328329
} // namespace Seeders
329330

330331
:::tip
331-
You can create more seeder classes like this and use the `call<>()` method to invoke them as is described in the [Calling Additional Seeders](seeding.mdx#calling-additional-seeders) section.
332+
You can create more seeder classes like this and use the `call<>()` method to invoke them as is described in the [Calling Additional Seeders](database/seeding.mdx#calling-additional-seeders) section.
332333
:::
333334

334335
## Migrations with CMake
@@ -529,7 +530,7 @@ target_link_libraries(\${Tom_target}
529530

530531
### Build migrations {#build-migrations-cmake}
531532

532-
Now you are ready to configure `tom` `CMake` application. Don't forget to prepare the build environment with the [`qtenv6.ps1`](building-tinyorm.mdx#windows-prerequisites) command if you are building with the `msvc`.
533+
Now you are ready to configure `tom` `CMake` application. Don't forget to prepare the build environment with the [`qtenv6.ps1`](building/tinyorm.mdx#windows-prerequisites) command if you are building with the `msvc`.
533534

534535
```bash
535536
cd ../tom-builds-cmake/build-debug
@@ -568,7 +569,7 @@ cmake --build . --target all
568569

569570
### Execute migrations {#execute-migrations-cmake}
570571

571-
Do not forget to add `TinyOrm0d.dll` on the path on Windows and on the `LD_LIBRARY_PATH` on Linux, so `tom` application can find it during execution, as is described [here](building-tinyorm.mdx#tinyorm-on-path-cmake).
572+
Do not forget to add `TinyOrm0d.dll` on the path on Windows and on the `LD_LIBRARY_PATH` on Linux, so `tom` application can find it during execution, as is described [here](building/tinyorm.mdx#tinyorm-on-path-cmake).
572573

573574
<Tabs groupId={shell} name='tinyorm-on-path'>
574575
<TabItem value={pwsh} label={pwsh_label}>
@@ -604,7 +605,7 @@ Execute `tom` application.
604605

605606
The output will look something like this.
606607

607-
<img src={require('./assets/img/building-migrations/tom_migrate_status.png').default}
608+
<img src={require('./assets/img/migrations/tom_migrate_status.png').default}
608609
alt='Tom migrations - migrate:status command output' width='660' />
609610

610611
See also the [final thoughts](#finish) on how to verify the `tom` executable file properties.
@@ -676,7 +677,7 @@ unix:!macx: \
676677
```
677678

678679
:::caution
679-
The exact [folders structure](building-tinyorm.mdx#folders-structure) is crucial in this example because the paths to the `TinyORM` source and build folders are relative.
680+
The exact [folders structure](building/tinyorm.mdx#folders-structure) is crucial in this example because the paths to the `TinyORM` source and build folders are relative.
680681
:::
681682

682683
:::tip
@@ -730,21 +731,21 @@ HEADERS += \
730731
### Build migrations {#build-migrations-qmake}
731732

732733
:::tip
733-
I recommend creating a new `Session` in the `QtCreator IDE` as is described [here](building-tinyorm.mdx#open-qtcreator-ide).
734+
I recommend creating a new `Session` in the `QtCreator IDE` as is described [here](building/tinyorm.mdx#open-qtcreator-ide).
734735
:::
735736

736737
Now you can open the `tom.pro` project in the `QtCreator IDE`.
737738

738-
This will open the `Configure Project` tab, select some kit and update build folder paths to meet our [folders structure](building-tinyorm.mdx#folders-structure) or like you want.
739+
This will open the `Configure Project` tab, select some kit and update build folder paths to meet our [folders structure](building/tinyorm.mdx#folders-structure) or like you want.
739740

740-
<img src={require('./assets/img/building-migrations/qmake-configure_project.png').default}
741+
<img src={require('./assets/img/migrations/qmake-configure_project.png').default}
741742
alt='tom - QtCreator - Configure Project' width='760' />
742743

743744
You are ready to configure build options, hit <kbd>Ctrl</kbd>+<kbd>5</kbd> to open `Project Settings` tab and select `Build` in the left sidebar to open the `Build Settings`, it should look similar to the following picture.
744745

745746
Disable `QML debugging and profiling` and `Qt Quick Compiler`, they are not used.
746747

747-
<img src={require('./assets/img/building-migrations/qmake-build_settings.png').default}
748+
<img src={require('./assets/img/migrations/qmake-build_settings.png').default}
748749
className='no-blurry' alt='tom - QtCreator - Build Settings' width='760' />
749750

750751
Everything is ready to build, you can press <kbd>Ctrl</kbd>+<kbd>b</kbd> to build the project.
@@ -761,7 +762,7 @@ To execute the `tom` application press <kbd>Ctrl</kbd> + <kbd>r</kbd>.
761762

762763
The output will look something like this.
763764

764-
<img src={require('./assets/img/building-migrations/tom_migrate_status.png').default}
765+
<img src={require('./assets/img/migrations/tom_migrate_status.png').default}
765766
alt='Tom migrations - migrate:status command output' width='660' />
766767

767768
Happy migrating 🎉👌
@@ -772,6 +773,6 @@ As the last thing, you can check that all the file properties were correctly set
772773

773774
Find the `tom.exe` file and press <kbd>Alt</kbd> + <kbd>Enter</kbd> to open the file properties. To check the executable manifest you can use eg. the [Resource Hacker](http://www.angusj.com/resourcehacker/).
774775

775-
<img src={require('./assets/img/building-migrations/tom_file_properties.png').default}
776+
<img src={require('./assets/img/migrations/tom_file_properties.png').default}
776777
alt='tom.exe file properties detail' width='440' />
777778

docs/building-tinyorm.mdx docs/building/tinyorm.mdx

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
sidebar_position: 9
2+
sidebar_position: 0
3+
sidebar_label: TinyORM
34
hide_table_of_contents: true
45
description: How to compile the TinyORM c++ library on Windows and Linux.
56
---
@@ -90,7 +91,7 @@ Open `Local Security Policy`, go to `Local Policies - User Rights Assignment`, o
9091

9192
## Folders structure
9293

93-
All `tinyorm.org` examples are based on the following folders structure. The `tom` folder will contain a [migrations console application](building-migrations.mdx).
94+
All `tinyorm.org` examples are based on the following folders structure. The `tom` folder will contain a [migrations console application](building/migrations.mdx).
9495

9596
<Tabs groupId={shell}>
9697
<TabItem value={pwsh} label={pwsh_label} className='tiny-tree'>
@@ -471,7 +472,7 @@ As the last thing, do not forget to add `TinyOrm0d.dll` on the path on Windows a
471472
</TabItem>
472473
</Tabs>
473474

474-
Now you can try the [`HelloWorld CMake`](building-hello-world.mdx#hello-world-with-cmake) example.
475+
Now you can try the [`HelloWorld CMake`](building/hello-world.mdx#hello-world-with-cmake) example.
475476

476477
## Building with qmake
477478

@@ -548,19 +549,19 @@ Now you can open the `TinyOrm.pro` project in the `QtCreator IDE`.
548549

549550
This will open the `Configure Project` tab, select some kit and update build folder paths to meet our [folders structure](#folders-structure) or like you want.
550551

551-
<img src={require('./assets/img/building-tinyorm/qmake-configure_project.png').default}
552+
<img src={require('./assets/img/tinyorm/qmake-configure_project.png').default}
552553
alt='TinyORM - QtCreator - Configure Project' width='760' />
553554

554555
You are ready to configure build options, hit <kbd>Ctrl</kbd>+<kbd>5</kbd> to open `Project Settings` tab and select `Build` in the left sidebar to open the `Build Settings`, it should look similar to the following picture.
555556

556557
Disable `QML debugging and profiling` and `Qt Quick Compiler`, they are not used.
557558

558-
<img src={require('./assets/img/building-tinyorm/qmake-build_settings.png').default}
559+
<img src={require('./assets/img/tinyorm/qmake-build_settings.png').default}
559560
alt='TinyORM - QtCreator - Build Settings' width='760' />
560561

561562
If you want to change some `TinyORM` build options, you can pass them to the `Build Steps` - `qmake TinyOrm.pro` - `Additional arguments` input field. It can look like this.
562563

563-
<img src={require('./assets/img/building-tinyorm/qmake-additional_arguments.png').default}
564+
<img src={require('./assets/img/tinyorm/qmake-additional_arguments.png').default}
564565
alt='TinyORM - QtCreator - Build Settings - Additional arguments' width='660' />
565566

566567
#### Build TinyORM

docs/database/_category_.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
position: 3
2+
label: '✨ Database'

docs/database.mdx docs/database/getting-started.mdx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 0
3+
sidebar_label: Getting Started
34
description: TinyORM makes interacting with a database extremely simple using raw SQL, a fluent query builder, and the TinyORM. It provides first-party support for three databases MySQL/MariaDB, PostgreSQL, and SQLite.
45
---
56

@@ -13,7 +14,7 @@ description: TinyORM makes interacting with a database extremely simple using ra
1314

1415
## Introduction
1516

16-
Almost every modern application interacts with a database. TinyORM makes interacting with a database extremely simple using raw SQL, a [fluent query builder](query-builder.mdx), and the [TinyORM](tinyorm.mdx). Currently, TinyORM provides first-party support for three databases:
17+
Almost every modern application interacts with a database. TinyORM makes interacting with a database extremely simple using raw SQL, a [fluent query builder](database/query-builder.mdx), and the [TinyORM](tinyorm/getting-started.mdx). Currently, TinyORM provides first-party support for three databases:
1718

1819
- MySQL or MariaDB 5.0+ ([Version Policy](https://en.wikipedia.org/wiki/MySQL#Release_history))
1920
- PostgreSQL 9.6+ ([Version Policy](https://www.postgresql.org/support/versioning/))
@@ -59,7 +60,7 @@ A database connection is resolved lazily, which means that the connection config
5960
:::
6061

6162
:::tip
62-
You can also use predefined string constants to avoid unnecessary `QString` instantiations, as used in the `tom` migrations [example](building-migrations.mdx#string-constants-example).
63+
You can also use predefined string constants to avoid unnecessary `QString` instantiations, as used in the `tom` migrations [example](building/migrations.mdx#string-constants-example).
6364
:::
6465

6566
#### SQLite Configuration
@@ -232,5 +233,5 @@ All transaction methods accept a connection name as the optional argument:
232233
DB::beginTransaction("mysql_test");
233234

234235
:::tip
235-
The `DB` facade's transaction methods control the transactions for both the [query builder](query-builder.mdx) and [TinyORM](tinyorm.mdx).
236+
The `DB` facade's transaction methods control the transactions for both the [query builder](database/query-builder.mdx) and [TinyORM](tinyorm/getting-started.mdx).
236237
:::

0 commit comments

Comments
 (0)