From 350eb3f9d2c2427203f63e5afbc9a5e10794c91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 15 Oct 2026 17:32:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Hide=20SQLModel=20formatting=20g?= =?UTF-8?q?uards=20in=20HTML=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/db-to-code.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/db-to-code.md b/docs/db-to-code.md index 4b24bd1bb3..56e468c987 100644 --- a/docs/db-to-code.md +++ b/docs/db-to-code.md @@ -129,15 +129,15 @@ With **SQLModel**, instead of writing SQL statements directly, you use Python cl For example, you could ask the database for the same hero with ID `2` with this code: + ```Python user_id = input("Type the user ID: ") -# fmt: off session.exec( select(Hero).where(Hero.id == user_id) ).all() -# fmt: on ``` + If the user provides this ID: @@ -232,13 +232,13 @@ results = database.execute(statement) But if you use common Python classes and objects, your editor will be able to help you: + ```Python -# fmt: off database.execute( select(Hero).where(Hero.secret_name == "Dive Wilson") ).all() -# fmt: on ``` + ![](img/db-to-code/autocompletion01.png){class="shadow"}