.\" 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 "ORLite::Mirror 3pm" .TH ORLite::Mirror 3pm "2021-01-06" "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" ORLite::Mirror \- Extend ORLite to support remote SQLite databases .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # Regular ORLite on a readonly SQLite database \& use ORLite \*(Aqpath/mydb.sqlite\*(Aq; \& \& # The equivalent for a remote (optionally compressed) SQLite database \& use ORLite::Mirror \*(Aqhttp://myserver/path/mydb.sqlite.gz\*(Aq; \& \& # All available additional options specified \& use ORLite::Mirror { \& url => \*(Aqhttp://myserver/path/mydb.sqlite.gz\*(Aq, \& maxage => 3600, \& show_progress => 1, \& env_proxy => 1, \& prune => 1, \& index => [ \& \*(Aqtable1.column1\*(Aq, \& \*(Aqtable1.column2\*(Aq, \& ], \& }; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" ORLite provides a readonly \s-1ORM API\s0 when it loads a readonly SQLite database from your local system. .PP By combining this capability with \s-1LWP\s0, ORLite::Mirror goes one step better and allows you to load a SQLite database from any arbitrary \s-1URI\s0 in readonly form as well. .PP As demonstrated in the synopsis above, you using ORLite::Mirror in the same way, but provide a \s-1URL\s0 instead of a file name. .PP If the \s-1URL\s0 explicitly ends with a '.gz' or '.bz2' then ORLite::Mirror will decompress the file before loading it. .SH "OPTIONS" .IX Header "OPTIONS" \&\fBORLite::Mirror\fR adds an extensive set of options to those provided by the underlying ORLite library. .SS "url" .IX Subsection "url" The compulsory \f(CW\*(C`url\*(C'\fR parameter should be a string containing the remote location of the SQLite database we will be mirroring. .PP \&\fBORLite::Mirror\fR supports downloading the database compressed, and then transparently decompressing the file locally. Compression support is controlled by the extension on the remote database. .PP The extensions \f(CW\*(C`.gz\*(C'\fR (for gunzip) and \f(CW\*(C`.bz2\*(C'\fR (for bunzip2) are currently supported. .SS "maxage" .IX Subsection "maxage" The optional \f(CW\*(C`maxage\*(C'\fR parameter controls how often \fBORLite::Mirror\fR should check the remote server to see if the data has been updated. .PP This allows programs using the database to start quickly the majority of the time, but continue to receive automatic updates periodically. .PP The value is the number of integer seconds we should avoid checking the remote server for. The default is 86400 seconds (one 24 hour day). .SS "show_progress" .IX Subsection "show_progress" The optional \f(CW\*(C`show_progress\*(C'\fR parameter will be passed through to the underlying LWP::UserAgent that will fetch the remote database file. .PP When set to true, it causes a progress bar to be displayed on the terminal as the database file is downloaded. .SS "env_proxy" .IX Subsection "env_proxy" The optional \f(CW\*(C`env_proxy\*(C'\fR parameter will be passed through to the underlying LWP::UserAgent that will fetch the remote database file. .PP When set to true, it causes LWP::UserAgent to read the location of a proxy server from the environment. .SS "prune" .IX Subsection "prune" The optional \f(CW\*(C`prune\*(C'\fR parameter should be used when the surrounding program wants to avoid leaving files on the host system. .PP It causes any files or directories created during the operation of \&\fBORLite::Mirror\fR to be deleted on program exit at \f(CW\*(C`END\*(C'\fR\-time. .SS "index" .IX Subsection "index" One challenge when distributing SQLite database is the quantity of data store on disk to support the indexes on your database. .PP For a moderately indexed database where all primary and foreign key columns have indexes, the amount of data in the indexes can be nearly as large as the data stored for the tables themselves. .PP Because each user of the database module will be interested in different things, the indexes that the original creator chooses to place on the database may not even be used at all and other valuable indexes may not exist at all. .PP To allow sufficiently flexibility, we recommend that SQLite database be distributed without any indexes. This greatly reduces the file size and download time for the database file. .PP The optional \f(CW\*(C`index\*(C'\fR parameter should then be used by each different consumer of that module to index just the columns that are of specific interest and will be used in the queries that will be run on the database. .PP The value should be set to an \f(CW\*(C`ARRAY\*(C'\fR reference containing a list of column names in \f(CW\*(C`tablename.columnname\*(C'\fR form. .PP .Vb 4 \& index => [ \& \*(Aqtable1.column1\*(Aq, \& \*(Aqtable1.column2\*(Aq, \& ], .Ve .SH "SUPPORT" .IX Header "SUPPORT" Bugs should be reported via the \s-1CPAN\s0 bug tracker at .PP .PP For other issues, contact the author. .SH "AUTHOR" .IX Header "AUTHOR" Adam Kennedy .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2008 \- 2012 Adam Kennedy. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \&\s-1LICENSE\s0 file included with this module.