Thread
#exposed
    d

    Damien

    7 months ago
    Is there any way to run a sort/select on a jsonb column in Postgres? (e.g.
    order by my_json_column->'key' ASC
    ). Is it possible to write a raw/custom order expression for this? Not sure where to start.
    b

    Bogdan

    7 months ago
    Exposed пока tot не поддерживает JSON(B) (https://github.com/JetBrains/Exposed/wiki/DataTypes, https://github.com/JetBrains/Exposed/issues/127). You can declare a column of type string (the database schema must already be created). Or manually implement a new column type (an example can be found in the issue). Assuming this option suits you.
    Select and sorting is performed by regular means Exposed
    d

    Damien

    7 months ago
    Thanks! I'll take a look. I already have a jsonb extension based on input from one of those issues. Haven't figured out how to select/sort based on the column, though.
    b

    Bogdan

    7 months ago
    You need to implement the operators you need. Interface Op. Example: concat function, see implementation for Oracle (OracleDialect.kt). It just acts as an operator, not a function.