Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a full example for sqlmodel and fix error in README.md. #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FFengIll
Copy link

@FFengIll FFengIll commented Sep 18, 2023

MENTION: we can not ignore the primary key (e.g. id) via pgvector now.


class Item(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)

Choose a reason for hiding this comment

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

Another approach is

id: int = Field(primary_key=True, sa_column_kwargs={"autoincrement": True})

They both seem to have same effect, from what I can tell, so maybe something is autoincrementing behind the scenes.

Copy link

@pamelafox pamelafox left a comment

Choose a reason for hiding this comment

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

I agree that this change is needed, as the current code produces an error.

@FFengIll FFengIll force-pushed the feat/sqlmodel-sample branch from a3e08bb to c6b11aa Compare February 28, 2024 13:14
@FFengIll
Copy link
Author

FFengIll commented Feb 28, 2024

I agree that this change is needed, as the current code produces an error.

I have updated which resolved the conflict.
Will PR to be merged or Closed? @pamelafox

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.

2 participants