mariadb_dyn...exists_named(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

✨ Name ✨

mariadb_dyncol_exists_named β€” bestie, it checks if a column with a given name exists πŸ’…

It lives in the MariaDB Connector/C manual, section 3, and it's lowkey one of the most useful little gremlins in the dynamic column family πŸŽ€


πŸ¦‹ Synopsis πŸ¦‹

enum enum_dyncol_func_result
mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str,
                            MYSQL_LEX_STRING *column_key);

Look at that signature. Gorgeous. Iconic. No notes. πŸ‘‘


🌸 Description 🌸

Okay so picture this: you've got a dynamic column and you're sitting there like "…does this thing have a column named that or not 😭". That's literally the entire job of mariadb_dyncol_exists_named. It checks if a column with the specified column key exists. That's it. That's the function. Simple queen behaviour, no cap 🫢

No guessing, no vibes-based archaeology β€” you ask, it tells you yes or no. Periodt.


πŸ“ Parameter πŸ“

  • *str β€” the dynamic column. The thing you're snooping around in πŸ”
  • *column_key β€” the column key you're searching for. The name you're hunting for, the main character of this query ✨

πŸ’– Return value πŸ’–

  • ER_DYNCOL_YES β€” slay!! A column with the given key exists πŸŽ‰
  • ER_DYNCOL_NO β€” no column exists, or there was an error πŸ’€
Heads up bestie: ER_DYNCOL_NO is doing double duty here β€” it covers both "nope, not there" and "something went wrong". So don't read a NO as a guaranteed clean answer, iykyk πŸ™ˆ

🌈 See also 🌈

  • mariadb_dyncol_exists_num β€” same energy, but for numeric keys πŸ’œ
  • Dynamic Column Error Codes β€” go read the error codes so you know what you're actually getting back πŸ“š

Version 3.4 of the MariaDB Connector/C docs, and that's the whole page babes β€” go forth and check your columns, you absolute legend πŸŒŸπŸ’–βœ¨

πŸ“¦ where this page comes from