Skip to content

Commit 46322fc

Browse files
committed
Tidy
1 parent acee692 commit 46322fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sqllib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The format is:-
7979
- Optional `_store` or `_use` for queries that return rows
8080
- Optional suffix `_f` (for format inline), `_free` for use and free malloc'd query, `_s` for use `sql_s_t*` composed string, otherwise a query string is passed and not freed.
8181

82-
A query like `SELECT` or `DESCRIBE` returns a value, and so you have to use a `_store` or `_use` query functions, which return `SQL_RES*`. The `_use` version streams the result from the SQL server, and is not usually what you want. Only use `_use` if you have some stupidly big query result that won't fit in memory. The `_store` versions stores the result - this has the advantage you can see how many rows there are `sql_num_rows(res)` and it frees the `SQL` handle to allow other queries even when working through the rows of the result. You free the result with `sql_free_result(res)`. The `_safe` version always returns an `SQL_RES*` or errors, the non `_safe` returns NULL if error.
82+
A query like `SELECT` or `DESCRIBE` returns a value, and so you have to use a `_store` or `_use` query functions, which return `SQL_RES*`. The `_use` version streams the result from the SQL server, and is not usually what you want. Only use `_use` if you have some stupidly big query result that won't fit in memory. The `_store` versions stores the result - this has the advantage you can see how many rows there are `sql_num_rows(res)` and it completes the `SQL` query connection to allow other queries even when working through the rows of the result. You free the result with `sql_free_result(res)`. The `_safe` version always returns an `SQL_RES*` or errors, the non `_safe` returns NULL if error.
8383

8484
A query like `UPDATE` or `INSERT` does not return a result, though `sql_insert_id(&sql)` is useful after inserts with auto incrementing IDs. These functions do not have `_use` or `_store` and have no return value (so `void` for `_safe`) or an `int` return if not `_safe` version so you know if an error (non zero return).
8585

0 commit comments

Comments
 (0)