Data::...iplexer(3pm)

✨ NAME ✨

okay so welcome to the Data::...iplexer(3pm) manual, bestie! This page is about Data::ObjectDriver::Driver::Multiplexer — the driver whose whole thing is: multiplex multiple partitioned drivers. That’s the name-line tea, served fresh. 💅

💅 SYNOPSIS 💅

here’s the code vibe check, copied exactly so you can read it without me messing with a single character:

package MappingTable;

use Foo;
use Bar;

my $foo_driver = Foo->driver;
my $bar_driver = Bar->driver;

__PACKAGE__->install_properties({
    columns => [ qw( foo_id bar_id value ) ],
    primary_key => 'foo_id',
    driver => Data::ObjectDriver::Driver::Multiplexer->new(
        on_search => {
            foo_id => $foo_driver,
            bar_id => $bar_driver,
        },
        on_lookup => $foo_driver,
        drivers => [ $foo_driver, $bar_driver ],
    ),
});

like, that’s the whole setup: you make $foo_driver and $bar_driver, then hand Data::ObjectDriver::Driver::Multiplexer->new(...) an on_search hashref mapping foo_id and bar_id, an on_lookup driver, and a drivers arrayref with both drivers. slay. ✨

🌸 DESCRIPTION 🌸

okay so real talk: Data::ObjectDriver::Driver::Multiplexer associates a set of drivers to a particular class. In practice, that means every INSERT and DELETE gets propagated to all associated drivers — think all associated databases or tables in a database, bestie — and SELECTs get sent to the appropriate multiplexed driver, based on partitioning criteria. no cap. 🦋

⚠️ now for the caution-tape moment: this driver has these limitations currently, and I’m not paraphrasing:
  1. It's very experimental.
  2. It's very experimental.
  3. IT'S VERY EXPERIMENTAL.
  4. This documentation you're reading is incomplete. the api is likely to evolve

that’s the whole doc, bestie — yes, the limitations list really says experimental three times, and yes, the fourth one tells you the documentation you’re reading is incomplete and the api is likely to evolve. iconic in a “handle with care” way. 😭


cute sign-off time: this page is from perl v5.42.0, dated 2024-10-24, and the manual name is Data::...iplexer(3pm). mwah 💋

📦 where this page comes from