Skip to content

✏️ Fix grammar and typos in docs - #2058

Open
YuriiMotov wants to merge 12 commits into
mainfrom
fix-typos-and-grammar
Open

✏️ Fix grammar and typos in docs#2058
YuriiMotov wants to merge 12 commits into
mainfrom
fix-typos-and-grammar

Conversation

@YuriiMotov

Copy link
Copy Markdown
Member

Description

Fixed typos and grammar mistakes in docs.

AI Disclaimer

I used Claude Code to find and fix mistakes, but carefully reviewed all corrections and asked to rephrase a couple of sentences to make them easier to read.

Checklist

  • This PR links to a GitHub Discussion for the proposed code change.
  • I added tests for the change.
  • The new or updated tests fail on the main branch and pass on this PR.
  • Coverage stays at 100%.
  • The documentation explains the change if needed.

@YuriiMotov YuriiMotov added the docs Improvements or additions to documentation label Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit f8468ce at: https://0e1473a3.sqlmodel.pages.dev

Modified Pages

@YuriiMotov
YuriiMotov marked this pull request as draft July 30, 2026 20:39
@YuriiMotov
YuriiMotov force-pushed the fix-typos-and-grammar branch from 42e88d8 to c9834e0 Compare July 30, 2026 21:25

@YuriiMotov YuriiMotov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some clarifications

* `age`, optional

And we want to have a `HeroPublic` with the `id` field, but this time with a type of `id: int`, instead of `id: int | None`, to make it clear that it will always have an `int` in responses **read** from the clients:
And we want to have a `HeroPublic` with the `id` field, but this time with a type of `id: int`, instead of `id: int | None`, to make it clear that it will always have an `int` in responses **read** by the clients:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responses are being read by clients, not from clients

## Handling Errors

Then, because FastAPI already takes care of making sure that the `hero_id` is an actual integer, we can use it directly with `Hero.get()` to try and get one hero by that ID.
Then, because FastAPI already takes care of making sure that the `hero_id` is an actual integer, we can use it directly with `session.get()` to try and get one hero by that ID.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such syntax in SQLModel. In code example it's hero = session.get(Hero, hero_id)

The same way there's a `.where()` available when using `select()`, there's also a `.join()`.

And in SQLModel (actually SQLAlchemy), when using the `.join()`, because we already declared what is the `foreign_key` when creating the models, we don't have to pass an `ON` part, it is inferred automatically:
And in SQLModel (actually SQLAlchemy), we don't have to pass an `ON` part when using `.join()`. It is inferred automatically because we already declared the `foreign_key` in the model definition:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a wrong word order in initial sentence:

we already declared what is the foreign_key

should be

we already declared what the foreign_key is

(is should go after the subject)

But just moving "is" to correct place made the whole sentence even harder to read. I suggest rephrasing it this way

## One Session per Request

Remember that we should use a SQLModel **session** per each group of operations and if we need other unrelated operations we should use a different session?
Remember that we should use a SQLModel **session** per group of operations and if we need other unrelated operations we should use a different session?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per is not used with each. It already means for each

## Run the **FastAPI** Server in Production Mode

The development mode should not be used in production, as it includes automatic reload by default it consumes much more resources than necessary, and it would be more error prone, etc.
The development mode should not be used in production: it includes automatic reload by default, which consumes far more resources than necessary and is more error-prone.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLM failed to understand this sentence and suggested silly edits. After several iterations we came to this rephrasing.

Comment thread docs/tutorial/insert.md
> * `"Dive Wilson"`

### Try it in DB Explorer for SQLite
### Try it in DB Browser for SQLite

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/databases.md
</tr>
<tr>
<td>1</td><td>Deadpond</td><td>Dive Wilson</td><td>null</td><td>Z-Factor</td><td>Sister Margaret's Bar</td>
<td>1</td><td>Deadpond</td><td>Dive Wilson</td><td>null</td><td>Z-Force</td><td>Sister Margaret's Bar</td>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Z-Force everywhere else, and I checked it's not intentional

Comment thread scripts/docs.py

Takes an optional LANG argument with the name of the language to serve, by default
en.
Serve the docs site with livereload, at http://127.0.0.1:8008.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover from FastAPI's version


This is the original SQLAlchemy `session.execute()` method that returns objects
of type `Row`, and that you have to call `scalars()` to get the model objects.
of type `Row`, on which you have to call `scalars()` to get the model objects.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can break the warning filters in tests for people who are using this method. But it's easily fixable

Comment thread sqlmodel/main.py
raise ValueError(
"Can't use sqlmodel_update() with something that "
f"is not a dict or SQLModel or Pydantic model: {obj}"
f"is not a dict, SQLModel, or Pydantic model: {obj}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates the error message - hope it will not break someone's code :)

@YuriiMotov
YuriiMotov marked this pull request as ready for review July 30, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants