The use of the URL param `pretty` is optional, and results in pretty-printed JSON responses. `explain` is also optional. If included, the response will include some basic information about the processing that took place -- how long it took, for example.
@ -75,16 +75,16 @@ Note that this is the SQLite file that is under `node 3`, which is not the node
Bulk updates are supported. To execute multipe statements in one HTTP call, simply include the statements in the JSON array:
curl -L -XPOST 'localhost:4001/db?pretty' -d '[
"INSERT INTO foo(name) VALUES('fiona')",
"INSERT INTO foo(name) VALUES('sinead')"
"INSERT INTO foo(name) VALUES(\"fiona\")",
"INSERT INTO foo(name) VALUES(\"sinead\")"
]'
#### Transactions
Transactions are supported. To execute statements within a transaction, add `transaction` to the URL. An example of the above operation executed within a transaction is shown below.
When a transaction takes place either both statements will succeed, or neither. Performance is *much, much* better if multiple SQL INSERTs or UPDATEs are executed via a transaction.