Skip to content

Refactor jsonb_quote_value method #12

@antoinemacia

Description

@antoinemacia

Availability to use Oj to dump JSON rather than using to_json

Potentially convert ruby types ourselves to make the process quicker, e.g

      def jsonb_quote_value(value)
        case value
        when String then "'\"#{connection.quote_string(value)}\"'"
        when Date, Time then "'\"#{value.iso8601}\"'"
        when nil then %('null')
        when Hash then %('#{value.to_json}')
        else %('#{value}')
        end
      end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions