prorm API Reference
    Preparing search index...

    JSON - standard JSON (text-based)

    • PostgreSQL: native JSON type
    • MySQL/MariaDB: native JSON type
    • SQLite: TEXT with JSON handling
    // Use native JSON where supported
    metadata: DataTypes.JSON(true)
    // Use TEXT fallback (useful for SQLite compatibility)
    settings: DataTypes.JSON(false) // or DataTypes.JSON()

    Hierarchy (View Summary)

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

    Whether to use native JSON type or store as TEXT

    • true: Use native JSON type where supported
    • false: Always use TEXT (useful for SQLite or when JSON is not supported)
    • Serialize a value for storage based on this DataType

      Parameters

      • value: unknown

        The value to serialize

      Returns unknown

      The serialized value