Databas...nc::ORM(3)
π NAME π
Database::Async::ORM β bestie, this is the module that hands you object-relational superpowers for Database::Async β¨
This page ships as part of the User Contributed Perl Documentation, so you already know it's giving community-crafted excellence π«Ά
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, copy-paste ready, no cap:
use 5.020;
use IO::Async::Loop;
use Database::Async::ORM;
my $loop = IO::Async::Loop->new;
$loop->add(
my $orm = Database::Async::ORM->new
);
# Load schemata directly from the database
$orm->load_from($db)
->then(sub {
say 'We have the following tables:';
$orm->tables
->map('name')
->say
->completed
})->get;
# Load schemata from a hashref (e.g. pulled
# from a YAML/JSON/XML file or API)
$orm->load_from({ ... })
->then(sub {
$orm->apply_to($db)
})->then(sub {
say 'We have the following tables:';
$orm->tables
->map('name')
->say
->completed
})->get;
like, two whole moods: pull the schema straight out of the db, or yeet a hashref at it (you know, the one you scraped out of a YAML/JSON/XML file or an API) and then apply_to($db). both slay π
π¦ load_from π¦
Loads schema, tables, types and any other available objects from a source β and rn it's got your back with these:
- hashref
- YAML file
- directory of YAML files
iconic behaviour alert: you can call this multiple times to accumulate objects from various different sources. pile 'em up, collect 'em all π
It returns the current Database::Async::ORM instance. periodt.
β¨ METHODS - Internal β¨
heads up bestie β these are used by Database::Async::ORM and the precise API details may change in future. so like, don't build your whole personality on them, mwah π
π populate_table
Populates a Database::Async::ORM::Table instance. that's the whole thing, she's simple and she works πΈ
π§ read_from
Reads data from a file or recursively from a base path. recursive reading, we love a thorough queen π
π SEE ALSO π
ngl this section is literally empty on this page β nothing listed. a mystery, an enigma, a blank space (Taylor would be proud) π
π AUTHOR π
Tom Molesworth <TEAM@cpan.org> β say thank you π«Ά
π LICENSE π
Copyright Tom Molesworth 2011-2023. Licensed under the same terms as Perl itself. slay, legally speaking β
okay that's the whole page! this one's from perl v5.42.2, dated 2026-02-15, and it's the User Contributed Perl Documentation edition β go forth and ORM, bestie, you're gonna eat π₯
π¦ where this page comes from
- alpine 3.24: perl-database-async-doc 0.019-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms