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

community[patch]: allow to use postgres pool instance on PostgresRecordManager #5677

Conversation

josemussa
Copy link
Contributor

@josemussa josemussa commented Jun 5, 2024

This is a proposal to support passing an instance of Pool when instantiating PostgresRecordManager. This would enable the reuse of an existing database connection pool.

import pg from "pg";

const pool = new pg.Pool(postgresConnectionOptions);

const providedPoolRecordManager = new PostgresRecordManager("test", {
  ...config,
  pool,
});

Fixes # (issue)
#5676

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 5, 2024
Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 9:35pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview Jun 5, 2024 9:35pm

@jacoblee93
Copy link
Collaborator

jacoblee93 commented Jun 11, 2024

Thank you! Sorry about the wait!

@jacoblee93 jacoblee93 changed the title chore: allow to use postgres pool instance on PostgresRecordManager community[patch]: allow to use postgres pool instance on PostgresRecordManager Jun 11, 2024
@jacoblee93 jacoblee93 merged commit e177b2f into langchain-ai:main Jun 11, 2024
17 checks passed
@josemussa josemussa deleted the community-postgres-record-manager-accept-pool-option-5676 branch June 12, 2024 09:37
@biswarup-banerjee
Copy link

@josemussa This is a really helpful fix! Thanks for this! Really cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants