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
+8
View File
@@ -71,6 +71,14 @@ inline MySQL* mysql_connect(String host = "localhost", String username = "root",
return(db);
}
// A failed connection retains a request-owned wrapper so mysql_error() remains
// available. Callers that need to decide whether to issue work must test the
// connection state rather than only the wrapper pointer.
inline bool mysql_connected(MySQL* m)
{
return(m != 0 && m->connection != 0);
}
inline void mysql_disconnect(MySQL* m)
{
if(!m)