unimportant

This commit is contained in:
Cosmin Apreutesei 2021-04-30 09:59:49 +03:00
parent 7e7d7501eb
commit deeea3a4b4
2 changed files with 583 additions and 608 deletions

File diff suppressed because it is too large Load Diff

View File

@ -72,8 +72,6 @@ The `options` argument is a Lua table holding the following keys:
If the server does not have SSL support (or just disabled), the error string If the server does not have SSL support (or just disabled), the error string
"ssl disabled on server" will be returned. "ssl disabled on server" will be returned.
* `ssl_verify`: if `true`, then verifies the validity of the server SSL certificate (default to `false`). * `ssl_verify`: if `true`, then verifies the validity of the server SSL certificate (default to `false`).
* `compact_arrays`: `true` to use array-of-arrays structure for the result set,
rather than the default array-of-hashes structure.
### `db:close() -> 1 | nil,err` ### `db:close() -> 1 | nil,err`
@ -85,7 +83,7 @@ Sends the query to the remote MySQL server without waiting for its replies.
Returns the bytes successfully sent out. Use `read_result()` to read the replies. Returns the bytes successfully sent out. Use `read_result()` to read the replies.
### `db:read_result([nrows]) -> res | nil,err,errcode,sqlstate` ### `db:read_result([nrows,]['compact']) -> res | nil,err,errcode,sqlstate`
Reads in one result returned from the server. Reads in one result returned from the server.
@ -97,8 +95,17 @@ Each row holds key-value pairs for each data fields. For instance,
```lua ```lua
{ {
{ name = "Bob", age = 32, phone = ngx.null }, { name = "Bob", age = 32, phone = mysql.null },
{ name = "Marry", age = 18, phone = "10666372"} { name = "Marry", age = 18, phone = "10666372" }
}
```
If `'compact'` given, it returns an array-of-arrays instead:
```lua
{
{ "Bob", 32, null },
{ "Marry", 18, "10666372" }
} }
``` ```
@ -148,12 +155,6 @@ Returns the MySQL server version string, like `"5.1.64"`.
You should only call this method after successfully connecting to a MySQL server, You should only call this method after successfully connecting to a MySQL server,
otherwise `nil` will be returned. otherwise `nil` will be returned.
### `db:set_compact_arrays(true|false)`
Sets whether to use the "compact-arrays" structure for the resultsets returned
by subsequent queries. See the `compact_arrays` option for the `connect`
method for more details.
### `mysql.quote(s) -> s` ### `mysql.quote(s) -> s`
Quote literal string to be used in queries. Quote literal string to be used in queries.