Expose MySQL connection state

This commit is contained in:
root
2026-07-17 18:05:04 +00:00
parent da04af1cbf
commit 3e423f49dd
5 changed files with 36 additions and 2 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ return value : pointer to the MySQL connection struct
>mysql
:content
Establishes a connection to a MySQL server and returns a pointer to the connection struct.
Establishes a connection to a MySQL server and returns a request-owned pointer to the connection struct. A failed connection also returns a wrapper so that `mysql_error()` can report the failure; use `mysql_connected()` before issuing optional work that requires a live server handle.
This connection handle is then used with helpers such as `mysql_query()`, `mysql_error()`, and `mysql_disconnect()`.
@@ -19,5 +19,5 @@ MySQL handles are request-scoped framework resources. Repeated `mysql_connect()`
:example
MySQL* db = mysql_connect();
print(db != 0 ? "connected to MySQL" : "no MySQL server reachable with these credentials", "\n");
print(mysql_connected(db) ? "connected to MySQL" : "no MySQL server reachable with these credentials", "\n");
if(db != 0) mysql_disconnect(db);