Interface SqlColumnDefinitionProvider

All Superinterfaces:
DefinitionProvider
All Known Subinterfaces:
ByteVectorAttributeConverter<X>, DoubleVectorAttributeConverter<X>, FloatVectorAttributeConverter<X>, SparseByteVectorAttributeConverter<X>, SparseDoubleVectorAttributeConverter<X>, SparseFloatVectorAttributeConverter<X>, VectorAttributeConverter<X>

@Internal public non-sealed interface SqlColumnDefinitionProvider extends DefinitionProvider
Extension interface to provide vendor-specific SQL column definitions during schema generation.

Implementations are internal Micronaut beans discovered by schema utilities and are not intended as a stable user extension point.

Since:
5.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    getColumnDefinition(io.micronaut.core.type.Argument<?> argument, DatabaseType databaseType)
    Return a vendor-specific SQL column definition for this attribute, or null to delegate to default mapping.
    boolean
    supports(io.micronaut.core.type.Argument<?> argument)
    Whether this provider can handle the given attribute.
  • Method Details

    • getColumnDefinition

      @Nullable String getColumnDefinition(io.micronaut.core.type.Argument<?> argument, DatabaseType databaseType)
      Return a vendor-specific SQL column definition for this attribute, or null to delegate to default mapping.

      Implementations should inspect the provided Argument to extract length/precision/scale and relevant annotations (e.g. @jakarta.persistence.Column, @jakarta.validation.constraints.Size) and produce a dialect-specific column type.

      Parameters:
      argument - the Micronaut Argument describing the attribute (type + annotations)
      databaseType - the canonical database type for which a definition should be produced
      Returns:
      the SQL column definition string, or null to allow default resolution
    • supports

      boolean supports(io.micronaut.core.type.Argument<?> argument)
      Whether this provider can handle the given attribute.
      Parameters:
      argument - the attribute argument
      Returns:
      true if this provider can generate a column definition for the given argument