cleanup, docs
This commit is contained in:
parent
b8b56cf3dd
commit
4eda629c8d
@ -6,3 +6,5 @@ memcache_delete
|
|||||||
memcache_get
|
memcache_get
|
||||||
memcache_get_multiple
|
memcache_get_multiple
|
||||||
memcache_set
|
memcache_set
|
||||||
|
memcache_escape_key
|
||||||
|
memcache_escape_keys
|
||||||
|
|||||||
@ -30,3 +30,9 @@ regex_split
|
|||||||
to_lower
|
to_lower
|
||||||
to_upper
|
to_upper
|
||||||
trim
|
trim
|
||||||
|
float_val
|
||||||
|
int_val
|
||||||
|
html_escape
|
||||||
|
safe_name
|
||||||
|
var_dump
|
||||||
|
json_decode
|
||||||
|
|||||||
@ -47,3 +47,8 @@ file_temp
|
|||||||
file_chmod
|
file_chmod
|
||||||
file_symlink
|
file_symlink
|
||||||
file_fsync
|
file_fsync
|
||||||
|
path_is_within
|
||||||
|
path_real
|
||||||
|
process_start_directory
|
||||||
|
request_perf
|
||||||
|
runtime_safe_key
|
||||||
|
|||||||
@ -36,3 +36,5 @@ to_bool
|
|||||||
to_f64
|
to_f64
|
||||||
to_s64
|
to_s64
|
||||||
to_u64
|
to_u64
|
||||||
|
ucb_encode
|
||||||
|
ucb_decode
|
||||||
|
|||||||
@ -15,3 +15,4 @@ parse_query
|
|||||||
parse_uri
|
parse_uri
|
||||||
uri_decode
|
uri_decode
|
||||||
uri_encode
|
uri_encode
|
||||||
|
request_route_from_raw_path
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
f64 draw_float(f64 from, f64 to)
|
f64 draw_float(f64 from, f64 to, f64 decimal_precision = 0.000000000001)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
from : minimum value
|
from : minimum value
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
f64 generate_float(f64 from, f64 to, u64 index, u64 seed = 0)
|
f64 gen_float(f64 from, f64 to, u64 index, u64 seed = 0, f64 decimal_precision = 0.000000000001)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
from : minimum result
|
from : minimum result
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
u64 generate_int(u64 from, u64 to, u64 index, u64 seed = 0)
|
u64 gen_int(u64 from, u64 to, u64 index, u64 seed = 0)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
from : minimum result
|
from : minimum result
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
u32 noise01(u64 index, u64 seed = 0)
|
f64 gen_noise01(u64 index, u64 seed = 0)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
index : index position
|
index : index position
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
u32 noise32(u32 index, u32 seed = 0)
|
u32 gen_noise32(u32 index, u32 seed = 0)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
index : index position
|
index : index position
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
u32 noise64(u64 index, u64 seed = 0)
|
u64 gen_noise64(u64 index, u64 seed = 0)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
index : index position
|
index : index position
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
String sha1(String s, bool as_binary = false)
|
String gen_sha1(String s, bool as_binary = false)
|
||||||
|
|
||||||
:params
|
:params
|
||||||
s : data to be hashed
|
s : data to be hashed
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
# http_request
|
# http_request
|
||||||
|
|
||||||
```cpp
|
|
||||||
DValue http_request(DValue req)
|
|
||||||
```
|
|
||||||
|
|
||||||
Performs a bounded outbound HTTP(S) request using the runtime `curl` binary. Request fields: `method`, `url`, `headers`, `body`, `timeout_ms`, `follow_redirects`.
|
Performs a bounded outbound HTTP(S) request using the runtime `curl` binary. Request fields: `method`, `url`, `headers`, `body`, `timeout_ms`, `follow_redirects`.
|
||||||
|
|
||||||
Returns `{ status, headers, body, error }`. `headers` is a name/value map. A missing `curl` binary returns a clear `error` string.
|
Returns `{ status, headers, body, error }`. `headers` is a name/value map. A missing `curl` binary returns a clear `error` string.
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
# http_request_async
|
# http_request_async
|
||||||
|
|
||||||
```cpp
|
|
||||||
u64 http_request_async(DValue req)
|
|
||||||
```
|
|
||||||
|
|
||||||
Starts the same bounded curl-backed request as `http_request()` in the file-backed async job registry and returns a job id. Use `job_await()` or `job_result()` to retrieve the HTTP result.
|
Starts the same bounded curl-backed request as `http_request()` in the file-backed async job registry and returns a job id. Use `job_await()` or `job_result()` to retrieve the HTTP result.
|
||||||
|
|
||||||
:see
|
:see
|
||||||
|
|||||||
@ -15,15 +15,6 @@ Executes a MySQL query and returns the resulting data, if any.
|
|||||||
|
|
||||||
`params` provides the query parameter values used by the statement. Use named `:name` placeholders only; positional `?` placeholders are rejected.
|
`params` provides the query parameter values used by the statement. Use named `:name` placeholders only; positional `?` placeholders are rejected.
|
||||||
|
|
||||||
```cpp
|
|
||||||
StringMap params;
|
|
||||||
params["email"] = "ada@example.test";
|
|
||||||
DValue rows = mysql_query(m,
|
|
||||||
"select id, email from users where email = :email",
|
|
||||||
params
|
|
||||||
);
|
|
||||||
```
|
|
||||||
|
|
||||||
The result is returned as a `DValue`, which makes it easy to iterate through rows and read fields with the usual `DValue` accessors.
|
The result is returned as a `DValue`, which makes it easy to iterate through rows and read fields with the usual `DValue` accessors.
|
||||||
|
|
||||||
:example
|
:example
|
||||||
|
|||||||
@ -12,10 +12,6 @@ server_start_http
|
|||||||
:content
|
:content
|
||||||
Stops a custom server listener by key and removes its registry config.
|
Stops a custom server listener by key and removes its registry config.
|
||||||
|
|
||||||
```uce
|
|
||||||
server_stop("site-tests-http");
|
|
||||||
```
|
|
||||||
|
|
||||||
`server_stop()` currently targets custom servers started through `server_start_http()`. The same key model is intended to extend to future `server_start_tcp()` and `server_start_udp()` helpers.
|
`server_stop()` currently targets custom servers started through `server_start_http()`. The same key model is intended to extend to future `server_start_tcp()` and `server_start_udp()` helpers.
|
||||||
|
|
||||||
:example
|
:example
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
:sig
|
:sig
|
||||||
void session_destroy(String session_name)
|
void session_destroy(String session_name = "uce-session")
|
||||||
|
|
||||||
:params
|
:params
|
||||||
session_name : the name of the session
|
session_name : the name of the session
|
||||||
|
|||||||
@ -13,11 +13,6 @@ sqlite_insert_id
|
|||||||
:content
|
:content
|
||||||
Returns the number of rows changed by the most recent insert, update, or delete statement on the connection.
|
Returns the number of rows changed by the most recent insert, update, or delete statement on the connection.
|
||||||
|
|
||||||
```cpp
|
|
||||||
sqlite_query(db, "update users set visits = visits + 1 where id = :id", params);
|
|
||||||
print(sqlite_affected_rows(db));
|
|
||||||
```
|
|
||||||
|
|
||||||
:example
|
:example
|
||||||
SQLite* db = sqlite_connect("/tmp/doc-sqlite-affected.db");
|
SQLite* db = sqlite_connect("/tmp/doc-sqlite-affected.db");
|
||||||
sqlite_query(db, "drop table if exists t");
|
sqlite_query(db, "drop table if exists t");
|
||||||
|
|||||||
@ -13,11 +13,6 @@ sqlite_affected_rows
|
|||||||
:content
|
:content
|
||||||
Returns SQLite's last inserted rowid for the connection after an insert statement.
|
Returns SQLite's last inserted rowid for the connection after an insert statement.
|
||||||
|
|
||||||
```cpp
|
|
||||||
sqlite_query(db, "insert into notes(body) values(:body)", params);
|
|
||||||
u64 id = sqlite_insert_id(db);
|
|
||||||
```
|
|
||||||
|
|
||||||
:example
|
:example
|
||||||
SQLite* db = sqlite_connect("/tmp/doc-sqlite-insertid.db");
|
SQLite* db = sqlite_connect("/tmp/doc-sqlite-insertid.db");
|
||||||
sqlite_query(db, "drop table if exists t");
|
sqlite_query(db, "drop table if exists t");
|
||||||
|
|||||||
@ -21,17 +21,6 @@ Executes one SQLite statement and returns result rows as a `DValue` array. Multi
|
|||||||
|
|
||||||
Use named parameters with `:name` placeholders only. Positional `?` placeholders and SQLite's other named marker forms (`@name`, `$name`) are rejected so UCE SQLite queries use the same placeholder style as the MySQL helper. UCE binds parameters with SQLite prepared statements; it does not substitute values into the SQL string.
|
Use named parameters with `:name` placeholders only. Positional `?` placeholders and SQLite's other named marker forms (`@name`, `$name`) are rejected so UCE SQLite queries use the same placeholder style as the MySQL helper. UCE binds parameters with SQLite prepared statements; it does not substitute values into the SQL string.
|
||||||
|
|
||||||
```cpp
|
|
||||||
SQLite* db = sqlite_connect("/tmp/app.sqlite");
|
|
||||||
|
|
||||||
StringMap params;
|
|
||||||
params["email"] = "ada@example.test";
|
|
||||||
DValue rows = sqlite_query(db,
|
|
||||||
"select id, email from users where email = :email",
|
|
||||||
params
|
|
||||||
);
|
|
||||||
```
|
|
||||||
|
|
||||||
Result rows are objects keyed by column name. SQLite integer, float, text, blob, and null values are converted to DValue values. Blob values are returned as byte strings.
|
Result rows are objects keyed by column name. SQLite integer, float, text, blob, and null values are converted to DValue values. Blob values are returned as byte strings.
|
||||||
|
|
||||||
For statements that do not return rows, inspect `sqlite_affected_rows()` or `sqlite_insert_id()` after the call.
|
For statements that do not return rows, inspect `sqlite_affected_rows()` or `sqlite_insert_id()` after the call.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user