Skip to content

Docs are missing info on how to enable inline errors(configure pyright) (at least in VSCode they are not automatic) #62

@toinbis

Description

@toinbis

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the SQLModel documentation, with the integrated search.
  • I already searched in Google "How to X in SQLModel" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to SQLModel but to Pydantic.
  • I already checked if it is not related to SQLModel but to SQLAlchemy.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

"""Main module"""
from typing import Optional

from sqlmodel import Field, SQLModel


class Hero(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str
    secret_name: str
    age: Optional[int] = None


hero_1 = Hero(name="Deadpond", secret_name="Dive Wilson")
hero_2 = Hero(name="Spider-Boy", secret_name="Pedro Parqueador")
hero_3 = Hero(name="Rusty-Man", secret_name='Tom')

a = hero_1.name + 5

Description

https://github.com/tiangolo/sqlmodel/blob/main/docs/index.md#editor-support suggests that inline errors will be automatic. At least in VSCode, they are not. Docs need clarification on how to achieve this.

Wanted Solution

Docs should note that additional vscode config is needed to get inline errors.

Wanted Code

"python.analysis.diagnosticSeverityOverrides": {
        "reportGeneralTypeIssues": "information"
    }


### Alternatives

_No response_

### Operating System

macOS

### Operating System Details

_No response_

### SQLModel Version

0.0.4

### Python Version

3.9.0

### Additional Context

This is the default result you get using sqlmodel in vscode:
![Screenshot 2021-08-31 at 14 43 26](https://user-images.githubusercontent.com/68685/131496606-c6a5f232-af59-440c-920b-ab29b8057832.png) . And it's different from what the docs state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions