You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-1Lines changed: 86 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This Vert.x module uses the https://github.com/mauricio/postgresql-async drivers
4
4
5
5
## Requirements
6
6
7
-
* Vert.x 2.0.0
7
+
* Vert.x 2.0+
8
8
9
9
## Installation
10
10
@@ -13,6 +13,7 @@ This Vert.x module uses the https://github.com/mauricio/postgresql-async drivers
13
13
## Configuration
14
14
15
15
{
16
+
"address" : <event-bus-addres-to-listen-on>,
16
17
"connection" : <MySQL|PostgreSQL>,
17
18
"host" : <your-host>,
18
19
"port" : <your-port>,
@@ -28,3 +29,87 @@ This Vert.x module uses the https://github.com/mauricio/postgresql-async drivers
28
29
*`username` - The username to connect to the database. Defaults to `postgres` for PostgreSQL and `root` for MySQL.
29
30
*`password` - The password to connect to the database. Default is not set, i.e. it uses no password.
30
31
*`database` - The name of the database you want to connect to. Defaults to `test`.
32
+
33
+
34
+
## Usage
35
+
36
+
All commands are relatively similar. Use JSON with the `action` field and add the needed parameters for each command.
37
+
38
+
There are only a few commands available currently, but in theory you should be able to invoke any command on the database with the `raw` action.
39
+
40
+
### Reply messages
41
+
42
+
The module will reply to all requests. In the message, there will be either a `"status" : "ok"` or a `"status" : "error"`. If the request could be processed without problems, it will result in an "ok" status. See an example here:
*`rows` gives you the number of rows affected by the statement sent to the server.
56
+
*`message` is a status message from the server.
57
+
*`fields` contains the list of fields of the selected table - Only present if the request resulted in a result set.
58
+
*`results` contains a list of rows - Only present if the request resulted in a result set.
59
+
60
+
If the request resulted in an error, a possible reply message looks like this:
61
+
62
+
{
63
+
"status" : "error",
64
+
"message" : "message":"column \"ager\" does not exist"
65
+
}
66
+
67
+
### insert
68
+
69
+
Use this action to insert new rows into a table. You need to specify a table, the fields to insert and an array of rows to insert. The rows itself are an array of values.
The `select` action creates a `SELECT` statement to get a projection from a table. You can filter the columns by providing a `fields` array. If you omit the `fields` array, it selects every column available in the table.
0 commit comments