You likely want to wrap the JSON values as well.
On Sequel 5.24:
DB.extension :pg_array, :pg_json
table.insert(
payment_terms: Sequel.pg_array([
Sequel.pg_json_wrap('{"key1":"val1"}'),
Sequel.pg_json_wrap('{"key2":"val2"}'),
])
)
On Tue, Sep 3, 2019 at 2:52 AM Mohamed Najiullah <
[email protected]> wrote:
> I'm trying to store a JSON array into a column.
>
> I have declared the column like this
>
> column :payment_terms, "json[]"
>
> I'm able to see that the column creation has worked fine. But how do I
> insert a JSON array into it?
>
> I've tried
>
> table.insert(
> field_name: Sequel.pg_array([
> '{"key1":"val1"}',
> '{"key2":""val2}'
> ])
> )
>
> This doesn't seem to work.
>
> Could you please help me out?
>
> Thank You
>
> --
> You received this message because you are subscribed to the Google Groups
> "sequel-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sequel-talk/9e5fb80d-8781-4c86-9688-2e82d53b388d%40googlegroups.com
> <https://groups.google.com/d/msgid/sequel-talk/9e5fb80d-8781-4c86-9688-2e82d53b388d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/CAL9jp8kR4MvYMJTfDW3kH_BfZL1c0_%2BKC-aRjZLQbd%3Dck%3Dr-kw%40mail.gmail.com.