Class AlloyDBEngine
java.lang.Object
dev.langchain4j.community.store.embedding.alloydb.AlloyDBEngine
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder which configures and creates instances ofAlloyDBEngine. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AlloyDBEngine.Builderbuilder()Create a newAlloyDBEngine.Builder.voidclose()Closes a ConnectionGets a Connection from the datasourcevoidinitVectorStoreTable(EmbeddingStoreConfig embeddingStoreConfig) Create a table for the EmbeddingStore
-
Constructor Details
-
AlloyDBEngine
Constructor for AlloyDBEngine- Parameters:
builder- builder.
-
-
Method Details
-
getConnection
Gets a Connection from the datasource- Returns:
- A connection with the database specified in
AlloyDBEngine - Throws:
SQLException- if database error occurs
-
initVectorStoreTable
Create a table for the EmbeddingStore- Parameters:
embeddingStoreConfig- contains the parameters necessary to initialize the Vector table
-
close
public void close()Closes a Connection -
builder
Create a newAlloyDBEngine.Builder.- Returns:
- the new
AlloyDBEngine.Builder.
-