Enum Class ColumnType

java.lang.Object
java.lang.Enum<ColumnType>
group.worldstandard.pudel.api.database.ColumnType
All Implemented Interfaces:
Serializable, Comparable<ColumnType>, Constable

public enum ColumnType extends Enum<ColumnType>
Supported column types for plugin database tables.
  • Enum Constant Details

    • BIGINT

      public static final ColumnType BIGINT
      64-bit integer (BIGINT in PostgreSQL). Use for IDs, large numbers, Discord snowflakes.
    • INTEGER

      public static final ColumnType INTEGER
      32-bit integer (INTEGER in PostgreSQL). Use for counts, small numbers.
    • SMALLINT

      public static final ColumnType SMALLINT
      16-bit integer (SMALLINT in PostgreSQL). Use for very small numbers, enums.
    • BOOLEAN

      public static final ColumnType BOOLEAN
      Boolean (BOOLEAN in PostgreSQL). Use for true/false flags.
    • STRING

      public static final ColumnType STRING
      Variable-length string (VARCHAR in PostgreSQL). Requires size parameter. Use for short strings.
    • TEXT

      public static final ColumnType TEXT
      Unlimited text (TEXT in PostgreSQL). Use for long content, descriptions.
    • TIMESTAMP

      public static final ColumnType TIMESTAMP
      Timestamp with timezone (TIMESTAMPTZ in PostgreSQL). Use for dates and times.
    • DATE

      public static final ColumnType DATE
      Date only (DATE in PostgreSQL).
    • TIME

      public static final ColumnType TIME
      Time only (TIME in PostgreSQL).
    • DECIMAL

      public static final ColumnType DECIMAL
      Decimal number (NUMERIC in PostgreSQL). Use for precise decimal values (money, etc.).
    • DOUBLE

      public static final ColumnType DOUBLE
      Double precision floating point (DOUBLE PRECISION in PostgreSQL). Use for scientific calculations.
    • FLOAT

      public static final ColumnType FLOAT
      Single precision floating point (REAL in PostgreSQL).
    • JSON

      public static final ColumnType JSON
      JSON data (JSONB in PostgreSQL). Use for structured data, configurations.
    • BINARY

      public static final ColumnType BINARY
      Binary data (BYTEA in PostgreSQL). Use for small binary blobs.
    • UUID

      public static final ColumnType UUID
      UUID (UUID in PostgreSQL). Use for unique identifiers.
  • Method Details

    • values

      public static ColumnType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ColumnType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSqlType

      public String getSqlType()
      Returns the SQL type name used in PostgreSQL for this column type.

      This method provides the exact PostgreSQL type that corresponds to the enum constant, such as "BIGINT", "VARCHAR", "TIMESTAMPTZ", etc.

      Returns:
      the SQL type name as a string
    • getSqlType

      public String getSqlType(Integer size)
      Get the SQL type with size if applicable.
      Parameters:
      size - the size/length
      Returns:
      SQL type string