Skip to content

Commit e3ffcaf

Browse files
committed
📝 Update docs references to new diagrams
1 parent 2e28023 commit e3ffcaf

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

docs/databases.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ There are many databases of many types.
6868

6969
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 in a bit.
7070

71-
![database as a single file](img/databases/single-file.svg)
71+
![database as a single file](img/databases/single-file.drawio.svg)
7272

7373
### A server database
7474

@@ -80,11 +80,11 @@ In this case, your code would talk to this server application instead of reading
8080

8181
The database could be located in a different server/machine:
8282

83-
![database in an external server](img/databases/external-server.svg)
83+
![database in an external server](img/databases/external-server.drawio.svg)
8484

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

87-
![database in the same server](img/databases/same-server.svg)
87+
![database in the same server](img/databases/same-server.drawio.svg)
8888

8989
The most important aspect of these types of databases is that **your code doesn't read or modify** the files containing the data directly.
9090

@@ -98,7 +98,7 @@ In some cases, the database could even be a group of server applications running
9898

9999
In this case, your code would talk to one or more of these server applications running on different machines.
100100

101-
![distributed database in multiple servers](img/databases/multiple-servers.svg)
101+
![distributed database in multiple servers](img/databases/multiple-servers.drawio.svg)
102102

103103
Most of the databases that work as server applications also support multiple servers in one way or another.
104104

@@ -257,7 +257,7 @@ For example, the table for the teams has the ID `1` for the team `Preventers` an
257257

258258
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.
259259

260-
![table relationships](img/databases/relationships.svg)
260+
![table relationships](img/databases/relationships.drawio.svg)
261261

262262
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.
263263

docs/db-to-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ For example this **Relation** or table:
279279

280280
* **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.
281281

282-
![Squares to Triangles Mapper](img/db-to-code/mapper.svg)
282+
![Squares to Triangles Mapper](img/db-to-code/mapper.drawio.svg)
283283

284284
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:
285285

docs/tutorial/connect/create-connected-rows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ And after we finish working with the data in this chapter, the `hero` table will
3535

3636
Each row in the table `hero` will point to a row in the table `team`:
3737

38-
<img alt="table relationships" src="/img/tutorial/relationships/select/relationships2.svg">
38+
<img alt="table relationships" src="/img/tutorial/relationships/select/relationships2.drawio.svg">
3939

4040
/// info
4141

docs/tutorial/connect/create-connected-tables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To connect them, we will add another column to the hero table to point to each t
3939

4040
This way each row in the table `hero` can point to a row in the table `team`:
4141

42-
<img alt="table relationships" src="/img/databases/relationships.svg">
42+
<img alt="table relationships" src="/img/databases/relationships.drawio.svg">
4343

4444
## One-to-Many and Many-to-One
4545

docs/tutorial/connect/read-connected-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ And then you tell the database `ON` which condition it should join those two tab
293293

294294
But by default, only the rows from both left and right that match the condition will be returned.
295295

296-
<img alt="table relationships" src="/img/databases/relationships.svg">
296+
<img alt="table relationships" src="/img/databases/relationships.drawio.svg">
297297

298298
In this example of tables above 👆, it would return all the heroes, because every hero has a `team_id`, so every hero can be joined with the `team` table:
299299

@@ -318,7 +318,7 @@ But in the database that we are working with in the code above, **Spider-Boy** d
318318

319319
So there's no way to join the **Spider-Boy** row with some row in the `team` table:
320320

321-
<img alt="table relationships" src="/img/tutorial/relationships/select/relationships2.svg">
321+
<img alt="table relationships" src="/img/tutorial/relationships/select/relationships2.drawio.svg">
322322

323323
Running the same SQL we used above, the resulting table would not include **Spider-Boy** 😱:
324324

docs/tutorial/indexes.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ Imagine a **dictionary**, a book with definitions of words. 📔 ...not a Python
3434

3535
Let's say that you want to **find a word**, for example the word "**database**". You take the dictionary, and open it somewhere, for example in the middle. Maybe you see some definitions of words that start with `m`, like `manual`, so you conclude that you are in the letter `m` in the dictionary.
3636

37-
<img src="/img/tutorial/indexes/dictionary001.svg">
37+
<img src="/img/tutorial/indexes/dictionary001.drawio.svg">
3838

3939
You know that in the alphabet, the letter `d` for `database` comes **before** the letter `m` for `manual`.
4040

41-
<img src="/img/tutorial/indexes/dictionary002.svg">
41+
<img src="/img/tutorial/indexes/dictionary002.drawio.svg">
4242

4343
So, you know you have to search in the dictionary **before** the point you currently are. You still don't know where the word `database` is, because you don't know exactly where the letter `d` is in the dictionary, but you know that **it is not after** that point, you can now **discard the right half** of the dictionary in your search.
4444

45-
<img src="/img/tutorial/indexes/dictionary003.svg">
45+
<img src="/img/tutorial/indexes/dictionary003.drawio.svg">
4646

4747
Next, you **open the dictionary again**, but only taking into account the **half of the dictionary** that can contain the word you want, the **left part of the dictionary**. You open it in the middle of that left part and now you arrive maybe at the letter `f`.
4848

49-
<img src="/img/tutorial/indexes/dictionary004.svg">
49+
<img src="/img/tutorial/indexes/dictionary004.drawio.svg">
5050

5151
You know that `d` from `database` comes before `f`. So it has to be **before** that. But now you know that `database` **is not after** that point, and you can discard the dictionary from that point onward.
5252

