Interface SqlIndexDefinitionProvider

All Superinterfaces:
DefinitionProvider

@Internal public non-sealed interface SqlIndexDefinitionProvider extends DefinitionProvider
Extension interface to generate vendor-specific SQL index definitions for schema generation.

Implementations are internal Micronaut beans consulted by the schema generator and are not intended as a stable user extension point.

This mirrors SqlColumnDefinitionProvider but for index DDL.
Since:
5.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    getIndexDefinition(String indexName, String escapedTableName, String[] columns, boolean escape, Function<String,String> quoter, SqlIndexMapping mapping, Dialect dialect)
    Produce the index DDL string for the provided mapping and context.
    boolean
    supports(io.micronaut.core.type.Argument<?> argument, Dialect dialect)
    Whether this provider supports the given property for the specified dialect.
  • Method Details

    • supports

      boolean supports(io.micronaut.core.type.Argument<?> argument, Dialect dialect)
      Whether this provider supports the given property for the specified dialect.
      Parameters:
      argument - The persistent property argument
      dialect - The SQL dialect
      Returns:
      true if supported
    • getIndexDefinition

      String getIndexDefinition(String indexName, String escapedTableName, String[] columns, boolean escape, Function<String,String> quoter, SqlIndexMapping mapping, Dialect dialect)
      Produce the index DDL string for the provided mapping and context.
      Parameters:
      indexName - The index name (already escaped if needed)
      escapedTableName - The table name (already escaped if needed)
      columns - The index column names (unescaped)
      escape - Whether columns should be quoted/escaped
      quoter - A function to quote an identifier when escape is true
      mapping - The index mapping
      dialect - The SQL dialect
      Returns:
      The CREATE INDEX... DDL string