From 1999c7748169005672afb7d0c6aea694b0edd925 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 26 Oct 2024 19:29:02 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=93=9D=20Fix=20internal=20links=20in=20doc?= =?utf8?q?s=20(#1148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- docs/databases.md | 10 +++++----- docs/db-to-code.md | 5 ++--- docs/install.md | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/databases.md b/docs/databases.md index e8747672..d65a7431 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -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. -![database as a single file](/img/databases/single-file.svg) +![database as a single file](img/databases/single-file.svg) ### 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: -![database in an external server](/img/databases/external-server.svg) +![database in an external server](img/databases/external-server.svg) Or the database could be located in the same server/machine: -![database in the same server](/img/databases/same-server.svg) +![database in the same server](img/databases/same-server.svg) 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. -![distributed database in multiple servers](/img/databases/multiple-servers.svg) +![distributed database in multiple servers](img/databases/multiple-servers.svg) 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. -table relationships +![table relationships](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. diff --git a/docs/db-to-code.md b/docs/db-to-code.md index 537c583d..3d289d75 100644 --- a/docs/db-to-code.md +++ b/docs/db-to-code.md @@ -236,8 +236,7 @@ database.execute( ).all() ``` - - +![](img/db-to-code/autocompletion01.png){class="shadow"} ## 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. -![Squares to Triangles Mapper](/img/db-to-code/mapper.svg) +![Squares to Triangles Mapper](img/db-to-code/mapper.svg) 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: diff --git a/docs/install.md b/docs/install.md index 8ac2e04c..129df351 100644 --- a/docs/install.md +++ b/docs/install.md @@ -16,11 +16,11 @@ As **SQLModel** is built on top of PostgreSQL (which is also free). But for now we'll stick to SQLite. -- 2.47.2