mariadb_connection(3)

πŸ“¦
version 13.0.2 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ mariadb_connection(3) ✨

okay bestie, so this one's a little function from MariaDB Connector/C β€” it's short, it's sweet, it's literally just doing a vibe check on your connection πŸ’…


πŸŽ€ NAME πŸŽ€

mariadb_connection β€” the function that checks if your client is actually connected to a MariaDB database server, no cap 🫢


🌸 SYNOPSIS 🌸

#include <mysql.h>

my_bool mariadb_connection(MYSQL * mysql);

πŸ¦‹ DESCRIPTION πŸ¦‹

So like… this checks whether the client is connected to a MariaDB or a MySQL database server. That's it. That's the whole job. it's giving "are we there yet" but make it C πŸš—βœ¨


πŸ“ PARAMETER πŸ“

  • mysql β€” the mysql handle, bestie. And not just any handle β€” this one was previously allocated by mysql_init(3) and connected by mysql_real_connect(3). so like, it's been through the whole glow-up journey already πŸ’–

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns a non zero value if it's connected to a MariaDB database server, otherwise zero. periodt. πŸ”₯


Version 3.4 of the MariaDB Connector/C era, and this little page right here is mariadb_connection(3) β€” mwah, iconic, stan πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from