# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class DatabaseColumnInfo(UniversalBaseModel):
    """
    Column metadata for table schema response.
    """

    data_type: str = pydantic.Field()
    """
    PostgreSQL data type
    """

    default_value: typing.Optional[str] = pydantic.Field(default=None)
    """
    Default value expression
    """

    is_nullable: bool = pydantic.Field()
    """
    Whether the column allows NULL values
    """

    max_length: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum length for character types
    """

    name: str = pydantic.Field()
    """
    Column name
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
