.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DBIx::Class::InflateColumn::FS 3pm" .TH DBIx::Class::InflateColumn::FS 3pm "2021-01-07" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" DBIx::Class::InflateColumn::FS \- Inflate/deflate columns to Path::Class::File objects .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& _\|_PACKAGE_\|_\->load_components(qw/InflateColumn::FS Core/); \& _\|_PACKAGE_\|_\->add_columns( \& id => { \& data_type => \*(AqINT\*(Aq, \& is_auto_increment => 1, \& }, \& file => { \& data_type => \*(AqTEXT\*(Aq, \& is_fs_column => 1, \& fs_column_path => \*(Aq/var/lib/myapp/myfiles\*(Aq, \& }, \& file_2 => { \& data_type => \*(AqTEXT\*(Aq, \& is_fs_column => 1, \& fs_column_path => \*(Aq/var/lib/myapp/myfiles\*(Aq, \& fs_new_on_update => 1 \& }, \& ); \& _\|_PACKAGE_\|_\->set_primary_key(\*(Aqid\*(Aq); \& \& # in application code \& $rs\->create({ file => $file_handle }); \& \& $row = $rs\->find({ id => $id }); \& my $fh = $row\->file\->open(\*(Aqr\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Provides inflation to a Path::Class::File object allowing file system storage of \s-1BLOBS.\s0 .PP The storage path is specified with \f(CW\*(C`fs_column_path\*(C'\fR. Each file receives a unique name, so the storage for all \s-1FS\s0 columns can share the same path. .PP Within the path specified by \f(CW\*(C`fs_column_path\*(C'\fR, 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. Override \f(CW\*(C`_fs_column_dirs\*(C'\fR in a derived class to change this behavior. .PP \&\f(CW\*(C`fs_new_on_update\*(C'\fR will create a new file name if the file has been updated. .SH "METHODS" .IX Header "METHODS" .SS "inflate_result" .IX Subsection "inflate_result" .SS "register_column" .IX Subsection "register_column" .SS "fs_file_name" .IX Subsection "fs_file_name" Provides the file naming algorithm. Override this method to change it. .PP This method is called with two parameters: The name of the column and the \&\f(CW\*(C`column_info\*(C'\fR object. .SS "_fs_column_dirs" .IX Subsection "_fs_column_dirs" Returns the sub-directory components for a given file name. Override it to provide a deeper directory tree or change the algorithm. .SS "copy" .IX Subsection "copy" Copies a row object, duplicating the files backing fs columns. .SS "delete" .IX Subsection "delete" Deletes the associated file system storage when a row is deleted. .SS "set_column" .IX Subsection "set_column" Deletes file storage when an fs_column is set to undef. .SS "set_inflated_column" .IX Subsection "set_inflated_column" Re-inflates after setting an fs_column. .SS "_inflate_fs_column" .IX Subsection "_inflate_fs_column" Inflates a file column to a Path::Class::File object. .SS "_deflate_fs_column" .IX Subsection "_deflate_fs_column" Deflates a file column to its storage path name, relative to \f(CW\*(C`fs_column_path\*(C'\fR. In the database, a file column is just a place holder for inflation/deflation. The actual file lives in the file system. .SS "table" .IX Subsection "table" Overridden to provide a hook for specifying the resultset_class. If you provide your own resultset_class, inherit from InflateColumn::FS::ResultSet. .SH "SUPPORT" .IX Header "SUPPORT" Community support can be found via: .PP .Vb 1 \& Mailing list: http://lists.scsys.co.uk/mailman/listinfo/dbix\-class/ \& \& IRC: irc.perl.org#dbix\-class .Ve .PP The author is \f(CW\*(C`semifor\*(C'\fR on \s-1IRC\s0 and a member of the mailing list. .SH "AUTHOR" .IX Header "AUTHOR" semifor: Marc Mims .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" mst: Matt S. Trout .PP mo: Moritz Onken .PP norbi: Norbert Buchmuller .SH "LICENSE" .IX Header "LICENSE" You may distribute this code under the same terms as Perl itself.