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 Details

  • Method Details

    • createJdbcUrl

      String createJdbcUrl(String host, int port, String database)
    • isJdbcUrl

      boolean isJdbcUrl(String jdbcUrl)
    • createIndexDDL

      String createIndexDDL(DistanceFunction distanceFunction, String indexType, String table, String embeddingColumn, String indexOptions)
    • 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, see Index.options(). This is for databases that create the vector index together with the table, instead of with a separate statement from createIndexDDL(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, see HibernateEmbeddingStore.BaseBuilder.createIndex(Boolean)
      distanceFunction - the distance function of the store
      indexType - the index type set on the builder, or null
      table - the name of the embedding table
      embeddingColumn - the name of the embedding column
      indexOptions - the index options set on the builder, or null
      Returns:
      the index options, or null to declare no vector index on the table
      Throws:
      IllegalArgumentException - if the database does not support the distance function
      See Also:
    • defaultQueryHints

      default Map<String,Object> 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 the queryHints(...) 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

      static DatabaseKind determineDatabaseKind(String jdbcUrl)
    • determineDatabaseKind

      static DatabaseKind determineDatabaseKind(org.hibernate.dialect.Dialect dialect)