I found it much easier and reliable to make my own phoenix HTTP server with
my own JSON API. It was too confusing for me to send multiple requests for
what would normally be just one SQL statement. And I had problems getting
upserts working, to boot (even with the thin server). Now I can make the
API as simple as I like. I am using Phoenix 4.6.0.
Good luck,
Steve
On Thu, Apr 14, 2016 at 8:12 AM, Plamen Paskov <
[email protected]> wrote:
> Hey folks,
> I'm trying to UPSERT some data via the json api but no luck for now. My
> requests looks like:
>
> {
> "request": "openConnection",
> "connectionId": "6"
> }
>
> {
> "request": "createStatement",
> "connectionId": "6"
> }
>
> {
> "request": "prepareAndExecute",
> "connectionId": "6",
> "statementId": 9,
> "sql": "UPSERT INTO us_population VALUES('IL','Chicago',10000000)",
> "maxRowCount": -1
> }
>
> The response for prepareAndExecute looks like the operation is successful
> but i don't see the new data added to the table.
>
> {
> "response": "executeResults",
> "missingStatement": false,
> "rpcMetadata": {
> "response": "rpcMetadata",
> "serverAddress": "ip-172-31-27-198:8765"
> },
> "results": [
> {
> "response": "resultSet",
> "connectionId": "6",
> "statementId": 9,
> "ownStatement": false,
> "signature": null,
> "firstFrame": null,
> "updateCount": 1,
> "rpcMetadata": {
> "response": "rpcMetadata",
> "serverAddress": "ip-172-31-27-198:8765"
> }
> }
> ]
> }
>
> Any ideas?
> Thanks in advance!
>