Interface DatabaseKind
- All Known Implementing Classes:
MilvusDatabaseKind
public interface DatabaseKind
Database kind
- DB2: The IBM DB2 database
- MARIADB: The MariaDB database
- MSSQL: The Microsoft SQL Server database
- MYSQL: The MySQL database
- POSTGRESQL: The PostgreSQL database
- COCKROACHDB: The Cockroach database
- ORACLE: The Oracle database
- HANA: The SAP HANA database
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DatabaseKindstatic final DatabaseKindstatic final DatabaseKindstatic final DatabaseKindstatic final DatabaseKindstatic final DatabaseKindstatic final DatabaseKindstatic final DatabaseKind -
Method Summary
Modifier and TypeMethodDescriptioncreateIndexDDL(DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) createJdbcUrl(String host, int port, String database) Returns the query hints that every similarity search uses by default, for example a consistency level.static DatabaseKinddetermineDatabaseKind(String jdbcUrl) static DatabaseKinddetermineDatabaseKind(org.hibernate.dialect.Dialect dialect) booleandefault StringtableIndexOptions(boolean createIndex, DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) Returns the options of a vector index that is declared on the embedding table, seeIndex.options().
-
Field Details
-
DB2
-
MARIADB
-
MSSQL
-
MYSQL
-
POSTGRESQL
-
COCKROACHDB
-
ORACLE
-
HANA
-
-
Method Details
-
createJdbcUrl
-
isJdbcUrl
-
createIndexDDL
-
getSetupSql
String getSetupSql() -
tableIndexOptions
default String tableIndexOptions(boolean createIndex, DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions) Returns the options of a vector index that is declared on the embedding table, seeIndex.options(). This is for databases that create the vector index together with the table, instead of with a separate statement fromcreateIndexDDL(DistanceFunction, String, String, String, String). Only the dynamic builders use it, when they map the embedding table.The built-in database kinds return
null, because they create the vector index with a separate statement.- Parameters:
createIndex- whether the builder is configured to create a vector index, seeHibernateEmbeddingStore.BaseBuilder.createIndex(Boolean)distanceFunction- the distance function of the storeindexType- the index type set on the builder, ornulltable- the name of the embedding tableembeddingColumn- the name of the embedding columnindexOptions- the index options set on the builder, ornull- Returns:
- the index options, or
nullto declare no vector index on the table - Throws:
IllegalArgumentException- if the database does not support the distance function- See Also:
-
defaultQueryHints
Returns the query hints that every similarity search uses by default, for example a consistency level. A hint with the same name that is passed to thequeryHints(...)builder method replaces the default one.The built-in database kinds have no default hints.
- Returns:
- the default query hints, never
null - See Also:
-
determineDatabaseKind
-
determineDatabaseKind
-