53-
<img src="/img/tutorial/indexes/dictionary005.svg">
53+
<img src="/img/tutorial/indexes/dictionary005.drawio.svg">
5454

5555
Now you have a **small section of dictionary** to search (only a **quarter** of dictionary can have your word). You take that **quarter** of the pages at the start of the dictionary that can contain your word, and open it in the middle of that section. Maybe you arrive at the letter `c`.
5656

57-
<img src="/img/tutorial/indexes/dictionary006.svg">
57+
<img src="/img/tutorial/indexes/dictionary005.drawio.svg">
5858

5959
You know the word `database` has to be **after** that and **not before** that point, so you can discard the left part of that block of pages.
6060

61-
<img src="/img/tutorial/indexes/dictionary007.svg">
61+
<img src="/img/tutorial/indexes/dictionary007.drawio.svg">
6262

6363
You repeat this process **a few more times**, and you finally arrive at the letter `d`, you continue with the same process in that section for the letter `d` and you finally **find the word** `database`. 🎉
6464

65-
<img src="/img/tutorial/indexes/dictionary008.svg">
65+
<img src="/img/tutorial/indexes/dictionary008.drawio.svg">
6666

6767
You had to open the dictionary a few times, maybe **5 or 10**. That's actually **very little work** compared to what it could have been.
6868

@@ -96,7 +96,7 @@ Open the index, and after **5 or 10 steps**, quickly find the topic "**database*
9696

9797
Now you know that you need to find "**page 253**". But by looking at the closed book you still don't know where that page is, so you have to **find that page**. To find it, you can do the same process again, but this time, instead of searching for a **topic** in the **index**, you are searching for a **page number** in the **entire book**. And after **5 or 10 more steps**, you find the page 253 in Chapter 5.
9898

99-
<img src="/img/tutorial/indexes/techbook001.svg">
99+
<img src="/img/tutorial/indexes/techbook001.drawio.svg">
100100

101101
After this, even though this book is not a dictionary and has some particular content, you were able to **find the section** in the book that talks about a "**database**" in a **few steps** (say 10 or 20, instead of reading all the 500 pages).
102102

docs/tutorial/limit-and-offset.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ And you also know how to get multiple rows while filtering them using `.where()`
66

77
Now let's see how to get only a **range of results**.
88

9-
<img class="shadow" alt="table with first 3 rows selected" src="/img/tutorial/offset-and-limit/limit.svg">
9+
<img class="shadow" alt="table with first 3 rows selected" src="/img/tutorial/offset-and-limit/limit.drawio.svg">
1010

1111
## Create Data
1212

@@ -34,7 +34,7 @@ The special **select** object we get from `select()` also has a method `.limit()
3434

3535
In this case, instead of getting all the 7 rows, we are limiting them to only get the first 3.
3636

37-
<img class="shadow" alt="table with first 3 rows selected" src="/img/tutorial/offset-and-limit/limit.svg">
37+
<img class="shadow" alt="table with first 3 rows selected" src="/img/tutorial/offset-and-limit/limit.drawio.svg">
3838

3939
## Run the Program on the Command Line
4040

@@ -87,7 +87,7 @@ And then you can interact with the user interface to get the next page, and so o
8787

8888
How do we get the next 3?
8989

90-
<img class="shadow" alt="table with next rows selected, from 4 to 6" src="/img/tutorial/offset-and-limit/limit2.svg">
90+
<img class="shadow" alt="table with next rows selected, from 4 to 6" src="/img/tutorial/offset-and-limit/limit2.drawio.svg">
9191

9292
We can use `.offset()`:
9393

@@ -134,7 +134,7 @@ Then to get the next batch of 3 rows we would offset all the ones we already saw
134134

135135
The database right now has **only 7 rows**, so this query can only get 1 row.
136136

137-
<img class="shadow" alt="table with the last row (7th) selected" src="/img/tutorial/offset-and-limit/limit3.svg">
137+
<img class="shadow" alt="table with the last row (7th) selected" src="/img/tutorial/offset-and-limit/limit3.drawio.svg">
138138

139139
But don't worry, the database won't throw an error trying to get 3 rows when there's only one (as would happen with a Python list).
140140

docs/tutorial/many-to-many/create-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Let's continue from where we left and create some data.
44

55
We'll create data for this same **many-to-many** relationship with a link table:
66

7-
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.svg">
7+
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.drawio.svg">
88

99
We'll continue from where we left off with the previous code.
1010

docs/tutorial/many-to-many/create-models-with-link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We'll now support **many-to-many** relationships using a **link table** like this:
44

5-
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.svg">
5+
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.drawio.svg">
66

77
Let's start by defining the class models, including the **link table** model.
88

docs/tutorial/many-to-many/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ We have a column in the `hero` table for the `team_id` that points to the ID of
5757

5858
This is how we connect each `hero` with a `team`:
5959

60-
<img alt="table relationships" src="/img/databases/relationships.svg">
60+
<img alt="table relationships" src="/img/databases/relationships.drawio.svg">
6161

6262
Notice that each hero can only have **one** connection. But each team can receive **many** connections. In particular, the team **Preventers** has two heroes.
6363

@@ -83,7 +83,7 @@ As this will represent the **hero-team-link**, let's call the table `heroteamlin
8383

8484
It would look like this:
8585

86-
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.svg">
86+
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.drawio.svg">
8787

8888
Notice that now the table `hero` **doesn't have a `team_id`** column anymore, it is replaced by this link table.
8989

0 commit comments

Comments
 (0)