Database::Async::ORM - provides object-relational features for Database::Async
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;
Loads schema, tables, types and any other available objects from a source - currently supports the following:
hashref
YAML file
directory of YAML files
You can call this multiple times to accumulate objects from various different sources.
Returns the current Database::Async::ORM instance.
These are used by Database::Async::ORM and the precise API details may change in future.
Populates a Database::Async::ORM::Table instance.
Reads data from a file or recursively from a base path.
Tom Molesworth <TEAM@cpan.org>
<TEAM@cpan.org>
Copyright Tom Molesworth 2018-2019. Licensed under the same terms as Perl itself.
To install Database::Async, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Database::Async
CPAN shell
perl -MCPAN -e shell install Database::Async
For more information on module installation, please visit the detailed CPAN module installation guide.