Skip to content

Commit 73f922b

Browse files
committed
📝 Update link syntax to minimal Markdown
1 parent cd951c6 commit 73f922b

32 files changed

+159
-159
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
<em>SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.</em>
77
</p>
88
<p align="center">
9-
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest+event%3Apush+branch%3Amain" target="_blank">
9+
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest+event%3Apush+branch%3Amain">
1010
<img src="https://github.com/fastapi/sqlmodel/actions/workflows/test.yml/badge.svg?event=push&branch=main" alt="Test">
1111
</a>
12-
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3APublish" target="_blank">
12+
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3APublish">
1313
<img src="https://github.com/fastapi/sqlmodel/actions/workflows/publish.yml/badge.svg" alt="Publish">
1414
</a>
15-
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/sqlmodel" target="_blank">
15+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/sqlmodel">
1616
<img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/sqlmodel.svg" alt="Coverage">
17-
<a href="https://pypi.org/project/sqlmodel" target="_blank">
17+
<a href="https://pypi.org/project/sqlmodel">
1818
<img src="https://img.shields.io/pypi/v/sqlmodel?color=%2334D058&label=pypi%20package" alt="Package version">
1919
</a>
2020
</p>
2121

2222
---
2323

24-
**Documentation**: <a href="https://sqlmodel.tiangolo.com" target="_blank">https://sqlmodel.tiangolo.com</a>
24+
**Documentation**: [https://sqlmodel.tiangolo.com](https://sqlmodel.tiangolo.com)
2525

26-
**Source Code**: <a href="https://github.com/fastapi/sqlmodel" target="_blank">https://github.com/fastapi/sqlmodel</a>
26+
**Source Code**: [https://github.com/fastapi/sqlmodel](https://github.com/fastapi/sqlmodel)
2727

2828
---
2929

3030
SQLModel is a library for interacting with <abbr title='Also called "Relational databases"'>SQL databases</abbr> from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust.
3131

32-
**SQLModel** is based on Python type annotations, and powered by <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> and <a href="https://sqlalchemy.org/" class="external-link" target="_blank">SQLAlchemy</a>.
32+
**SQLModel** is based on Python type annotations, and powered by [Pydantic](https://pydantic-docs.helpmanual.io/) and [SQLAlchemy](https://sqlalchemy.org/).
3333

3434
The key features are:
3535

@@ -49,23 +49,23 @@ The key features are:
4949

5050
## SQL Databases in FastAPI
5151

52-
<a href="https://fastapi.tiangolo.com" target="_blank"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" style="width: 20%;"></a>
52+
<a href="https://fastapi.tiangolo.com"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" style="width: 20%;"></a>
5353

54-
**SQLModel** is designed to simplify interacting with SQL databases in <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a> applications, it was created by the same <a href="https://tiangolo.com/" class="external-link" target="_blank">author</a>. 😁
54+
**SQLModel** is designed to simplify interacting with SQL databases in [FastAPI](https://fastapi.tiangolo.com) applications, it was created by the same [author](https://tiangolo.com/). 😁
5555

5656
It combines SQLAlchemy and Pydantic and tries to simplify the code you write as much as possible, allowing you to reduce the **code duplication to a minimum**, but while getting the **best developer experience** possible.
5757

5858
**SQLModel** is, in fact, a thin layer on top of **Pydantic** and **SQLAlchemy**, carefully designed to be compatible with both.
5959

6060
## Requirements
6161

62-
A recent and currently supported <a href="https://www.python.org/downloads/" class="external-link" target="_blank">version of Python</a>.
62+
A recent and currently supported [version of Python](https://www.python.org/downloads/).
6363

6464
As **SQLModel** is based on **Pydantic** and **SQLAlchemy**, it requires them. They will be automatically installed when you install SQLModel.
6565

6666
## Installation
6767

68-
Make sure you create a <a href="https://sqlmodel.tiangolo.com/virtual-environments/" class="external-link" target="_blank">virtual environment</a>, activate it, and then install SQLModel, for example with:
68+
Make sure you create a [virtual environment](https://sqlmodel.tiangolo.com/virtual-environments/), activate it, and then install SQLModel, for example with:
6969

7070
<div class="termy">
7171

@@ -79,7 +79,7 @@ Successfully installed sqlmodel
7979

8080
## Example
8181

82-
For an introduction to databases, SQL, and everything else, see the <a href="https://sqlmodel.tiangolo.com/databases/" target="_blank">SQLModel documentation</a>.
82+
For an introduction to databases, SQL, and everything else, see the [SQLModel documentation](https://sqlmodel.tiangolo.com/databases/).
8383

8484
Here's a quick example. ✨
8585

docs/advanced/decimal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ As an example, if you open Python and sum `1.1` + `2.2` you would expect to see
1111
3.3000000000000003
1212
```
1313

14-
This is because of the way numbers are stored in "ones and zeros" (binary). But Python has a module and some types to have strict decimal values. You can read more about it in the official <a href="https://docs.python.org/3/library/decimal.html" class="external-link" target="_blank">Python docs for Decimal</a>.
14+
This is because of the way numbers are stored in "ones and zeros" (binary). But Python has a module and some types to have strict decimal values. You can read more about it in the official [Python docs for Decimal](https://docs.python.org/3/library/decimal.html).
1515

1616
Because databases store data in the same ways as computers (in binary), they would have the same types of issues. And because of that, they also have a special **decimal** type.
1717

1818
In most cases this would probably not be a problem, for example measuring views in a video, or the life bar in a videogame. But as you can imagine, this is particularly important when dealing with **money** and **finances**.
1919

2020
## Decimal Types
2121

22-
Pydantic has special support for <a href="https://docs.pydantic.dev/latest/api/standard_library_types/#decimaldecimal" class="external-link" target="_blank">`Decimal` types</a>.
22+
Pydantic has special support for [`Decimal` types](https://docs.pydantic.dev/latest/api/standard_library_types/#decimaldecimal).
2323

2424
When you use `Decimal` you can specify the number of digits and decimal places to support in the `Field()` function. They will be validated by Pydantic (for example when using FastAPI) and the same information will also be used for the database columns.
2525

2626
/// info
2727

28-
For the database, **SQLModel** will use <a href="https://docs.sqlalchemy.org/en/20/core/type_basics.html#sqlalchemy.types.DECIMAL" class="external-link" target="_blank">SQLAlchemy's `DECIMAL` type</a>.
28+
For the database, **SQLModel** will use [SQLAlchemy's `DECIMAL` type](https://docs.sqlalchemy.org/en/20/core/type_basics.html#sqlalchemy.types.DECIMAL).
2929

3030
///
3131

docs/advanced/uuid.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ This means that the UUID will be generated in the Python code, **before sending
8282

8383
{* ./docs_src/advanced/uuid/tutorial001_py310.py ln[1:10] hl[1,7] *}
8484

85-
Pydantic has support for <a href="https://docs.pydantic.dev/latest/api/standard_library_types/#uuid" class="external-link" target="_blank">`UUID` types</a>.
85+
Pydantic has support for [`UUID` types](https://docs.pydantic.dev/latest/api/standard_library_types/#uuid).
8686

87-
For the database, **SQLModel** internally uses <a href="https://docs.sqlalchemy.org/en/20/core/type_basics.html#sqlalchemy.types.Uuid" class="external-link" target="_blank">SQLAlchemy's `Uuid` type</a>.
87+
For the database, **SQLModel** internally uses [SQLAlchemy's `Uuid` type](https://docs.sqlalchemy.org/en/20/core/type_basics.html#sqlalchemy.types.Uuid).
8888

8989
### Create a Record with a UUID
9090

@@ -174,5 +174,5 @@ Selected hero ID:
174174

175175
You can learn more about **UUIDs** in:
176176

177-
* The official <a href="https://docs.python.org/3/library/uuid.html" class="external-link" target="_blank">Python docs for UUID</a>.
178-
* The <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier" class="external-link" target="_blank">Wikipedia for UUID</a>.
177+
* The official [Python docs for UUID](https://docs.python.org/3/library/uuid.html).
178+
* The [Wikipedia for UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).

docs/contributing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Contributing
22

3-
First, you might want to see the basic ways to [help SQLModel and get help](help.md){.internal-link target=_blank}.
3+
First, you might want to see the basic ways to [help SQLModel and get help](help.md).
44

55
## Developing
66

7-
If you already cloned the <a href="https://github.com/fastapi/sqlmodel" class="external-link" target="_blank">sqlmodel repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment.
7+
If you already cloned the [sqlmodel repository](https://github.com/fastapi/sqlmodel) and you want to deep dive in the code, here are some guidelines to set up your environment.
88

99
### Install Requirements Using `uv`
1010

@@ -112,7 +112,7 @@ $ mkdocs serve --dev-addr 8008
112112

113113
The instructions here show you how to use the script at `./scripts/docs.py` with the `python` program directly.
114114

115-
But you can also use <a href="https://typer.tiangolo.com/typer-cli/" class="external-link" target="_blank">Typer CLI</a>, and you will get autocompletion in your terminal for the commands after installing completion.
115+
But you can also use [Typer CLI](https://typer.tiangolo.com/typer-cli/), and you will get autocompletion in your terminal for the commands after installing completion.
116116

117117
If you install Typer CLI, you can install completion with:
118118

@@ -129,7 +129,7 @@ Completion will take effect once you restart the terminal.
129129

130130
### Docs Structure
131131

132-
The documentation uses <a href="https://www.mkdocs.org/" class="external-link" target="_blank">MkDocs</a>.
132+
The documentation uses [MkDocs](https://www.mkdocs.org/).
133133

134134
And there are extra tools/scripts in place in `./scripts/docs.py`.
135135

@@ -175,7 +175,7 @@ The same applies to comments and descriptions, please don't copy paste the conte
175175

176176
### Human Effort Denial of Service
177177

178-
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" class="external-link" target="_blank">Denial-of-service attack</a> on our human effort.
178+
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort.
179179

180180
It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).
181181

docs/databases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ I'll tell you more about SQL, SQLModel, how to use them, and how they are relate
319319

320320
/// info | Technical Details
321321

322-
SQLModel is built on top of SQLAlchemy. It is, in fact, just <a href="https://www.sqlalchemy.org/" class="external-link" target="_blank">SQLAlchemy</a> and <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> mixed together with some sugar on top.
322+
SQLModel is built on top of SQLAlchemy. It is, in fact, just [SQLAlchemy](https://www.sqlalchemy.org/) and [Pydantic](https://pydantic-docs.helpmanual.io/) mixed together with some sugar on top.
323323

324324
///
325325

docs/db-to-code.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ DROP TABLE hero;
111111

112112
That is how you tell the database in SQL to delete the entire table `hero`.
113113

114-
<a href="https://theuselessweb.site/nooooooooooooooo/" class="external-link" target="_blank">Nooooo!</a> We lost all the data in the `hero` table! 💥😱
114+
[Nooooo!](https://theuselessweb.site/nooooooooooooooo/) We lost all the data in the `hero` table! 💥😱
115115

116116
### SQL Sanitization
117117

118118
The process of making sure that whatever the external user sends is safe to use in the SQL string is called **sanitization**.
119119

120120
It comes by default in **SQLModel** (thanks to SQLAlchemy). And many other similar tools would also provide that functionality among many other features.
121121

122-
Now you are ready for <a href="https://xkcd.com/327/" class="external-link" target="_blank">a joke from xkcd</a>:
122+
Now you are ready for [a joke from xkcd](https://xkcd.com/327/):
123123

124124
![Exploits of a Mom](https://imgs.xkcd.com/comics/exploits_of_a_mom.png)
125125

@@ -292,7 +292,7 @@ It's actually a simple idea with a very academic and mathematical name. 😅
292292

293293
So, an **ORM** is a library that translates from SQL to code, and from code to SQL. All using classes and objects.
294294

295-
There are many ORMs available apart from **SQLModel**, you can read more about some of them in [Alternatives, Inspiration and Comparisons](alternatives.md){.internal-link target=_blank}
295+
There are many ORMs available apart from **SQLModel**, you can read more about some of them in [Alternatives, Inspiration and Comparisons](alternatives.md)
296296

297297
## SQL Table Names
298298

docs/environment-variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ print(f"Hello {name} from Python")
6767

6868
/// tip
6969

70-
The second argument to <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> is the default value to return.
70+
The second argument to [`os.getenv()`](https://docs.python.org/3.8/library/os.html#os.getenv) is the default value to return.
7171

7272
If not provided, it's `None` by default, here we provide `"World"` as the default value to use.
7373

@@ -155,7 +155,7 @@ Hello World from Python
155155

156156
/// tip
157157

158-
You can read more about it at <a href="https://12factor.net/config" class="external-link" target="_blank">The Twelve-Factor App: Config</a>.
158+
You can read more about it at [The Twelve-Factor App: Config](https://12factor.net/config).
159159

160160
///
161161

@@ -287,13 +287,13 @@ $ C:\opt\custompython\bin\python
287287

288288
////
289289

290-
This information will be useful when learning about [Virtual Environments](virtual-environments.md){.internal-link target=_blank}.
290+
This information will be useful when learning about [Virtual Environments](virtual-environments.md).
291291

292292
## Conclusion
293293

294294
With this you should have a basic understanding of what **environment variables** are and how to use them in Python.
295295

296-
You can also read more about them in the <a href="https://en.wikipedia.org/wiki/Environment_variable" class="external-link" target="_blank">Wikipedia for Environment Variable</a>.
296+
You can also read more about them in the [Wikipedia for Environment Variable](https://en.wikipedia.org/wiki/Environment_variable).
297297

298298
In many cases it's not very obvious how environment variables would be useful and applicable right away. But they keep showing up in many different scenarios when you are developing, so it's good to know about them.
299299

docs/features.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Designed for **FastAPI**
44

5-
**SQLModel** was created by the same <a href="https://tiangolo.com/" class="external-link" target="_blank">author</a> of FastAPI.
5+
**SQLModel** was created by the same [author](https://tiangolo.com/) of FastAPI.
66

7-
<a href="https://fastapi.tiangolo.com" target="_blank"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" style="width: 20%;"></a>
7+
<a href="https://fastapi.tiangolo.com"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" style="width: 20%;"></a>
88

99
It follows the same design and ideas, and it was created to be the most intuitive way to interact with SQL databases in FastAPI applications.
1010

@@ -14,29 +14,29 @@ Nevertheless, SQLModel is completely **independent** of FastAPI and can be used
1414

1515
It's all based on standard <abbr title="Currently supported versions of Python">modern **Python**</abbr> type annotations. No new syntax to learn. Just standard modern Python.
1616

17-
If you need a 2 minute refresher of how to use Python types (even if you don't use SQLModel or FastAPI), check the FastAPI tutorial section: <a href="https://fastapi.tiangolo.com/python-types/" class="external-link" target="_blank">Python types intro</a>.
17+
If you need a 2 minute refresher of how to use Python types (even if you don't use SQLModel or FastAPI), check the FastAPI tutorial section: [Python types intro](https://fastapi.tiangolo.com/python-types/).
1818

19-
You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/index.md){.internal-link target=_blank}.
19+
You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/index.md).
2020

2121
## Editor support
2222

2323
**SQLModel** was designed to be easy and intuitive to use to ensure the best development experience, with autocompletion everywhere.
2424

2525
Here's how your editor might help you:
2626

27-
* in <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>:
27+
* in [Visual Studio Code](https://code.visualstudio.com/):
2828

2929
<img class="shadow" src="/img/index/autocompletion02.png">
3030

31-
* in <a href="https://www.jetbrains.com/pycharm/" class="external-link" target="_blank">PyCharm</a>:
31+
* in [PyCharm](https://www.jetbrains.com/pycharm/):
3232

3333
<img class="shadow" src="/img/features/autocompletion01.png">
3434

3535
You will get completion for everything while writing the **minimum** amount of code.
3636

3737
You won't need to keep guessing the types of different attributes in your models, if they could be `None`, etc. Your editor will be able to help you with everything because **SQLModel** is based on **standard Python type annotations**.
3838

39-
**SQLModel** adopts <a href="https://peps.python.org/pep-0681/" class="external-link" target="_blank">PEP 681</a> for Python type annotations to ensure the **best developer experience**, so you will get inline errors and autocompletion even while creating new model instances.
39+
**SQLModel** adopts [PEP 681](https://peps.python.org/pep-0681/) for Python type annotations to ensure the **best developer experience**, so you will get inline errors and autocompletion even while creating new model instances.
4040

4141
<img class="shadow" src="/img/index/autocompletion01.png">
4242

@@ -76,7 +76,7 @@ Underneath, ✨ a **SQLModel** model is also a **SQLAlchemy** model. ✨
7676

7777
There was **a lot** of research and effort dedicated to make it that way. In particular, there was a lot of effort and experimentation in making a single model be **both a SQLAlchemy model and a Pydantic** model at the same time.
7878

79-
That means that you get all the power, robustness, and certainty of SQLAlchemy, the <a href="https://lp.jetbrains.com/python-developers-survey-2024/#orms" class="external-link" target="_blank">most widely used database library in Python</a>.
79+
That means that you get all the power, robustness, and certainty of SQLAlchemy, the [most widely used database library in Python](https://lp.jetbrains.com/python-developers-survey-2024/#orms).
8080

8181
**SQLModel** provides its own utilities to <abbr title="with type completion, type checks, etc.">improve the developer experience</abbr>, but underneath, it uses all of SQLAlchemy.
8282

0 commit comments

Comments
 (0)