diff --git a/sample_google_api/data.json b/sample_google_api/data.json index f61e5ba..f8afdad 100644 --- a/sample_google_api/data.json +++ b/sample_google_api/data.json @@ -1,29 +1,31 @@ -{ - "id": 1, - "doc": { - "rows": [ - { - "elements": [ - { - "status": "OK", - "distance": { - "text": "225 mi", - "value": 361940 - }, - "duration": { - "text": "3 hours 50 mins", - "value": 13812 +[ + { + "id": 1, + "doc": { + "rows": [ + { + "elements": [ + { + "status": "OK", + "distance": { + "text": "225 mi", + "value": 361940 + }, + "duration": { + "text": "3 hours 50 mins", + "value": 13812 + } } - } - ] - } - ], - "status": "OK", - "origin_addresses": [ - "Washington, DC, USA" - ], - "destination_addresses": [ - "New York, NY, USA" - ] + ] + } + ], + "status": "OK", + "origin_addresses": [ + "Washington, DC, USA" + ], + "destination_addresses": [ + "New York, NY, USA" + ] + } } -} \ No newline at end of file +] \ No newline at end of file diff --git a/sample_google_api/test/import.sql b/sample_google_api/test/import.sql index e69de29..21013ed 100644 --- a/sample_google_api/test/import.sql +++ b/sample_google_api/test/import.sql @@ -0,0 +1,37 @@ +SELECT + * +FROM + tps.srce_import( + 'DMAPI' + ,$$ + [{ + "id": 1, + "doc": { + "rows": [ + { + "elements": [ + { + "status": "OK", + "distance": { + "text": "225 mi", + "value": 361940 + }, + "duration": { + "text": "3 hours 50 mins", + "value": 13812 + } + } + ] + } + ], + "status": "OK", + "origin_addresses": [ + "Washington, DC, USA" + ], + "destination_addresses": [ + "New York, NY, USA" + ] + } + }] + $$::JSONB + ) \ No newline at end of file diff --git a/sample_google_api/test/srce.sql b/sample_google_api/test/srce.sql index 5ad035a..9278f1a 100644 --- a/sample_google_api/test/srce.sql +++ b/sample_google_api/test/srce.sql @@ -28,11 +28,11 @@ FROM "type": "numeric", "column_name": "duration" } - ], - "constraint": [ - "{doc}" ] - } + }, + "constraint": [ + "{doc}" + ] } $$ ) r(x); \ No newline at end of file