cleanup, docs

This commit is contained in:
root 2026-06-17 13:02:57 +00:00
parent b8b56cf3dd
commit 4eda629c8d
20 changed files with 24 additions and 50 deletions

View File

@ -6,3 +6,5 @@ memcache_delete
memcache_get
memcache_get_multiple
memcache_set
memcache_escape_key
memcache_escape_keys

View File

@ -30,3 +30,9 @@ regex_split
to_lower
to_upper
trim
float_val
int_val
html_escape
safe_name
var_dump
json_decode

View File

@ -47,3 +47,8 @@ file_temp
file_chmod
file_symlink
file_fsync
path_is_within
path_real
process_start_directory
request_perf
runtime_safe_key

View File

@ -36,3 +36,5 @@ to_bool
to_f64
to_s64
to_u64
ucb_encode
ucb_decode

View File

@ -15,3 +15,4 @@ parse_query
parse_uri
uri_decode
uri_encode
request_route_from_raw_path

View File

@ -1,5 +1,5 @@
:sig
f64 draw_float(f64 from, f64 to)
f64 draw_float(f64 from, f64 to, f64 decimal_precision = 0.000000000001)
:params
from : minimum value

View File

@ -1,5 +1,5 @@
: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
from : minimum result

View File

@ -1,5 +1,5 @@
: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
from : minimum result

View File

@ -1,5 +1,5 @@
:sig
u32 noise01(u64 index, u64 seed = 0)
f64 gen_noise01(u64 index, u64 seed = 0)
:params
index : index position

View File

@ -1,5 +1,5 @@
:sig
u32 noise32(u32 index, u32 seed = 0)
u32 gen_noise32(u32 index, u32 seed = 0)
:params
index : index position

View File

@ -1,5 +1,5 @@
:sig
u32 noise64(u64 index, u64 seed = 0)
u64 gen_noise64(u64 index, u64 seed = 0)
:params
index : index position

View File

@ -1,5 +1,5 @@
:sig
String sha1(String s, bool as_binary = false)
String gen_sha1(String s, bool as_binary = false)
:params
s : data to be hashed

View File

@ -1,9 +1,5 @@
# 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`.
Returns `{ status, headers, body, error }`. `headers` is a name/value map. A missing `curl` binary returns a clear `error` string.

View File

@ -1,9 +1,5 @@
# 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.
:see

View File

@ -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.
```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.
:example

View File

@ -12,10 +12,6 @@ server_start_http
:content
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.
:example

View File

@ -1,5 +1,5 @@
:sig
void session_destroy(String session_name)
void session_destroy(String session_name = "uce-session")
:params
session_name : the name of the session

View File

@ -13,11 +13,6 @@ sqlite_insert_id
:content
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
SQLite* db = sqlite_connect("/tmp/doc-sqlite-affected.db");
sqlite_query(db, "drop table if exists t");

View File

@ -13,11 +13,6 @@ sqlite_affected_rows
:content
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
SQLite* db = sqlite_connect("/tmp/doc-sqlite-insertid.db");
sqlite_query(db, "drop table if exists t");

View File

@ -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.
```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.
For statements that do not return rows, inspect `sqlite_affected_rows()` or `sqlite_insert_id()` after the call.