From da8f8637a8e928b460b64e32152d5a643421afde Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Sat, 24 Apr 2021 23:34:02 +0900 Subject: [PATCH] Add document to insert array data (#132) --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 280f0a7..94ea98e 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,19 @@ The API converts RESTful request to SQL statements. - MySQL - PostgreSQL +## How to insert array data into PostgreSQL +DataAPI have not support inserting array data with `SqlParameter` yet. +But, @ormu5 give us this workaround to insert array data. +```sql +insert into cfg.attributes(id, type, attributes) +values(:id, :type, cast(:attributes as text[])); +``` +where the value for attributes parameter is a string properly formatted as Postgres array, e.g., `'{"Volume","Material"}'`. + +Thanks to @ormu5. + + + ## Version 0.6.0 ### local-data-api has been re-written in Kotlin #### Motivation