mariadb_rpl_fetch(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_rpl_fetch β€” bestie, we're fetching events now πŸ’…

okay so this is a page from the MariaDB Connector/C manual, and it's about mariadb_rpl_fetch. it's giving replication stream energy, and honestly? iconic. let's get into it 🫢


✨ NAME ✨

mariadb_rpl_fetch β€” fetches next event from replication stream 🌸


✨ SYNOPSIS ✨

#include <mariadb_rpl.h>

MARIADB_RPL_EVENT *mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVENT *event)

like, look at that signature. she's neat, she's tidy, she's doing her job. πŸ’–


✨ DESCRIPTION ✨

Fetches one event from the replication stream. that's it. that's the whole vibe. one call, one event, no cap ✨


✨ PARAMETER ✨

  • rpl β€” a replication handle. she's gotta be initialized first by mariadb_rpl_init(3) and then connected by mariadb_rpl_open(3). no shortcuts, bestie, she needs both πŸ’…
  • event β€” an event that came back from a previous call to mariadb_rpl_fetch. so here's the tea πŸ“: if this value is NULL, the function will allocate new memory for the event. but if you pass in an actual event, that passed event value gets overwritten. yes, literally overwritten. choose wisely πŸ™ˆ

✨ RETURN VALUE ✨

an event handle ✨ β€” or NULL if an EOF packet was received. so if you get NULL, that's not a bug, that's the stream saying "we're done here, girlie" πŸ‘‘


✨ NOTES ✨

Event memory needs to be freed by calling mariadb_rpl_free_event(3). do NOT forget this one, i'm begging 😭 leaking memory is not the main character energy we're going for.

✨ SEE ALSO ✨

  • mariadb_rpl_free_event(3) β€” your cleanup bestie, go say hi πŸŽ€

✨ HISTORY ✨

mariadb_rpl_fetch was added in MariaDB Connector/C 3.1.0. so she's been serving since 3.1.0 and she's still booked and busy ⭐


and that's the whole page, bestie!! πŸ¦‹ this was Version 3.4 of the MariaDB Connector/C manual β€” thanks for reading, ily, go free your events πŸ§šπŸ’œ

πŸ“¦ where this page comes from