Document request-scoped MySQL cleanup

This commit is contained in:
udo
2026-07-08 18:44:07 +00:00
parent 6bdccacf02
commit 0ff42f357f
5 changed files with 14 additions and 4 deletions
+2
View File
@@ -15,6 +15,8 @@ Establishes a connection to a MySQL server and returns a pointer to the connecti
This connection handle is then used with helpers such as `mysql_query()`, `mysql_error()`, and `mysql_disconnect()`.
MySQL handles are request-scoped framework resources. If a request exits without calling `mysql_disconnect()`, UCE closes any remaining MySQL handles during request cleanup. Call `mysql_disconnect()` when you want to close early, but never store a `MySQL*` in globals, sessions, or other state that can outlive the current request.
:example
MySQL* db = mysql_connect();
print(db != 0 ? "connected to MySQL" : "no MySQL server reachable with these credentials", "\n");