mariadb_dyncol_list_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

πŸ’– mariadb_dyncol_list_named(3) πŸ’–

okay bestie, so this one lives in the MariaDB Connector/C manual, and it's literally the function you call when you wanna know which keys are chillin' inside a dynamic column. not the values, not the numbers β€” the names. the receipts. the guest list. πŸ‘‘


✨ Name ✨

mariadb_dyncol_list_named β€” Lists column keys in dynamic column

like... that's the whole job. she lists. she names. she slays. πŸ’…


✨ Synopsis ✨

#include <mariadb_dyncol.h>

enum enum_dyncol_func_result
mariadb_dyncol_list_named(DYNAMIC_COLUMN *str,
                          uint *column_count,
                          MYSQL_LEX_STRING **column_keys);

no cap, that's the exact shape. copy it character for character, don't get cute with it. πŸŽ€


✨ Description ✨

Lists the column keys inside a dynamic column.

that's it. that's the vibe. you hand her a dynamic column, she hands you back the names of everything inside it. not the values, bestie β€” just the keys. the labels. the ✨table of contents✨.


✨ Notes ✨

  • ⚠️ the application program needs to free the allocated memory for column_count and column_keys parameter.
🫢 fr fr, this is the part people forget and then their memory just... leaks. you allocated it, you free it. the function is not your mom, she will not clean up after you. free both column_count and column_keys when you're done. periodt.

✨ Parameter ✨

  • *str β€” Dynamic column πŸ¦‹ β€” the actual dynamic column you're snooping through.
  • *column_count β€” A pointer to an unsigned integer which stores the number of columns πŸ‘‘ β€” basically she writes back "hey, there are this many keys in there" into the integer you pointed at.
  • **column_keys β€” A pointer to an array of column keys, which stores the keys 🌸 β€” double pointer energy. she points you at an array, and that array is holding all the key names.

✨ Return value ✨

Returns ER_DYNCOL_OK on success, otherwise error. πŸ’€

so like β€” ER_DYNCOL_OK = we ate, everything's good. anything else = something went sideways, go check your error handling bestie. πŸ™ˆ


✨ See also ✨

  • mariadb_dyncol_list_num β€” when you want the numbers instead of the names πŸ”’
  • mariadb_dyncol_list_json β€” when you want the whole thing served up as JSON 🌈

and that's the page!! go forth and list your keys, you absolute icon. 🧚

Version 3.4 β€” MariaDB Connector/C. mwah, sending you a forehead kiss and a clean valgrind report. πŸ’œ

πŸ“¦ where this page comes from