Remove references of being a fork and changed inconsistencies in "Database" (#58)
* Removed references of being a fork * Fixed inconsistency of "DataBase" vs "Database" which caused some 404 errors. Chose for "Database" because it corrosponds with e.g. "FastDb".
parent
a3bf62c50c
commit
9dda4bc020
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-1-DataBase-DbClient) | [简体中文](CHN-08-1-数据库-DbClient)
|
||||
[English](ENG-08-1-Database-DbClient) | [简体中文](CHN-08-1-数据库-DbClient)
|
||||
|
||||
### 构建DbClient
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-2-DataBase-Transaction) | [简体中文](CHN-08-2-数据库-事务)
|
||||
[English](ENG-08-2-Database-Transaction) | [简体中文](CHN-08-2-数据库-事务)
|
||||
|
||||
> **事务**是关系型数据库的重要特性,Drogon通过`Transaction`类提供了对事务的支持。
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-3-DataBase-ORM) | [简体中文](CHN-08-3-数据库-ORM)
|
||||
[English](ENG-08-3-Database-ORM) | [简体中文](CHN-08-3-数据库-ORM)
|
||||
|
||||
### Model
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-4-DataBase-FastDbClient) | [简体中文](CHN-08-4-数据库-FastDbClient)
|
||||
[English](ENG-08-4-Database-FastDbClient) | [简体中文](CHN-08-4-数据库-FastDbClient)
|
||||
|
||||
顾名思义,FastDbClient会提供比普通的DbClient更高的性能。与DbClient拥有自己的EventLoop不同,它和Web应用的网络IO线程和主线程共用 EventLoop,这使得FastDbClient的内部实现可以采用无锁的方式进行,因而会更高效。
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-5-DataBase-auto_batch) | [简体中文](CHN-08-3-数据库-自动批处理)
|
||||
[English](ENG-08-5-Database-auto_batch) | [简体中文](CHN-08-3-数据库-自动批处理)
|
||||
|
||||
自动批处理模式只对postgresql 14+版本的客户端库有效,其他情况下会被忽略,讲自动批处理之前,先了解一下pipeline模式。
|
||||
|
||||
|
|
|
@ -14,14 +14,14 @@ The basic class of Drogon's database is `DbClient` (this is an abstract class, t
|
|||
|
||||
Usually, when an asynchronous interface is called, `DbClient` will randomly select one of the idle connections it manages to perform related query operations. When the result returns, `DbClient` will process the data and return it to the caller through the callback function object; Without an idle connection, the execution content will be cached. Once a connection has executed its own sql request, the pending command will be fetched from the cache to execute.
|
||||
|
||||
For details on `DbClient`, see [DbClient](ENG-08-1-DataBase-DbClient).
|
||||
For details on `DbClient`, see [DbClient](ENG-08-1-Database-DbClient).
|
||||
|
||||
### Transaction
|
||||
|
||||
The transaction object can be generated by `DbClient` to support transaction operations. In addition to the extra `rollback()` interface, the transaction object is basically the same as `DbClient`. The transaction class is `Transaction`. For details of the `Transaction` class, see [Transaction](ENG-08-2-DataBase-Transaction).
|
||||
The transaction object can be generated by `DbClient` to support transaction operations. In addition to the extra `rollback()` interface, the transaction object is basically the same as `DbClient`. The transaction class is `Transaction`. For details of the `Transaction` class, see [Transaction](ENG-08-2-Database-Transaction).
|
||||
|
||||
### ORM
|
||||
|
||||
Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper<MODEL>` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](ENG-08-3-DataBase-ORM)
|
||||
Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper<MODEL>` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](ENG-08-3-Database-ORM)
|
||||
|
||||
# 08.1 [DbClient](ENG-08-1-DataBase-DbClient)
|
||||
# 08.1 [DbClient](ENG-08-1-Database-DbClient)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-1-DataBase-DbClient) | [简体中文](CHN-08-1-数据库-DbClient)
|
||||
[English](ENG-08-1-Database-DbClient) | [简体中文](CHN-08-1-数据库-DbClient)
|
||||
|
||||
### DbClient Object Construction
|
||||
|
||||
|
@ -253,4 +253,4 @@ Each DbClient object has one or multiple its own EventLoop threads controlling t
|
|||
|
||||
Blocking interfaces of DbClient only block the caller thread, as long as the caller thread is not the EventLoop thread, it will not affect the normal operation of the EventLoop thread. When the callback function is called, the program inside the callback is run on the EventLoop thread. Therefore, do not perform any blocking operations within the callback, otherwise it will affect the concurrency performance of database read and write. Anyone familiar with non-blocking I/O programming should understand this constraint.
|
||||
|
||||
# 08.2 [Transaction](ENG-08-2-DataBase-Transaction)
|
||||
# 08.2 [Transaction](ENG-08-2-Database-Transaction)
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-2-DataBase-Transaction) | [简体中文](CHN-08-2-数据库-事务)
|
||||
[English](ENG-08-2-Database-Transaction) | [简体中文](CHN-08-2-数据库-事务)
|
||||
|
||||
> **Transactions** are an important feature of relational databases, and Drogon provides transaction support with the `Transaction` class.
|
||||
|
||||
|
@ -83,4 +83,4 @@ For the simplest example, suppose there is a task table from which the user sele
|
|||
|
||||
In this case, select for update is used to avoid concurrent modifications. The update statement is completed in the result callback of the select statement. The outermost braces are used to limit the scope of the transPtr so that it can be destroyed in time after the execution of sql to end the transaction.
|
||||
|
||||
# 08.3 [ORM](ENG-08-3-DataBase-ORM)
|
||||
# 08.3 [ORM](ENG-08-3-Database-ORM)
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-3-DataBase-ORM) | [简体中文](CHN-08-3-数据库-ORM)
|
||||
[English](ENG-08-3-Database-ORM) | [简体中文](CHN-08-3-数据库-ORM)
|
||||
|
||||
### Model
|
||||
|
||||
|
@ -95,7 +95,7 @@ template <typename... Arguments>
|
|||
explicit Criteria(const CustomSql &sql, Arguments &&...args)
|
||||
```
|
||||
|
||||
The first argument is a `CustomSql` object of sql statements with `$?` placeholders, while the `CustomSql` class is just a wrapper of a std::string. The second indefinite argument is a parameter pack represents the bound parameter, which behaves just like the ones in [execSqlAsync](ENG-08-1-DataBase-DbClient.md#execSqlAsync).
|
||||
The first argument is a `CustomSql` object of sql statements with `$?` placeholders, while the `CustomSql` class is just a wrapper of a std::string. The second indefinite argument is a parameter pack represents the bound parameter, which behaves just like the ones in [execSqlAsync](ENG-08-1-Database-DbClient.md#execSqlAsync).
|
||||
|
||||
E.g:
|
||||
|
||||
|
@ -282,4 +282,4 @@ drogon_ctl can also generate restful-style controllers for each model (or table)
|
|||
|
||||
It should be noted that the controller of each table is designed to be composed of a base class and a subclass. Among them, the base class and the table are closely related, and the subclass is used to implement special business logic or modify the interface format. The advantage of this design is that when the table structure changes, users can update only the base class without overwriting the subclass(by setting the `generate_base_only` option to `true`).
|
||||
|
||||
# 08.4 [FastDbClient](ENG-08-4-DataBase-FastDbClient)
|
||||
# 08.4 [FastDbClient](ENG-08-4-Database-FastDbClient)
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-4-DataBase-FastDbClient) | [简体中文](CHN-08-4-数据库-FastDbClient)
|
||||
[English](ENG-08-4-Database-FastDbClient) | [简体中文](CHN-08-4-数据库-FastDbClient)
|
||||
|
||||
As the name implies, FastDbClient will provide higher performance than the normal DbClient. Unlike DbClient has own event loop, it shares the event loop with network IO threads and the main thread of the web application, which makes the internal implementation of FastDbClient available in a lock-free mode and more efficient.
|
||||
|
||||
|
@ -30,4 +30,4 @@ The use of FastDbClient is almost identical to that of the normal DbClient, exce
|
|||
- Synchronous transaction creation interfaces are likely to block (when all connections are busy), so FastDbClient's synchronous transaction creation interface returns null pointers directly. If you want to use transactions on FastDbClient, please use the asynchronous transaction creation interface.
|
||||
- After using the FastDbClient to create an Orm Mapper object, you should also use only asynchronous non-blocking interfaces of the mapper object.
|
||||
|
||||
# 08.5 [Automatic batch mode](ENG-08-5-DataBase-auto_batch)
|
||||
# 08.5 [Automatic batch mode](ENG-08-5-Database-auto_batch)
|
|
@ -1,4 +1,4 @@
|
|||
[English](ENG-08-5-DataBase-auto_batch) | [简体中文](CHN-08-3-数据库-自动批处理)
|
||||
[English](ENG-08-5-Database-auto_batch) | [简体中文](CHN-08-3-数据库-自动批处理)
|
||||
|
||||
The automatic batch mode is only valid for the client library of postgresql 14+ version, and will be ignored in other cases. Before talking about automatic batch processing, let's understand the pipeline mode first.
|
||||
|
38
Home.md
38
Home.md
|
@ -45,25 +45,25 @@
|
|||
* [Dynamic compilation and loading of views](ENG-06-View#Dynamic-compilation-and-loading-of-views)
|
||||
* [Session](ENG-07-Session)
|
||||
* [Database](ENG-08-0-Database-General)
|
||||
* [DbClient](ENG-08-1-DataBase-DbClient)
|
||||
* [Execution Interface](ENG-08-1-DataBase-DbClient#Execution-Interface)
|
||||
* [execSqlAsync](ENG-08-1-DataBase-DbClient#execSqlAsync)
|
||||
* [execSqlAsyncFuture](ENG-08-1-DataBase-DbClient#execSqlAsyncFuture)
|
||||
* [execSqlSync](ENG-08-1-DataBase-DbClient#execSqlSync)
|
||||
* [operator<<](ENG-08-1-DataBase-DbClient#operator<<)
|
||||
* [Transaction](ENG-08-2-DataBase-Transaction)
|
||||
* [ORM](ENG-08-3-DataBase-ORM)
|
||||
* [Model Class Interface](ENG-08-3-DataBase-ORM#Model-Class-Interface)
|
||||
* [Mapper Class Template](ENG-08-3-DataBase-ORM#Mapper-Class-Template)
|
||||
* [Criteria](CHN-08-3-DataBase-ORM#Criteria)
|
||||
* [Mapper's Chain Interface](CHN-08-3-DataBase-ORM#Mapper's-Chain-Interface)
|
||||
* [Convert](CHN-08-3-DataBase-ORM#Convert)
|
||||
* [Relationships](CHN-08-3-DataBase-ORM#Relationships)
|
||||
* [has one](CHN-08-3-DataBase-ORM#has-one)
|
||||
* [has many](CHN-08-3-DataBase-ORM#has-many)
|
||||
* [many to many](CHN-08-3-DataBase-ORM#many-to-many)
|
||||
* [FastDbClient](ENG-08-4-DataBase-FastDbClient)
|
||||
* [Automatic batch mode](ENG-08-5-DataBase-auto_batch)
|
||||
* [DbClient](ENG-08-1-Database-DbClient)
|
||||
* [Execution Interface](ENG-08-1-Database-DbClient#Execution-Interface)
|
||||
* [execSqlAsync](ENG-08-1-Database-DbClient#execSqlAsync)
|
||||
* [execSqlAsyncFuture](ENG-08-1-Database-DbClient#execSqlAsyncFuture)
|
||||
* [execSqlSync](ENG-08-1-Database-DbClient#execSqlSync)
|
||||
* [operator<<](ENG-08-1-Database-DbClient#operator<<)
|
||||
* [Transaction](ENG-08-2-Database-Transaction)
|
||||
* [ORM](ENG-08-3-Database-ORM)
|
||||
* [Model Class Interface](ENG-08-3-Database-ORM#Model-Class-Interface)
|
||||
* [Mapper Class Template](ENG-08-3-Database-ORM#Mapper-Class-Template)
|
||||
* [Criteria](CHN-08-3-Database-ORM#Criteria)
|
||||
* [Mapper's Chain Interface](CHN-08-3-Database-ORM#Mapper's-Chain-Interface)
|
||||
* [Convert](CHN-08-3-Database-ORM#Convert)
|
||||
* [Relationships](CHN-08-3-Database-ORM#Relationships)
|
||||
* [has one](CHN-08-3-Database-ORM#has-one)
|
||||
* [has many](CHN-08-3-Database-ORM#has-many)
|
||||
* [many to many](CHN-08-3-Database-ORM#many-to-many)
|
||||
* [FastDbClient](ENG-08-4-Database-FastDbClient)
|
||||
* [Automatic batch mode](ENG-08-5-Database-auto_batch)
|
||||
* [Plugins](ENG-09-Plugins)
|
||||
* [Configuration File](ENG-10-Configuration-File)
|
||||
* [drogon_ctl Command](ENG-11-drogon_ctl-Command)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
## Documentation for the [Drogon](https://github.com/drogonframework/drogon) framework.
|
||||
|
||||
This repository has been forked from [Drogon-Docs](https://github.com/drogonframework/drogon-docs).
|
||||
[Docsify](https://docsify.js.org/) is used to render the documentation.
|
||||
|
||||
The purpose of this fork is to create a replacement for the old DocsForge wiki-site.
|
||||
The new Wiki-renderer system is based on [Docsify](https://docsify.js.org/).
|
||||
|
||||
This documentation is served on [Github Pages](https://rickiewars.github.io/drogon-docs/).
|
||||
The documentation is served on [Github Pages](https://drogonframework.github.io/drogon-docs/).
|
|
@ -20,11 +20,6 @@
|
|||
|
||||
> Run your application anywhere, knowing it is as fast as it could be.
|
||||
|
||||
Disclaimer: This is a fork from [drogonframework@drogon-docs](https://github.com/drogonframework/drogon-docs). <br/>
|
||||
Information you find here may be outdated. <br/>
|
||||
Before opening an issue at their issue pages, please double check if the information hasn't already been updated in their repo. <br/>
|
||||
For styling issues on this site, please open an issue or pull-request at [rickiewars@drogon-docs](https://github.com/rickiewars/drogon-docs). <br/>
|
||||
|
||||
[View releases](https://github.com/drogonframework/drogon/releases)
|
||||
[View on Github](https://github.com/drogonframework/drogon)
|
||||
[Read the docs](#document)
|
||||
|
|
38
_Sidebar.md
38
_Sidebar.md
|
@ -46,25 +46,25 @@
|
|||
* [Dynamic compilation and loading of views](ENG-06-View#Dynamic-compilation-and-loading-of-views)
|
||||
* [Session](ENG-07-Session)
|
||||
* [Database](ENG-08-0-Database-General)
|
||||
* [DbClient](ENG-08-1-DataBase-DbClient)
|
||||
* [Execution Interface](ENG-08-1-DataBase-DbClient#Execution-Interface)
|
||||
* [execSqlAsync](ENG-08-1-DataBase-DbClient#execSqlAsync)
|
||||
* [execSqlAsyncFuture](ENG-08-1-DataBase-DbClient#execSqlAsyncFuture)
|
||||
* [execSqlSync](ENG-08-1-DataBase-DbClient#execSqlSync)
|
||||
* [operator<<](ENG-08-1-DataBase-DbClient#operator<<)
|
||||
* [Transaction](ENG-08-2-DataBase-Transaction)
|
||||
* [ORM](ENG-08-3-DataBase-ORM)
|
||||
* [Model Class Interface](ENG-08-3-DataBase-ORM#Model-Class-Interface)
|
||||
* [Mapper Class Template](ENG-08-3-DataBase-ORM#Mapper-Class-Template)
|
||||
* [Criteria](ENG-08-3-DataBase-ORM#Criteria)
|
||||
* [Mapper's Chain Interface](ENG-08-3-DataBase-ORM#Mapper's-Chain-Interface)
|
||||
* [Convert](ENG-08-3-DataBase-ORM#Convert)
|
||||
* [Relationships](ENG-08-3-DataBase-ORM#Relationships)
|
||||
* [has one](ENG-08-3-DataBase-ORM#has-one)
|
||||
* [has many](ENG-08-3-DataBase-ORM#has-many)
|
||||
* [many to many](ENG-08-3-DataBase-ORM#many-to-many)
|
||||
* [FastDbClient](ENG-08-4-DataBase-FastDbClient)
|
||||
* [Automatic batch mode](ENG-08-5-DataBase-auto_batch)
|
||||
* [DbClient](ENG-08-1-Database-DbClient)
|
||||
* [Execution Interface](ENG-08-1-Database-DbClient#Execution-Interface)
|
||||
* [execSqlAsync](ENG-08-1-Database-DbClient#execSqlAsync)
|
||||
* [execSqlAsyncFuture](ENG-08-1-Database-DbClient#execSqlAsyncFuture)
|
||||
* [execSqlSync](ENG-08-1-Database-DbClient#execSqlSync)
|
||||
* [operator<<](ENG-08-1-Database-DbClient#operator<<)
|
||||
* [Transaction](ENG-08-2-Database-Transaction)
|
||||
* [ORM](ENG-08-3-Database-ORM)
|
||||
* [Model Class Interface](ENG-08-3-Database-ORM#Model-Class-Interface)
|
||||
* [Mapper Class Template](ENG-08-3-Database-ORM#Mapper-Class-Template)
|
||||
* [Criteria](ENG-08-3-Database-ORM#Criteria)
|
||||
* [Mapper's Chain Interface](ENG-08-3-Database-ORM#Mapper's-Chain-Interface)
|
||||
* [Convert](ENG-08-3-Database-ORM#Convert)
|
||||
* [Relationships](ENG-08-3-Database-ORM#Relationships)
|
||||
* [has one](ENG-08-3-Database-ORM#has-one)
|
||||
* [has many](ENG-08-3-Database-ORM#has-many)
|
||||
* [many to many](ENG-08-3-Database-ORM#many-to-many)
|
||||
* [FastDbClient](ENG-08-4-Database-FastDbClient)
|
||||
* [Automatic batch mode](ENG-08-5-Database-auto_batch)
|
||||
* [Plugins](ENG-09-Plugins)
|
||||
* [Configuration File](ENG-10-Configuration-File)
|
||||
* [drogon_ctl Command](ENG-11-drogon_ctl-Command)
|
||||
|
|
Loading…
Reference in New Issue