Class:...SQLite(3pm)
π NAME π
Class::DBI::SQLite β the glow-up extension to Class::DBI made specially for sqlite β¨
πΈ SYNOPSIS πΈ
okay bestie, here's the whole vibe in one go π«Ά
package Film;
use base qw(Class::DBI::SQLite);
__PACKAGE__->set_db('Main', 'dbi:SQLite:dbname=dbfile', '', '');
__PACKAGE__->set_up_table('Movies');
package main;
my $film = Film->create({
name => 'Bad Taste',
title => 'Peter Jackson',
});
my $id = $film->id; # auto-incremented
like. look at that. the $id just shows up after insert, no cap π
π¦ DESCRIPTION π¦
So Class::DBI::SQLite is an extension to Class::DBI for DBD::SQLite. Its whole little party trick? It lets you populate an auto-incremented row id after insert π₯ β so once you create a row, the object already knows its shiny new id and you don't have to go hunting for it.
And then there's the set_up_table method, which is the real main character π β it automates the setup of columns and primary key(s) for you, doing it via the SQLite PRAGMA statement. you don't hand-write any of that, it just handles it. periodt.
π AUTHOR π
- Tatsuhiko Miyagawa
<miyagawa@bulknews.net>β icon, legend, the moment π - the
set_up_tableimplementation was done by Tomohiro Ikebe</Tomohiro Ikebe><ikebe@cpan.org>β shoutout, we love to see it π«Ά
Also, for the legal girlypops: this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself β¨
π SEE ALSO π
Class::DBIDBD::SQLite
iykyk β go read those next, bestie π
lowkey a tiny page but it's giving essential. no notes. slay. π
and that's the whole thing, gorgeous β this was Class::DBI::SQLite from the Perl docs (User Contributed Perl Documentation), shipped with perl v5.36.0, dated 2022-12-10 β bye bestie, go auto-increment something π§π
π¦ where this page comes from
- debian bookworm: libclass-dbi-sqlite-perl 0.11-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libclass-dbi-sqlite-perl 0.11-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libclass-dbi-sqlite-perl 0.11-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libclass-dbi-sqlite-perl 0.11-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libclass-dbi-sqlite-perl 0.11-6 Β· 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