📝 Fix internal links in docs (#1148)
This commit is contained in:
parent
059970f024
commit
1999c77481
@ -68,7 +68,7 @@ There are many databases of many types.
|
|||||||
|
|
||||||
A database could be a single file called `heroes.db`, managed with code in a very efficient way. An example would be SQLite, more about that on a bit.
|
A database could be a single file called `heroes.db`, managed with code in a very efficient way. An example would be SQLite, more about that on a bit.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### A server database
|
### A server database
|
||||||
|
|
||||||
@ -80,11 +80,11 @@ In this case, your code would talk to this server application instead of reading
|
|||||||
|
|
||||||
The database could be located in a different server/machine:
|
The database could be located in a different server/machine:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Or the database could be located in the same server/machine:
|
Or the database could be located in the same server/machine:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The most important aspect of these types of databases is that **your code doesn't read or modify** the files containing the data directly.
|
The most important aspect of these types of databases is that **your code doesn't read or modify** the files containing the data directly.
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ In some cases, the database could even be a group of server applications running
|
|||||||
|
|
||||||
In this case, your code would talk to one or more of these server applications running on different machines.
|
In this case, your code would talk to one or more of these server applications running on different machines.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Most of the databases that work as server applications also support multiple servers in one way or another.
|
Most of the databases that work as server applications also support multiple servers in one way or another.
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ For example, the table for the teams has the ID `1` for the team `Preventers` an
|
|||||||
|
|
||||||
As these **primary key** IDs can uniquely identify each row on the table for teams, we can now go to the table for heroes and refer to those IDs in the table for teams.
|
As these **primary key** IDs can uniquely identify each row on the table for teams, we can now go to the table for heroes and refer to those IDs in the table for teams.
|
||||||
|
|
||||||
<img alt="table relationships" src="/img/databases/relationships.svg">
|

|
||||||
|
|
||||||
So, in the table for heroes, we use the `team_id` column to define a relationship to the *foreign* table for teams. Each value in the `team_id` column on the table with heroes will be the same value as the `id` column of one row in the table with teams.
|
So, in the table for heroes, we use the `team_id` column to define a relationship to the *foreign* table for teams. Each value in the `team_id` column on the table with heroes will be the same value as the `id` column of one row in the table with teams.
|
||||||
|
|
||||||
|
@ -236,8 +236,7 @@ database.execute(
|
|||||||
).all()
|
).all()
|
||||||
```
|
```
|
||||||
|
|
||||||
<img class="shadow" src="/img/db-to-code/autocompletion01.png">
|
{class="shadow"}
|
||||||
|
|
||||||
|
|
||||||
## ORMs and SQL
|
## ORMs and SQL
|
||||||
|
|
||||||
@ -280,7 +279,7 @@ For example this **Relation** or table:
|
|||||||
|
|
||||||
* **Mapper**: this comes from Math, when there's something that can convert from some set of things to another, that's called a "**mapping function**". That's where the **Mapper** comes from.
|
* **Mapper**: this comes from Math, when there's something that can convert from some set of things to another, that's called a "**mapping function**". That's where the **Mapper** comes from.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
We could also write a **mapping function** in Python that converts from the *set of lowercase letters* to the *set of uppercase letters*, like this:
|
We could also write a **mapping function** in Python that converts from the *set of lowercase letters* to the *set of uppercase letters*, like this:
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@ As **SQLModel** is built on top of <a href="https://www.sqlalchemy.org/" class="
|
|||||||
|
|
||||||
## Install DB Browser for SQLite
|
## Install DB Browser for SQLite
|
||||||
|
|
||||||
Remember that [SQLite is a simple database in a single file](../databases.md#a-single-file-database){.internal-link target=_blank}?
|
Remember that [SQLite is a simple database in a single file](databases.md#a-single-file-database){.internal-link target=_blank}?
|
||||||
|
|
||||||
For most of the tutorial I'll use SQLite for the examples.
|
For most of the tutorial I'll use SQLite for the examples.
|
||||||
|
|
||||||
Python has integrated support for SQLite, it is a single file read and processed from Python. And it doesn't need an [External Database Server](../databases.md#a-server-database){.internal-link target=_blank}, so it will be perfect for learning.
|
Python has integrated support for SQLite, it is a single file read and processed from Python. And it doesn't need an [External Database Server](databases.md#a-server-database){.internal-link target=_blank}, so it will be perfect for learning.
|
||||||
|
|
||||||
In fact, SQLite is perfectly capable of handling quite big applications. At some point you might want to migrate to a server-based database like <a href="https://www.postgresql.org/" class="external-link" target="_blank">PostgreSQL</a> (which is also free). But for now we'll stick to SQLite.
|
In fact, SQLite is perfectly capable of handling quite big applications. At some point you might want to migrate to a server-based database like <a href="https://www.postgresql.org/" class="external-link" target="_blank">PostgreSQL</a> (which is also free). But for now we'll stick to SQLite.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user