Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ckhrysze/4b7cbec6cb332176d95aadaaa4ec6d58 to your computer and use it in GitHub Desktop.
Save ckhrysze/4b7cbec6cb332176d95aadaaa4ec6d58 to your computer and use it in GitHub Desktop.
sql = "select * from example as ex cross join jsonb_each(ex.data) as dt where value->>'ref' = 'ref_1';"
result = JsonbTest.Repo.query!(sql)
Enum.map(result.rows, &JsonbTest.Repo.load(Example, {result.columns, &1}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment