-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
community[patch]: Adds support for passing schemaName to pgvector #4543
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
FOREIGN KEY (collection_id) | ||
REFERENCES ${this.collectionTableName}(uuid) | ||
ON DELETE CASCADE; | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to run yarn format
!
@@ -521,7 +561,23 @@ export class PGVectorStore extends VectorStore { | |||
FOREIGN KEY (collection_id) | |||
REFERENCES ${this.collectionTableName}(uuid) | |||
ON DELETE CASCADE; | |||
`); | |||
` : ` | |||
CREATE TABLE IF NOT EXISTS ${this.schemaName}.${this.collectionTableName} ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be in quotes to account for capitalization?
Looks good to me overall - main question is should these new/old queries be in quotes though to account for capitalizations? |
Good catch there, I've added some string wrapping around a few calls where it seems appropriate |
…ions with schema call
I found a bug where the operator |
Does setting the search_path only persist for that specific connection or does it change at the db level? |
It looks like it only lasts for the duration of that connection. When I manually query the db with |
Gotcha! Is that for the pool in general or is this tied to the client the pool creates to run the query? In the first case, we may run into issues if we ever allow passing a pool instance, instead of creating a new one (as proposed in #4409 and present in PostgresChatHistory) among other unforeseen consequences for users. In the latter case, we could get unlucky and the pool uses a different client for each query. Have you seen this ? Might be applicable here?. |
I haven't seen that yet, thanks that helps a lot in this case. I pushed a refactor that opts for the |
Thank you both! |
Adds schemaName option to PGVectorStoreArgs
Adds extensionSchemaName option to PGVectorStoreArgs