prorm API Reference
    Preparing search index...

    JSONB - binary JSON (PostgreSQL native)

    • PostgreSQL: native JSONB type (binary format, indexed)
    • MySQL/MariaDB: TEXT with JSON handling (no native JSONB)
    • SQLite: TEXT with JSON handling

    Benefits of JSONB in PostgreSQL:

    • Binary storage format (faster parsing)
    • Supports indexing with GIN
    • Key existence operators (? &?| etc.)
    // Use native JSONB for PostgreSQL, TEXT for others
    settings: DataTypes.JSONB()
    // or DataTypes.JSONB(true)

    // Always use TEXT (useful when JSONB features not needed)
    metadata: DataTypes.JSONB(false)

    Hierarchy (View Summary)

    Index
    key: "JSONB" = ...
    useNative: boolean

    Whether to use native JSONB type or store as TEXT

    • true: Use native JSONB for PostgreSQL, TEXT for others
    • false: Always use TEXT (useful for SQLite/MySQL compatibility)
    • Serialize a value for storage based on this DataType

      Parameters

      • value: unknown

        The value to serialize

      Returns unknown

      The serialized value