fixed internal cross documentation links

This commit is contained in:
silverqx
2021-02-14 14:04:46 +01:00
parent 8fac2eb19a
commit ccdaf8f835
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -200,4 +200,4 @@ All transaction methods accept a connection name as the optional argument:
DB::beginTransaction("mysql_test");
> {tip} The `DB` facade's transaction methods control the transactions for both the [query builder](query-builder) and [TinyORM](tinyorm).
> {tip} The `DB` facade's transaction methods control the transactions for both the [query builder](query-builder.md) and [TinyORM](tinyorm.md).
+4 -4
View File
@@ -29,7 +29,7 @@ Database tables are often related to one another. For example, a blog post may h
<a name="defining-relationships"></a>
## Defining Relationships
TinyORM relationships are defined as methods on your TinyORM model classes. Since relationships also serve as powerful [query builders](query-builder), defining relationships as methods provides powerful method chaining and querying capabilities. For example, we may chain additional query constraints on this `posts` relationship:
TinyORM relationships are defined as methods on your TinyORM model classes. Since relationships also serve as powerful [query builders](query-builder.md), defining relationships as methods provides powerful method chaining and querying capabilities. For example, we may chain additional query constraints on this `posts` relationship:
user->posts()->where("active", 1).get();
@@ -335,7 +335,7 @@ It will be implemented soon.
<a name="querying-relations"></a>
## Querying Relations
Since all TinyORM relationships are defined via methods, you may call those methods to obtain an instance of the relationship without actually executing a query to load the related models. In addition, all types of TinyORM relationships also serve as [query builders](query-builder), allowing you to continue to chain constraints onto the relationship query before finally executing the SQL query against your database.
Since all TinyORM relationships are defined via methods, you may call those methods to obtain an instance of the relationship without actually executing a query to load the related models. In addition, all types of TinyORM relationships also serve as [query builders](query-builder.md), allowing you to continue to chain constraints onto the relationship query before finally executing the SQL query against your database.
For example, imagine a blog application in which a `User` model has many associated `Post` models:
@@ -380,7 +380,7 @@ You may query the `posts` relationship and add additional constraints to the rel
user->posts()->whereEq("active", 1).get();
You are able to use any of the Laravel [query builder's](query-builder) methods on the relationship, so be sure to explore the query builder documentation to learn about all of the methods that are available to you.
You are able to use any of the Laravel [query builder's](query-builder.md) methods on the relationship, so be sure to explore the query builder documentation to learn about all of the methods that are available to you.
So far, not all query builder methods are proxied on the relation base class, only basic `where` methods are proxied.
@@ -402,7 +402,7 @@ from posts
where user_id = ? and active = 1 or votes >= 100
```
In most situations, you should use [logical groups](query-builder#logical-grouping) to group the conditional checks between parentheses:
In most situations, you should use [logical groups](query-builder.md#logical-grouping) to group the conditional checks between parentheses:
user->posts()
->where([](auto &query) {
+4 -4
View File
@@ -20,7 +20,7 @@
TinyORM is an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using TinyORM, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, TinyORM models allow you to insert, update, and delete records from the table as well.
> {tip} Before getting started, be sure to configure a database connection in your application. For more information on configuring your database, check out [the database configuration documentation](database#configuration).
> {tip} Before getting started, be sure to configure a database connection in your application. For more information on configuring your database, check out [the database configuration documentation](database.md#configuration).
<a name="tinyorm-model-conventions"></a>
## TinyORM Model Conventions
@@ -175,7 +175,7 @@ By default, all TinyOrm models will use the default database connection that is
<a name="retrieving-models"></a>
## Retrieving Models
Once you have created a model and its associated database table, you are ready to start retrieving data from your database. You can think of each TinyOrm model as a powerful [query builder](/docs/{{version}}/query-builder) allowing you to fluently query the database table associated with the model. The model's `all` method will retrieve all of the records from the model's associated database table:
Once you have created a model and its associated database table, you are ready to start retrieving data from your database. You can think of each TinyOrm model as a powerful [query builder](query-builder.md) allowing you to fluently query the database table associated with the model. The model's `all` method will retrieve all of the records from the model's associated database table:
#include <QDebug>
@@ -187,14 +187,14 @@ Once you have created a model and its associated database table, you are ready t
<a name="building-queries"></a>
#### Building Queries
The TinyOrm `all` method will return all of the results in the model's table. However, since each TinyOrm model serves as a [query builder](/docs/{{version}}/query-builder), you may add additional constraints to queries and then invoke the `get` method to retrieve the results:
The TinyOrm `all` method will return all of the results in the model's table. However, since each TinyOrm model serves as a [query builder](query-builder.md), you may add additional constraints to queries and then invoke the `get` method to retrieve the results:
auto flights = Flight::whereEq("active", 1)
->orderBy("name")
.take(10)
.get();
> {tip} Since TinyOrm models are query builders, you should review all of the methods provided by TinyORM's [query builder](/docs/{{version}}/query-builder). You may use any of these methods when writing your TinyOrm queries.
> {tip} Since TinyOrm models are query builders, you should review all of the methods provided by TinyORM's [query builder](query-builder.md). You may use any of these methods when writing your TinyOrm queries.
> {note} All the static methods defined on the `Orm::Tiny::BaseModel<Model, AllRelations...>` class, which start building queries like `where`, `latest`, `oldest`, `with`, ... return `std::unique_ptr<TinyBuilder<Model>>`, `TinyBuilder = Orm::Tiny::Builder` and `Model` template argument is queried model class.