java.lang.Object
dev.langchain4j.community.store.embedding.alloydb.AlloyDBEngine

public class AlloyDBEngine extends Object
AlloyDBEngine

Instances of this store are created by configuring a builder:

AlloyDBEngine engine = new AlloyDBEngine.Builder(projectId, region, cluster, instance, database).build(); Uses HikariCP as a DataSource. A connection pool that will avoid the latency of repeatedly creating new database connections.
  • Constructor Details

    • AlloyDBEngine

      public AlloyDBEngine(AlloyDBEngine.Builder builder)
      Constructor for AlloyDBEngine
      Parameters:
      builder - builder.
  • Method Details

    • getConnection

      public Connection getConnection() throws SQLException
      Gets a Connection from the datasource
      Returns:
      A connection with the database specified in AlloyDBEngine
      Throws:
      SQLException - if database error occurs
    • initVectorStoreTable

      public void initVectorStoreTable(EmbeddingStoreConfig embeddingStoreConfig)
      Create a table for the EmbeddingStore
      Parameters:
      embeddingStoreConfig - contains the parameters necessary to initialize the Vector table
    • close

      public void close()
      Closes a Connection