Skip to content

Fix the sample code of SQLModel - #157

Closed
linyuansup wants to merge 2 commits into
pgvector:masterfrom
linyuansup:master
Closed

Fix the sample code of SQLModel#157
linyuansup wants to merge 2 commits into
pgvector:masterfrom
linyuansup:master

Conversation

@linyuansup

Copy link
Copy Markdown
  1. 'session.exec' overload doesn't match the provided arguments, change to conn.execute
  2. sa_type=VECTOR(3) cannot pass pylance check (but it works), change to sa_column=Column(VECTOR(3)) to pass pylance

Copilot AI lite review requested due to automatic review settings September 10, 2026 08:12
@linyuansup linyuansup changed the title Fix the sample code Fix the sample code of SQLModel Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The README sample needs a Column import to avoid a NameError.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates SQLModel README examples for SQLAlchemy execution and Pylance-compatible vector declarations.

Changes:

  • Uses conn.execute() within engine.begin().
  • Defines the vector field with sa_column=Column(VECTOR(3)).
File summaries
File Summary Review note
README.md Updates SQLModel usage examples. Add the missing Column import.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
@ankane

ankane commented Sep 10, 2026

Copy link
Copy Markdown
Member

Hi @linyuansup, the code runs fine. See fastapi/sqlmodel#1657 and fastapi/sqlmodel#1345.

@ankane ankane closed this Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants