Skip to content

Commit da8f863

Browse files
authored
Add document to insert array data (#132)
1 parent e964abd commit da8f863

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ The API converts RESTful request to SQL statements.
1919
- MySQL
2020
- PostgreSQL
2121

22+
## How to insert array data into PostgreSQL
23+
DataAPI have not support inserting array data with `SqlParameter` yet.
24+
But, @ormu5 give us this workaround to insert array data.
25+
```sql
26+
insert into cfg.attributes(id, type, attributes)
27+
values(:id, :type, cast(:attributes as text[]));
28+
```
29+
where the value for attributes parameter is a string properly formatted as Postgres array, e.g., `'{"Volume","Material"}'`.
30+
31+
Thanks to @ormu5.
32+
33+
34+
2235
## Version 0.6.0
2336
### local-data-api has been re-written in Kotlin
2437
#### Motivation

0 commit comments

Comments
 (0)