Skip to content

Conversation

RanderGabriel
Copy link
Contributor

This PR introduces a new skipInitializationCheck option in PgVectorStore, allowing users to disable automatic schema modification during initialization (i.e., CREATE EXTENSION and CREATE TABLE).

This improves compatibility with production environments where database credentials are restricted and schema-altering permissions are not granted (e.g., cloud deployments following the principle of least privilege).

Changes:

  • Added skipInitializationCheck option to PgVectorStore
  • Skipped ensureTableInDatabase logic if the flag is enabled
  • Added tests to ensure backward compatibility and validate the new behavior

Fixes #8401

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 23, 2025
Copy link

vercel bot commented Jun 23, 2025

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

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Jul 15, 2025 6:53pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Jul 15, 2025 6:53pm

@dosubot dosubot bot added the auto:improvement Medium size change to existing code to handle new use-cases label Jun 23, 2025
@RanderGabriel
Copy link
Contributor Author

Hi @hntrl 👋 quick ping! This PR is important for security-sensitive environments. It’s marked size:L mainly due to tests, but the change is simple. Appreciate a review — thanks! 🚀

@RanderGabriel
Copy link
Contributor Author

Hi @hntrl! Sorry for pinging you again, but did you have the chance to review this pull request?

I know you guys work hard on this library and I really appreciate that. Thanks a lot for building it.

@hntrl
Copy link
Member

hntrl commented Jul 23, 2025

thanks for the ping and the kind words!

@hntrl hntrl merged commit ad075c6 into langchain-ai:main Jul 23, 2025
32 checks passed
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:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PgVectorStore always attempts to create table and enable extension, causing permission issues in secure environments
2 participants