Databas...nc::ORM(3)

πŸ“¦ version 0.019, in alpine 3.24

πŸ’… 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