Skip to content

Made the select pageable #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updated readme about paging
  • Loading branch information
olafgeibig committed May 23, 2014
commit b0f18c8765ad4b813c7bdab61f8901d4b1423d1b
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The module will reply to all requests. In the message, there will be either a `"
["Mr. Test", "mr-test@example.com", true, 32, 123.45, "2014-04-04"],
["Mrs. Test", "mrs-test@example.com", false, 16, 543.21, "2022-02-22"]
]
}
}

* `rows` gives you the number of rows affected by the statement sent to the server. Bear in mind that MySQL only shows a row count on changed rows (DELETE, UPDATE, INSERT statements) whereas PostgreSQL also shows the number of SELECTed rows here.
* `message` is a status message from the server.
Expand Down Expand Up @@ -86,11 +86,14 @@ Use this action to insert new rows into a table. You need to specify a table, th
### select

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.
A simple paging can be done with the optional parameters limit and offset.

{
"action" : "select",
"table" : "some_test",
"fields" : ["name", "email", "is_male", "age", "money", "wedding_date"], // Optional
"limit" : 10, // Optional
"offset" : 100 // Optional
}

### prepared
Expand Down Expand Up @@ -129,7 +132,7 @@ Takes several statements and wraps them into a single transaction for the server

### raw - Raw commands

Use this action to send arbitrary commands to the database. You should be able to do submit any query or insertion with this command.
Use this action to send arbitrary commands to the database. You should be able to do submit any query or insertion with this command.

Here is an example for creating a table in PostgreSQL:

Expand Down Expand Up @@ -157,7 +160,7 @@ And if you want to drop it again, you can send the following:

You can always use `raw` to do anything on the database. If the statement is a query, it will return its results just like a `select`.

The `select` and `insert` commands are just for you to be able to have a cross-database application in the end. If you do not use `raw`, these commands should create the needed statements for you.
The `select` and `insert` commands are just for you to be able to have a cross-database application in the end. If you do not use `raw`, these commands should create the needed statements for you.

* `update` - Updates rows of a table
* `delete` - Deletes rows from a table
Expand Down Expand Up @@ -202,7 +205,7 @@ These actions are currently not available, but they should be implemented in the
// email VARCHAR(255),
// age INTEGER
// );
{
{
"action" : "create",
"table" : "some_test",
"fields" : ["id PRIMARY KEY", "name VARCHAR(255)", "email VARCHAR(255)", "age INTEGER"]
Expand Down