-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Using SQL breaks jsonb syntax like -> or ->>.
Here is an example:
defmodule Bla do
use SQL, adapter: SQL.Adapters.Postgres
def migrate_from_query do
sql = ~SQL"""
update
payments.products
set
export_credits = (metadata -> 'value' ->> 'export')::bigint,
skip_trace_credits = (metadata -> 'value' ->> 'skip_trace')::bigint
"""
{query, []} = to_sql(sql)
query
end
endThis will generated the following query:
update payments.products set export_credits = (metadata - > 'value' - > > 'export') :: bigint, skip_trace_credits = (metadata - > 'value' - > > 'skip_trace') :: bigintAs you can see, it changed -> to - > and ->> to - > >.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working