-
The example provided in the docs has this in
and this in the migration:
Which outputs:
It puts the entire value of the JSON into a single JSON column. I want to import the entire row's values from a JSON. The problem is that, if I put Putting it in the migration isn't an option either because I get Is there a way to do this or should I just use raw SQL to seed the table? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey @leojweda, what's the driver you're using? Either MySQL or PG? |
Beta Was this translation helpful? Give feedback.
You can use the
json_array_elements
to parse the JSON string from variable, then insert into your table. This is batch insert so it should faster than multiple insert statements.