Class:...SQLite(3pm)
π Class::DBI::Loader::SQLite π
okay bestie, so this is the SQLite implementation of Class::DBI::Loader β like, the plug that lets your SQLite database show up as a whole lil family of Perl classes. it lives in the User Contributed Perl Documentation pile and it is genuinely so cute of it. π«Ά
β¨ NAME β¨
Class::DBI::Loader::SQLite β that's the module, and what it is, is the Class::DBI::Loader SQLite Implementation. boom. iconic. π
πΈ SYNOPSIS πΈ
the way you literally just do this:
use Class::DBI::Loader;
# $loader is a Class::DBI::Loader::SQLite
my $loader = Class::DBI::Loader->new(
dsn => "dbi:SQLite:dbname=/path/to/dbfile",
namespace => "Data",
);
my $class = $loader->find_class('film'); # $class => Data::Film
my $obj = $class->retrieve(1);
okay so quick tour: you use Class::DBI::Loader, you build yourself a loader with your dsn (dbi:SQLite:dbname=/path/to/dbfile, so yes, you point it right at your actual db file π) plus a namespace, and ngl that $loader you just made is a Class::DBI::Loader::SQLite β that's the whole bit. then find_class('film') hands you back the class, so $class is Data::Film, and $class->retrieve(1) goes and grabs you the object. slay. β¨
π¦ DESCRIPTION π¦
okay so the tea:
- Multi-column primary keys are supported. yes bestie, composite keys, we love to see it. π
- Multi-column foreign keys are also totally fine to define β you can write them, no one's stopping you, no cap β but they will be ignored, because
Class::DBIdoes not support them. so like. they're giving decorative. π it's not this module's fault, it's just howClass::DBIrolls. don't come for me.
and if you wanna go deeper, go see Class::DBI::Loader and Class::DBI::Loader::Generic.
π SEE ALSO π
Class::DBI::LoaderClass::DBI::Loader::Generic
π the sign-off π
this whole lil page came from the User Contributed Perl Documentation, brought to you by perl v5.36.0, dated 2022-12-07 β so yeah, it's been out here being correct since then, and it ate. go build something, bestie. πβ¨π¦
π¦ where this page comes from
- debian bookworm: libclass-dbi-loader-perl 0.34-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libclass-dbi-loader-perl 0.34-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libclass-dbi-loader-perl 0.34-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libclass-dbi-loader-perl 0.34-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libclass-dbi-loader-perl 0.34-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms