Fork me on GitHub
#sql
<
2021-09-01
>
finchharold07:09:38

Hi all, how to concat jsonb in sqlingvo?

finchharold07:09:31

Ex:

UPDATE table
SET json_field = json_field || new_json_data;
This in sqlingvo?

seancorfield17:09:45

@kishorekaranam99 Not many folks around at that time of night. No idea about sqlingvo but that operator is built-in to #honeysql

dev=> (-> {:update :table :set {:json_field [:|| :json_field :new_json_data]}}
 #_=>     (sql/format))
["UPDATE table SET json_field = json_field || new_json_data"]
dev=> (-> (h/update :table)
 #_=>     (h/set {:json_field [:|| :json_field :new_json_data]})
 #_=>     (sql/format))
["UPDATE table SET json_field = json_field || new_json_data"]