mariadb_dyncol_unpack(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_unpack(3) πŸ’–

okay so bestie, welcome to the MariaDB Connector/C manual, section 3, and today's main character is mariadb_dyncol_unpack ✨ it's the one that unpacks ALL the keys and values out of a dynamic column. literally the whole vibe. no cap.


✨ Name ✨

mariadb_dyncol_unpack β€” extracts keys and values of all columns πŸŽ€

🌸 Synopsis 🌸

#include <mariadb_dyncol.h>

enum enum_dyncol_func_result
mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
                      uint *column_count,
                      MYSQL_LEX_STRING **column_keys,
                      DYNAMIC_COLUMN_VALUE **values);

πŸ¦‹ Description πŸ¦‹

The mariadb_dyncol_unpack() function extracts all keys and values of a dynamic column. like, every single one. it's giving "dump the whole thing out into your hands" energy and honestly? we love that for you πŸ’…

πŸ‘‘ Parameter πŸ‘‘

  • str β€” Pointer to a DYNAMIC_COLUMN structure. this is the dynamic column you're unpacking, the source of all the drama.
  • column count β€” Pointer to an unsigned integer which will receive the number of columns. so it hands you back the count, in a uint *. (the synopsis calls this one column_count, iykyk)
  • column_keys β€” Pointer of an array of MYSQL_LEX_STRING structures, which will contain the column keys. the names go here 🏷️
  • values β€” Pointer of an array of DYNAMIC_COLUMN_VALUE structures, which will contain the values. and the actual data goes here πŸ“

⭐ Return value ⭐

Returns ER_DYNCOL_OK on success, otherwise an error. that's it, that's the check. if it's not ER_DYNCOL_OK, something went sideways and you gotta deal with it 😭

πŸ”₯ Notes πŸ”₯

  • The column_keys and values arrays will be allocated by mariadb_dyncol_unpack() and must be freed by application. πŸ‘ˆ read that again bestie. you free them. it is NOT going to clean up after itself, and it's NOT your mom. memory leak incoming if you forget πŸ™ˆ

🌈 See also 🌈

  • mariadb_dyncol_get(3)
  • mariadb_dyncol_list(3)

Version 3.4 of the MariaDB Connector/C docs, and yes the page is literally named mariadb_dyncol_unpack(3) β€” okay that's the whole thing, go unpack something and free your arrays, ily, mwah πŸ’–πŸ«ΆπŸ§š

πŸ“¦ where this page comes from