DBIx::...mn::FS(3pm)
πΈ DBIx::Class::InflateColumn::FS π
okay bestie, welcome to the User Contributed Perl Documentation for DBIx::...mn::FS β which is the manual page name, but the module itself is DBIx::Class::InflateColumn::FS, and yes the header is abbreviated like that, it's giving mystery, it's giving ellipsis-core π«Ά
β¨ NAME β¨
DBIx::Class::InflateColumn::FS β it inflates/deflates your columns into Path::Class::File objects. files as columns, no cap π
π¦ SYNOPSIS π¦
here's the whole vibe, copy it exactly bestie:
__PACKAGE__->load_components(qw/InflateColumn::FS Core/);
__PACKAGE__->add_columns(
id => {
data_type => 'INT',
is_auto_increment => 1,
},
file => {
data_type => 'TEXT',
is_fs_column => 1,
fs_column_path => '/var/lib/myapp/myfiles',
},
file_2 => {
data_type => 'TEXT',
is_fs_column => 1,
fs_column_path => '/var/lib/myapp/myfiles',
fs_new_on_update => 1
},
);
__PACKAGE__->set_primary_key('id');
# in application code
$rs->create({ file => $file_handle });
$row = $rs->find({ id => $id });
my $fh = $row->file->open('r');
π DESCRIPTION π
so basically β¨ it provides inflation to a Path::Class::File object, which is the fancy way of saying: you can store BLOBS on the file system and your DB column just pretends. main character energy fr fr π
the storage path gets specified with fs_column_path. every single file gets a unique name, so the storage for all FS columns can totally share the same path β no fighting, no drama, we love a collaborative queen π
within the path specified by fs_column_path, files are stored in sub-directories based on the first 2 characters of the unique file names. up to 256 sub-directories will be created, as needed. and if you wanna switch it up, override _fs_column_dirs in a derived class to change this behavior π§
and fs_new_on_update will create a new file name if the file has been updated. iconic. obsessed. β
π METHODS π
inflate_result
register_column
ngl bestie, the docs just list these two by name and say nothing else about them. that's it. that's the entry. i'm not gonna make stuff up, periodt π
fs_file_name
this one provides the file naming algorithm. override this method to change it π
it gets called with two parameters: the name of the column, and the column_info object.
_fs_column_dirs
returns the sub-directory components for a given file name. override it if you want to provide a deeper directory tree or just change the algorithm entirely β your tree, your rules πΈ
copy
copies a row object, duplicating the files backing fs columns. a full duplicate, files included, no crumbs left behind π«Ά
delete
deletes the associated file system storage when a row is deleted. bye bestie, the file's coming with you π
set_column
deletes file storage when an fs_column is set to undef. setting it to nothing = poof, gone β¨
set_inflated_column
re-inflates after setting an fs_column. it goes back in, it comes back out π¦
_inflate_fs_column
inflates a file column to a Path::Class::File object.
_deflate_fs_column
deflates a file column to its storage path name, relative to fs_column_path.
and here's the important bit bestie: in the database, a file column is just a place holder for inflation/deflation. the actual file lives in the file system. the column is the vibe, the file is the reality π
table
overridden to provide a hook for specifying the resultset_class. and listen β if you provide your own resultset_class, inherit from InflateColumn::FS::ResultSet. don't skip that step, it's not optional, fr fr.
π SUPPORT π
community support can be found via:
- Mailing list:
http://lists.scsys.co.uk/mailman/listinfo/dbix-class/ - IRC:
irc.perl.org#dbix-class
the author is semifor on IRC and a member of the mailing list. come say hi, we don't bite π
π AUTHOR π
semifor: Marc Mims <marc@questright.com>
π CONTRIBUTORS π
mst: Matt S. Trout<mst@shadowcatsystems.co.uk>mo: Moritz Onken<onken@netcubed.de>norbi: Norbert Buchmuller<norbi@nix.hu>
π LICENSE π
you may distribute this code under the same terms as Perl itself. slay, legally π
and that's the whole page bestie!! this manual page is from perl v5.32.0, dated 2021-01-07, and the page itself is DBIx::...mn::FS(3pm) β mwah, go inflate something π¦πβ¨
π¦ where this page comes from
- debian bookworm: libdbix-class-inflatecolumn-fs-perl 0.01007-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdbix-class-inflatecolumn-fs-perl 0.01007-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libdbix-class-inflatecolumn-fs-perl 0.01007-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdbix-class-inflatecolumn-fs-perl 0.01007-1.1 Β· 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