ORLite-2.00/000770 000766 000024 00000000000 14470240452 013043 5ustar00etherstaff000000 000000 ORLite-2.00/INSTALL000644 000766 000024 00000004475 14470240452 014111 0ustar00etherstaff000000 000000 This is the Perl distribution ORLite. Installing ORLite is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm ORLite If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan ORLite ## Manual installation As a last resort, you can manually install it. If you have not already downloaded the release tarball, you can find the download link on the module's MetaCPAN page: https://metacpan.org/pod/ORLite Untar the tarball, install configure prerequisites (see below), then build it: % perl Makefile.PL % make && make test Then install it: % make install On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib The prerequisites of this distribution will also have to be installed manually. The prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated by running the manual build process described above. ## Configure Prerequisites This distribution requires other modules to be installed before this distribution's installer can be run. They can be found under the "configure_requires" key of META.yml or the "{prereqs}{configure}{requires}" key of META.json. ## Other Prerequisites This distribution may require additional modules to be installed after running Makefile.PL. Look for prerequisites in the following phases: * to run make, PHASE = build * to use the module code itself, PHASE = runtime * to run tests, PHASE = test They can all be found in the "PHASE_requires" key of MYMETA.yml or the "{prereqs}{PHASE}{requires}" key of MYMETA.json. ## Documentation ORLite documentation is available as POD. You can run `perldoc` from a shell to read the documentation: % perldoc ORLite For more information on installing Perl modules via CPAN, please see: https://www.cpan.org/modules/INSTALL.html ORLite-2.00/LICENSE000644 000766 000024 00000046427 14470240452 014070 0ustar00etherstaff000000 000000 This software is copyright (c) 2008 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2008 by Adam Kennedy. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Perl Artistic License 1.0 --- This software is Copyright (c) 2008 by Adam Kennedy. This is free software, licensed under: The Perl Artistic License 1.0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End ORLite-2.00/CONTRIBUTING000644 000766 000024 00000007152 14470240452 014705 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. PLEASE NOTE that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are just recommendations, intended to help you (and help us help you faster). The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t $ prove -lvr t/ In most cases, 'prove' is entirely sufficient for you to test any patches you have. You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release -- this is available at https://metacpan.org/release/ORLite If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends ORLite Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps --missing` or $ dzil authordeps --missing | cpanm You should then also install any additional requirements not needed by the dzil build but may be needed by tests or other development: $ cpan `dzil listdeps --author --missing` or $ dzil listdeps --author --missing | cpanm Or, you can use the 'dzil stale' command to install all requirements at once: $ cpan Dist::Zilla::App::Command::stale $ cpan `dzil stale --all` or $ cpanm Dist::Zilla::App::Command::stale $ dzil stale --all | cpanm You can also do this via cpanm directly: $ cpanm --reinstall --installdeps --with-develop --with-recommends ORLite Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil test --release $ dzil xtest $ dzil listdeps --json $ dzil build --notgz You can learn more about Dist::Zilla at http://dzil.org/. The code for this distribution is hosted at GitHub. The repository is: https://github.com/karenetheridge/ORLite You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Please include a suitable end-user-oriented entry in the Changes file describing your change. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report here: https://rt.cpan.org/Public/Dist/Display.html?Name=ORLite or via email: bug-ORLite@rt.cpan.org This is a good place to send your questions about the usage of this distribution. If you send me a patch or pull request, your name and email address will be included in the documentation as a contributor (using the attribution on the commit or patch), unless you specifically request for it not to be. If you wish to be listed under a different name or address, you should submit a pull request to the .mailmap file to contain the correct mapping. This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.015 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.162. ORLite-2.00/Changes000640 000766 000024 00000027016 14470240452 014343 0ustar00etherstaff000000 000000 Changes for Perl extension ORLite 2.00 2023-08-19 22:24:38Z - fix some test module renamings that were missed in 1.99 - Fix test failure with SQLite 3.37.0 (RT#140748) 1.99 2023-08-13 21:09:06Z - fix test errors with DBD::SQLite >= 1.52 (RT#149134) 1.98 2012-09-29 - When setting pragmas in void context, skip reading the changed pragma back out of the database pointlessly. - Removed legacy support for static ->delete('where ...') 1.97 2012-05-21 - Use reproducible longdouble in tests (HMBRAND) 1.96 2012-02-27 - Fixed a crash in the legacy delete emulation where the condition clause provided was a constant or read-only. 1.95 2012-02-27 - Fixed a fatal rowid big when generating in array mode 1.94 2012-02-27 - Fixed a fatal rowid bug when a table had a single non-INTEGER primary key. - Fixed bug in affinity detection code to now set REAL and NUMERIC affinity correctly. 1.93 2012-02-27 - The previous release 1.92 was done with a missing commit, this release restores that missing code. 1.92 2012-02-27 - Add the ->delete_where method for bulk deletion - Always do the initial metadata scan using ReadOnly => 1. - When generating readonly, DBI connections use ReadOnly => 1 too. - Quote identifiers more correctly via $dbh->quote_identifier. - Temporarily restory the static delete call to prevent breaking Padre and other applications still using the old version of delete. 1.91 2012-02-23 - Calculate column affinity types in the metadata preparation phase - Throw an exception when tables contain BLOB types and the database is unicode, as the blob data will be corrupted. - Improved testing for blobs and unicode, and TODO a known problem 1.90 2012-02-21 - Removed x_rowid parameter and make the rowid logic compulsory. - Removed x_update parameter and make update method compulsory at the table level but do not generate on the root level. - As a result, ORLite now supports creating and updating objects even when they come from tables without primary keys. - Pending release as 2.00 once clarifying documentation is written. 1.54 2012-02-21 - Added experimental x_rowid parameter to maintain SQLite rowids in the objects 1.53 2012-02-21 - Add a ->id convenience method alias when table 'foo' has a single numeric primary key 'foo_id' so you can use $foo->id 1.52 2012-01-21 - Added initial unicode => 1 support (MEMOWE) - Bumped Params::Util dependency to 1.0 for *LIKE fixes (ADAMK) 1.51 2011-11-25 - Module::Install::DSL updated to 1.04 - Automatically load overlay classes if there exist. That is, where a Foo/TableName.pm module exists in addition to the automatically generated Foo::TableName class. 1.50 2011-06-07 - Removed normalize as a supported parameter, normalizing columns turns out not to work in practice. However, we always normalize tables to get the class name for the table as that seems to result in class names that make much more sense. 1.49 2011-06-01 - Adding normalize support to turn columnName into column_name 1.48 2011-01-21 - Initial support for shim => 1 to simplify customisation (ADAMK) 1.47 2010-12-08 - Adding readonly support for views (ADAMK) 1.46 2010-11-30 - Bumped File::Path dependency to 2.08 to prevent test failures from the one shipped with Perl 5.8.9 (AZAWAWI) - Added experimental base class ->update support (ADAMK) - Added the qname attributes to the generator structs to simplify and improve readability of SQL fragment strings (ADAMK) 1.45 2010-08-08 - Adding initial support for cache => $directory (ADAMK) 1.44 2010-07-23 - Upgrading to Module::Install::DSL 1.00 (ADAMK) - Adding the per-table table_info method to get the columns (ADAMK) - Adding tests for the per-table metadata methods (ADAMK) 1.43 2010-05-10 - Ensure 100% of tables and columns are quoted correctly (ADAMK) 1.42 2010-03-16 - Signficantly expanded documentation on the per-table class and the methods created for it (Breno G. de Oliveira) 1.41 2010-03-09 - Added the root ->connected method to allow for some light introspection in unusual situations (such as knowing if it's safe to spawn an off-the-books ->connect'tion, or to detect if we are in a transaction). - Added documentation for the ->connect method, with suitably strident warnings about the dangers of deadlocking. 1.40 2010-02-01 - Fixed backwards test skipping logic 1.39 2010-01-29 - Typo in the tests, they now run >= instead of > 1.05 1.38 2010-01-28 - When using array => 1 on classes that we can create, add a ->set method for setting parameters in the object safely. 1.37 2010-01-28 - Adding experimental support for the array => 1 option. 1.36 2010-01-27 - Rolled back the Template::Tiny conversion as it ended up slowing down the code generation too much. I shall struggle on under the old method. 1.35 2010-01-27 - Adding experimental support for accelerated XS accessors using Class::XSAccessor. ORLite itself will not introduce a dependency on this module, consumers of this feature will need to do it themselves. 1.34 2010-01-26 - Major Change: Moved code generation from raw string appending to using Template::Tiny instead. This will enable some new and more complex improvements to the generated code. - Added tests for the cleanup code. 1.33 2010-01-24 - When in the Perl debugger and on Perl 5.8.9 or newer, use the $^P | 0800 in preference to dval (and always use it even when $DEBUG is off). 1.32 2010-01-15 - Each generated class now cleans up its own persistant connection, rather than allowing it to fall through to the deeper DBI cleanup. - To allow for persistant connections to readonly database, we now always built transaction support for all databases. However, for readonly databases we do not build the commit method and you may only use the rollback method to end them. - Significantly expanded the Pod documentation to provide documentation on all of the import options. - Add support for a cleanup option to import, which is single explicit statement to be called on the database when the process is shutting down. This should typically be used ensure that a SQLite database is VACUUM'ed regularly (and at a time when it hopefully won't impact the user much). 1.31 2010-01-02 - Adding explicit versioned-use lines to the generated code (in case the generated code is used independantly to its creation) 1.30 2010-01-02 - Switching to a production release, CPAN Testers looks ok - Update DBD::SQLite dependency to 1.27. Some of the metadata pragmas have changed, and we don't want to have to support both the old and new versions. - ORLite will now correctly use RaiseError => 1, PrintError => 0 when itself introspecting the schema, so a corrupted SQLite database won't result in silent failure and the larger parent application won't crash in unpredictable ways. 1.29_03 2009-10-01 - Reverse the prune deletion order - Apply recursive delete flag 1.29_02 2009-09-29 - Changed ->load to use selectrow_hashref - Allow ->load calls for multiple-columns primary keys - All connections now explicitly RaiseError => 1 for correctness - All connections now explicitly PrintError => 0 to avoid spewing stuff to STDOUT/STDERR unexpectedly in embedded scenarios. - Remove most explicit error handling and allow the native DBI errors to cascade upwards instead. 1.29_01 2009-09-28 - Adding first experimental implementation of ->load 1.28 2009-09-25 - Adding ->prune method that so that pruning can also be done in subclasses. - Apply rel2abs to pruned directories so they still get deleted even when our current directory moves. 1.27 2009-09-25 - Adding test script for the prune feature 1.26_01 2009-09-25 - Adding the prune option to have ORLite to track every file and directory it creates and remove them during END phase. (This should be especially handy in test scripts) 1.25 2009-08-15 - Adding base and table metadata methods to each class to support the creation of support/extension methods 1.24 2009-08-15 - Adding support for an iterate method 1.23 2009-06-11 - Fixed a bug in method ->delete which deleted more than the actual object in case the primary key consist of more than one column. Added basic support for such primary keys with more than one column. 1.22 2009-06-01 - Updated to Module::Install::DSL 0.91 - Split out debug/eval as (undocument) dval function - App support for a (currently undocumented) 'append' param to allow sub-classes like ORLite::Mirror to merge in additional code to the generated class. 1.21 2009-05-24 - Updated to Module::Install::DSL 0.88 - Added commit_begin and rollback_begin to allow persisting of the connection between successive transactions. 1.20 2009-02-12 - Auto-create parent directory for ORLite files - Add root method ->sqlite which returns the path to the sqlite file for that database. 1.19 2009-02-03 - Adding support for using a CODE reference in the 'create' parameter, so that the schema setup can be provided directly in the ORLite initialisation. 1.18 2009-01-14 - Adding an ->orlite method to return the version number of the ORLite module that was used to generate the distribution. 1.17 2009-01-03 - Adding a ->truncate method to each table 1.16 2008-12-14 - The fact that I didn't need to change ORLite for ORLite::Migrate suggests that it's stable enough for general use (pending 2.0) 0.15 2008-09-24 - Adding support for writable pragmas - Adding tests for pragmas, schema_version and user_version 0.14 2008-09-23 - Removed the last remnants of %ORLite::DSN and %ORLite::DBH. - Added support for the "create" param to allow database creation 0.13 2008-09-19 - Fixed critical bug introduced in 0.10 or somewhere around there, where column accessors were not defined for readonly classes. (This fatally killed ORLite::Mirror) 0.12 2008-09-15 - Don't store the database values in a shared hash any more (Makes the classes self-contained and able to run without ORLite) - Add a tables param to the import, to allow the base database connectivity class to be created without the table classes. 0.11 2008-09-09 - If we aren't debugging we don't need to write the temp file 0.10 2008-08-06 - Quote all column names for explicitness 0.09 2008-07-11 - Adding pragma method to the top package - Adding user_version import param to provide the ability to lock the Perl code against a known-good schema. 0.08 2008-06-24 - Adding an experimental -DEBUG option 0.07 2008-05-28 - Actually trust the package param 0.06 2008-05-28 - Don't add transaction support if we are readonly 0.05 2008-05-27 - Minor bug fixes in the ->import method - Correcting the RT link in the POD. 0.04 2008-05-27 - Added ->import( \%hash ) support. - Added support for custom passing of the target package. - Added support for readonly database loading (We need this for doing mirrored remote db support) - Autodetect readonly SQLite files 0.03 2008-05-22 - Added initial foreign key support - Added the POD documentation for ORLite root packages - Added File::Spec dependency 0.02 2008-05-19 - Added class and instance ->delete - Added ->new - Added ->insert - Added ->create 0.01 2008-05-16 - Created an initial experimental support with only ->select ORLite-2.00/MANIFEST000644 000766 000024 00000002107 14470240452 014177 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030. CONTRIBUTING Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/ORLite.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/01_compile.t t/02_basics.sql t/02_basics.t t/03_fk.sql t/03_fk.t t/04_readonly.t t/05_notables.t t/06_create.t t/07_pk.sql t/07_pk.t t/08_prune.pl t/08_prune.t t/09_badfile.t t/10_cleanup.sql t/10_cleanup.t t/11_cleanup.t t/12_xs.t t/13_array_basics.t t/14_array_fk.t t/15_array_xs.t t/16_array_create.t t/17_cache.sql t/17_cache.t t/18_update.sql t/18_update.t t/19_view.sql t/19_view.t t/20_shim.t t/21_normalize.sql t/21_normalize.t t/22_overlay.t t/23_unicode.sql t/23_unicode.t t/24_rowid.sql t/24_rowid.t t/25_blob.sql t/25_blob.t t/lib/LocalTest.pm t/lib/MyDB/TableOne.pm xt/author/00-compile.t xt/author/clean-namespaces.t xt/author/distmeta.t xt/author/kwalitee.t xt/author/minimum-version.t xt/author/mojibake.t xt/author/pod-no404s.t xt/author/pod-syntax.t xt/author/portability.t xt/pmv.t xt/release/changes_has_content.t xt/release/cpan-changes.t ORLite-2.00/t/000770 000766 000024 00000000000 14470240452 013306 5ustar00etherstaff000000 000000 ORLite-2.00/xt/000770 000766 000024 00000000000 14470240452 013476 5ustar00etherstaff000000 000000 ORLite-2.00/README000644 000766 000024 00000000561 14470240452 013730 0ustar00etherstaff000000 000000 This archive contains the distribution ORLite, version 2.00: Extremely light weight SQLite-specific ORM This software is copyright (c) 2008 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.030. ORLite-2.00/META.yml000644 000766 000024 00000051615 14470240452 014327 0ustar00etherstaff000000 000000 --- abstract: 'Extremely light weight SQLite-specific ORM' author: - 'Adam Kennedy ' build_requires: Class::XSAccessor: '0' Class::XSAccessor::Array: '0' Exporter: '0' ExtUtils::MakeMaker: '0' File::Spec: '0.80' File::Spec::Functions: '0' Test::Deep: '0' Test::More: '0' Test::Script: '0' lib: '0' perl: '5.008' utf8: '0' vars: '0' warnings: '0' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.006' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: ORLite no_index: directory: - t - xt provides: ORLite: file: lib/ORLite.pm version: '2.00' requires: Carp: '0' DBD::SQLite: '1.27' DBI: '1.607' File::Basename: '0' File::Path: '2.08' File::Remove: '0' File::Spec: '0.80' File::Temp: '0' Params::Util: '1.00' perl: '5.008' strict: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=ORLite homepage: https://github.com/karenetheridge/ORLite repository: https://github.com/karenetheridge/ORLite.git version: '2.00' x_Dist_Zilla: perl: version: '5.039001' plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle version' version: '6.030' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::ETHER phase: build run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, build' version: '0.058' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '6.030' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING - INSTALL - LICENSE - README.pod exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@Author::ETHER/Git::GatherDir' version: '2.048' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '6.030' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '6.030' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '6.030' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '6.030' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '6.030' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 has_xs: 0 location: build source_filename: CONTRIBUTING Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.009' name: '@Author::ETHER/generate CONTRIBUTING' version: '0.015' - class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000038' version: '0.006' name: '@Author::ETHER/InstallGuide' version: '1.200014' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: 1 fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' - '@Author::ETHER/Examples' skips: [] switch: [] name: '@Author::ETHER/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: '6.030' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Author::ETHER/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::Test::MinimumVersion config: Dist::Zilla::Plugin::Test::MinimumVersion: max_target_perl: '5.008' name: '@Author::ETHER/Test::MinimumVersion' version: '2.000010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '6.030' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.004' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/author/kwalitee.t skiptest: [] name: '@Author::ETHER/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ETHER/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::ETHER/Test::ReportPrereqs' version: '0.029' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@Author::ETHER/Test::Portability' version: '2.001001' - class: Dist::Zilla::Plugin::Test::CleanNamespaces config: Dist::Zilla::Plugin::Test::CleanNamespaces: filename: xt/author/clean-namespaces.t skips: [] name: '@Author::ETHER/Test::CleanNamespaces' version: '0.006' - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::ETHER/Git::Describe' version: '0.008' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: '6.030' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder: - ':InstallModules' finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.030' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: 0 inherit_version: 0 meta_noindex: 1 Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000038' version: '0.006' name: '@Author::ETHER/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '6.030' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: [] name: '@Author::ETHER/Keywords' version: '0.007' - class: Dist::Zilla::Plugin::UseUnsafeInc config: Dist::Zilla::Plugin::UseUnsafeInc: dot_in_INC: 0 name: '@Author::ETHER/UseUnsafeInc' version: '0.002' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '6.030' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: '0.007' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: '1' name: '@Author::ETHER/MakeMaker' version: '6.030' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.40.0 include_authors: 0 include_releaser: 1 order_by: commits paths: [] name: '@Author::ETHER/Git::Contributors' version: '0.036' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 1 mode: auto name: '@Author::ETHER/StaticInstall' version: '0.012' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000038' version: '0.006' name: '@Author::ETHER/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 1 run: - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" version: '0.049' name: '@Author::ETHER/.ackrc' version: '0.049' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" fatal_errors: 0 quiet: 1 version: '0.049' name: '@Author::ETHER/.latest' version: '0.049' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::ETHER/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::EnsureLatestPerl config: Dist::Zilla::Plugin::EnsureLatestPerl: Module::CoreList: '5.20230720' name: '@Author::ETHER/EnsureLatestPerl' version: '0.010' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, release' version: '0.058' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . name: '@Author::ETHER/initial check' version: '2.048' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: '0.014' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: '0.014' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@Author::ETHER/Git::Remote::Check' version: 0.1.2 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.022' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '6.030' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . name: '@Author::ETHER/after tests' version: '2.048' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.011' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '6.030' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/copy generated files' version: '0.007' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/@Git::VersionManager/pluginbundle version' version: '6.030' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 1 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::ETHER/@Git::VersionManager/RewriteVersion::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Author::ETHER/@Git::VersionManager/MetaProvides::Update' version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Changes match: [] name: '@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease' version: '0.007' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: - . commit_msg: '%N-%v%t%n%n%c' signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING - Changes - INSTALL - LICENSE - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/release snapshot' version: '2.048' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v2.00 tag_format: v%V tag_message: v%v%t Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/Git::Tag' version: '2.048' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':InstallModules' global: 1 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::ETHER/@Git::VersionManager/BumpVersionAfterRelease::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/@Git::VersionManager/NextRelease' version: '6.030' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Build.PL - Changes - Makefile.PL allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/post-release commit' version: '2.048' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager' version: '6.030' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.40.0 repo_root: . name: '@Author::ETHER/Git::Push' version: '2.048' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.49' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED version: '0.049' name: '@Author::ETHER/install release' version: '0.049' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 version: '0.049' name: '@Author::ETHER/release complete' version: '0.049' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '6.030' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/prereqs for @Author::ETHER' version: '6.030' - class: Dist::Zilla::Plugin::FileFinder::Filter name: no_sql_files version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.030' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.030' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.016' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: '6.030' x_authority: cpan:ADAMK x_contributors: - 'Adam Kennedy ' - 'Karen Etheridge ' - 'Ahmad M. Zawawi ' - 'Mirko Westermeier ' - 'Alexandr Ciornii ' - 'Graham Knop ' - 'gregor herrmann ' - 'Michael Lang ' x_generated_by_perl: v5.39.1 x_serialization_backend: 'YAML::Tiny version 1.74' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_use_unsafe_inc: 0 ORLite-2.00/lib/000770 000766 000024 00000000000 14470240452 013611 5ustar00etherstaff000000 000000 ORLite-2.00/Makefile.PL000644 000766 000024 00000003733 14470240452 015026 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030. use strict; use warnings; use 5.008; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Extremely light weight SQLite-specific ORM", "AUTHOR" => "Adam Kennedy ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "ORLite", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008", "NAME" => "ORLite", "PREREQ_PM" => { "Carp" => 0, "DBD::SQLite" => "1.27", "DBI" => "1.607", "File::Basename" => 0, "File::Path" => "2.08", "File::Remove" => 0, "File::Spec" => "0.80", "File::Temp" => 0, "Params::Util" => "1.00", "strict" => 0 }, "TEST_REQUIRES" => { "Class::XSAccessor" => 0, "Class::XSAccessor::Array" => 0, "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => "0.80", "File::Spec::Functions" => 0, "Test::Deep" => 0, "Test::More" => 0, "Test::Script" => 0, "lib" => 0, "utf8" => 0, "vars" => 0, "warnings" => 0 }, "VERSION" => "2.00", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Class::XSAccessor" => 0, "Class::XSAccessor::Array" => 0, "DBD::SQLite" => "1.27", "DBI" => "1.607", "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Basename" => 0, "File::Path" => "2.08", "File::Remove" => 0, "File::Spec" => "0.80", "File::Spec::Functions" => 0, "File::Temp" => 0, "Params::Util" => "1.00", "Test::Deep" => 0, "Test::More" => 0, "Test::Script" => 0, "lib" => 0, "strict" => 0, "utf8" => 0, "vars" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); ORLite-2.00/META.json000644 000766 000024 00000110657 14470240452 014501 0ustar00etherstaff000000 000000 { "abstract" : "Extremely light weight SQLite-specific ORM", "author" : [ "Adam Kennedy " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "ORLite", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.006" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.162", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { "Encode" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CleanNamespaces" : "0.15", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::Pod" : "1.41", "Test::Pod::No404s" : "0", "Test::Portability::Files" : "0", "warnings" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "DBD::SQLite" : "1.27", "DBI" : "1.607", "File::Basename" : "0", "File::Path" : "2.08", "File::Remove" : "0", "File::Spec" : "0.80", "File::Temp" : "0", "Params::Util" : "1.00", "perl" : "5.008", "strict" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Class::XSAccessor" : "0", "Class::XSAccessor::Array" : "0", "Exporter" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0.80", "File::Spec::Functions" : "0", "Test::Deep" : "0", "Test::More" : "0", "Test::Script" : "0", "lib" : "0", "perl" : "5.008", "utf8" : "0", "vars" : "0", "warnings" : "0" } }, "x_Dist_Zilla" : { "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Authority" : "1.009", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::AutoPrereqs" : "5.038", "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", "Dist::Zilla::Plugin::CheckIssues" : "0", "Dist::Zilla::Plugin::CheckMetaResources" : "0", "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0.019", "Dist::Zilla::Plugin::CheckSelfDependency" : "0", "Dist::Zilla::Plugin::CheckStrictVersion" : "0", "Dist::Zilla::Plugin::ConfirmRelease" : "0", "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", "Dist::Zilla::Plugin::EnsureLatestPerl" : "0", "Dist::Zilla::Plugin::FileFinder::ByName" : "0", "Dist::Zilla::Plugin::FileFinder::Filter" : "0", "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : "0", "Dist::Zilla::Plugin::Git::Check" : "0", "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0.004", "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts" : "0", "Dist::Zilla::Plugin::Git::Commit" : "2.020", "Dist::Zilla::Plugin::Git::Contributors" : "0.029", "Dist::Zilla::Plugin::Git::Describe" : "0.004", "Dist::Zilla::Plugin::Git::GatherDir" : "2.016", "Dist::Zilla::Plugin::Git::Push" : "0", "Dist::Zilla::Plugin::Git::Remote::Check" : "0", "Dist::Zilla::Plugin::Git::Tag" : "0", "Dist::Zilla::Plugin::GitHub::Update" : "0.40", "Dist::Zilla::Plugin::GithubMeta" : "0.54", "Dist::Zilla::Plugin::InstallGuide" : "1.200005", "Dist::Zilla::Plugin::Keywords" : "0.004", "Dist::Zilla::Plugin::License" : "5.038", "Dist::Zilla::Plugin::MakeMaker" : "0", "Dist::Zilla::Plugin::Manifest" : "0", "Dist::Zilla::Plugin::MetaConfig" : "0", "Dist::Zilla::Plugin::MetaJSON" : "0", "Dist::Zilla::Plugin::MetaNoIndex" : "0", "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", "Dist::Zilla::Plugin::MetaTests" : "0", "Dist::Zilla::Plugin::MetaYAML" : "0", "Dist::Zilla::Plugin::MinimumPerl" : "1.006", "Dist::Zilla::Plugin::MojibakeTests" : "0.8", "Dist::Zilla::Plugin::NextRelease" : "5.033", "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0.006", "Dist::Zilla::Plugin::PromptIfStale" : "0", "Dist::Zilla::Plugin::Readme" : "0", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.006", "Dist::Zilla::Plugin::Run::AfterBuild" : "0.041", "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", "Dist::Zilla::Plugin::RunExtraTests" : "0.024", "Dist::Zilla::Plugin::StaticInstall" : "0.005", "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.012", "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", "Dist::Zilla::Plugin::Test::CleanNamespaces" : "0.006", "Dist::Zilla::Plugin::Test::Compile" : "2.039", "Dist::Zilla::Plugin::Test::Kwalitee" : "2.10", "Dist::Zilla::Plugin::Test::MinimumVersion" : "2.000010", "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.003", "Dist::Zilla::Plugin::Test::Portability" : "2.000007", "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.022", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", "Dist::Zilla::Plugin::UseUnsafeInc" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.160", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007", "Software::License::Perl_5" : "0" } } }, "provides" : { "ORLite" : { "file" : "lib/ORLite.pm", "version" : "2.00" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-ORLite@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=ORLite" }, "homepage" : "https://github.com/karenetheridge/ORLite", "repository" : { "type" : "git", "url" : "https://github.com/karenetheridge/ORLite.git", "web" : "https://github.com/karenetheridge/ORLite" } }, "version" : "2.00", "x_Dist_Zilla" : { "perl" : { "version" : "5.039001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle version", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::ETHER" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, build", "version" : "0.058" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING", "INSTALL", "LICENSE", "README.pod" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@Author::ETHER/Git::GatherDir", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "has_xs" : 0, "location" : "build", "source_filename" : "CONTRIBUTING" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.009" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000038", "version" : "0.006" } }, "name" : "@Author::ETHER/InstallGuide", "version" : "1.200014" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 1, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles", "@Author::ETHER/Examples" ], "skips" : [], "switch" : [] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "config" : { "Dist::Zilla::Plugin::Test::MinimumVersion" : { "max_target_perl" : "5.008" } }, "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.004" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/author/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::ETHER/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ETHER/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::ETHER/Test::ReportPrereqs", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "@Author::ETHER/Test::Portability", "version" : "2.001001" }, { "class" : "Dist::Zilla::Plugin::Test::CleanNamespaces", "config" : { "Dist::Zilla::Plugin::Test::CleanNamespaces" : { "filename" : "xt/author/clean-namespaces.t", "skips" : [] } }, "name" : "@Author::ETHER/Test::CleanNamespaces", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::ETHER/Git::Describe", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder" : [ ":InstallModules" ], "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.030" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 0, "inherit_version" : 0, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000038", "version" : "0.006" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::UseUnsafeInc", "config" : { "Dist::Zilla::Plugin::UseUnsafeInc" : { "dot_in_INC" : 0 } }, "name" : "@Author::ETHER/UseUnsafeInc", "version" : "0.002" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : "1" } }, "name" : "@Author::ETHER/MakeMaker", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.40.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.036" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 1, "mode" : "auto" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000038", "version" : "0.006" } }, "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 1, "run" : [ "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" ], "version" : "0.049" } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.049" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" ], "fatal_errors" : 0, "quiet" : 1, "version" : "0.049" } }, "name" : "@Author::ETHER/.latest", "version" : "0.049" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::ETHER/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::EnsureLatestPerl", "config" : { "Dist::Zilla::Plugin::EnsureLatestPerl" : { "Module::CoreList" : "5.20230720" } }, "name" : "@Author::ETHER/EnsureLatestPerl", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, release", "version" : "0.058" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@Author::ETHER/Git::Remote::Check", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.022" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/copy generated files", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/@Git::VersionManager/pluginbundle version", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::ETHER/@Git::VersionManager/RewriteVersion::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Author::ETHER/@Git::VersionManager/MetaProvides::Update", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Changes" ], "match" : [] } }, "name" : "@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [ "." ], "commit_msg" : "%N-%v%t%n%n%c", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENSE", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/release snapshot", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v2.00", "tag_format" : "v%V", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/Git::Tag", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":InstallModules" ], "global" : 1, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::ETHER/@Git::VersionManager/BumpVersionAfterRelease::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/@Git::VersionManager/NextRelease", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Build.PL", "Changes", "Makefile.PL" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/post-release commit", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.40.0", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.49" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ], "version" : "0.049" } }, "name" : "@Author::ETHER/install release", "version" : "0.049" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1, "version" : "0.049" } }, "name" : "@Author::ETHER/release complete", "version" : "0.049" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/prereqs for @Author::ETHER", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FileFinder::Filter", "name" : "no_sql_files", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.030" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.016" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.030" } }, "x_authority" : "cpan:ADAMK", "x_contributors" : [ "Adam Kennedy ", "Karen Etheridge ", "Ahmad M. Zawawi ", "Mirko Westermeier ", "Alexandr Ciornii ", "Graham Knop ", "gregor herrmann ", "Michael Lang " ], "x_generated_by_perl" : "v5.39.1", "x_serialization_backend" : "Cpanel::JSON::XS version 4.37", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_use_unsafe_inc" : 0 } ORLite-2.00/dist.ini000640 000766 000024 00000001063 14470240452 014506 0ustar00etherstaff000000 000000 name = ORLite author = Adam Kennedy copyright_holder = Adam Kennedy copyright_year = 2008 license = Perl_5 [@Author::ETHER] :version = 0.160 authority = cpan:ADAMK installer = MakeMaker -remove = PodWeaver MakeMaker.default_jobs = 1 MinimumPerl.test_finder = no_sql_files Test::MinimumVersion.max_target_perl = 5.008 ; use utf8 -remove = Test::EOL -remove = Test::NoTabs -remove = Test::PodSpelling -remove = PodCoverageTests [FileFinder::Filter / no_sql_files] finder = :TestFiles skip = \.sql ORLite-2.00/lib/ORLite.pm000640 000766 000024 00000137677 14470240452 015331 0ustar00etherstaff000000 000000 package ORLite; # git description: v1.99-6-gde873f7 # See POD at end of file for documentation use 5.006; use strict; use Carp (); use File::Spec 0.80 (); use File::Path 2.08 (); use File::Basename (); use Params::Util 1.00 (); use DBI 1.607 (); use DBD::SQLite 1.27 (); our $VERSION = '2.00'; # Support for the 'prune' option my @PRUNE = (); END { foreach ( reverse @PRUNE ) { next unless -e $_; require File::Remove; File::Remove::remove( \1, $_ ); } } ##################################################################### # Code Generation sub import { my $class = ref($_[0]) || $_[0]; # Check for debug mode my $DEBUG = 0; if ( defined Params::Util::_STRING($_[-1]) and $_[-1] eq '-DEBUG' ) { $DEBUG = 1; pop @_; } # Check params and apply defaults my %params = ( # Simple defaults here, complex defaults later package => scalar(caller), create => 0, cleanup => '', array => 0, xsaccessor => 0, shim => 0, tables => 1, views => 0, unicode => 0, ); if ( defined Params::Util::_STRING($_[1]) ) { # Support the short form "use ORLite 'db.sqlite'" $params{file} = $_[1]; } elsif ( Params::Util::_HASHLIKE($_[1]) ) { %params = ( %params, %{$_[1]} ); } else { Carp::croak("Missing, empty or invalid params HASH"); } unless ( defined Params::Util::_STRING($params{file}) and ( $params{create} or -f $params{file} ) ) { Carp::croak("Missing or invalid file param"); } unless ( defined $params{readonly} ) { $params{readonly} = $params{create} ? 0 : ! -w $params{file}; } unless ( Params::Util::_CLASS($params{package}) ) { Carp::croak("Missing or invalid package class"); } # Check caching params my $cached = undef; my $pkg = $params{package}; if ( defined $params{cache} ) { # Caching is illogical or invalid in some situations if ( $params{prune} ) { Carp::croak("Cannot set a 'cache' directory while 'prune' enabled"); } unless ( $params{user_version} ) { Carp::croak("Cannot set a 'cache' directory without 'user_version'"); } # To make the caching work, the version be defined before ORLite is called. no strict 'refs'; unless ( ${"$pkg\::VERSION"} ) { Carp::croak("Cannot set a 'cache' directory without a package \$VERSION"); } # Build the cache file from the super path using an inlined Class::ISA my @queue = ( $class ); my %seen = ( $pkg => 1 ); my @parts = ( $pkg => ${"$pkg\::VERSION"} ); while ( @queue ) { my $c = Params::Util::_STRING(shift @queue) or next; push @parts, $c => ${"$c\::VERSION"}; unshift @queue, grep { not $seen{$c}++ } @{"$c\::ISA"}; } $cached = join '-', @parts, user_version => $params{user_version}; $cached =~ s/[:.-]+/-/g; $cached = File::Spec->rel2abs( File::Spec->catfile( $params{cache}, "$cached.pm" ) ); } # Create the parent directory if needed my $file = File::Spec->rel2abs($params{file}); my $created = ! -f $params{file}; if ( $created ) { my $dir = File::Basename::dirname($file); unless ( -d $dir ) { my @dirs = File::Path::mkpath( $dir, { verbose => 0 } ); $class->prune(@dirs) if $params{prune}; } $class->prune($file) if $params{prune}; } # Connect to the database my $dsn = "dbi:SQLite:$file"; my $dbh = DBI->connect( $dsn, undef, undef, { PrintError => 0, RaiseError => 1, ReadOnly => $params{create} ? 0 : 1, $params{unicode} ? ( sqlite_unicode => 1 ) : ( ), } ); # Schema custom creation support if ( $created and Params::Util::_CODELIKE($params{create}) ) { $params{create}->($dbh); } # Check the schema version before generating my $user_version = $dbh->selectrow_arrayref('pragma user_version')->[0]; if ( exists $params{user_version} and $user_version != $params{user_version} ) { Carp::croak("Schema user_version mismatch (got $user_version, wanted $params{user_version})"); } # If caching and the cached version exists, load and shortcut. # Don't try to catch exceptions, just let them blow up. if ( $cached and -f $cached ) { $dbh->disconnect; require $cached; return 1; } # Prepare to generate code my $cleanup = $params{cleanup}; my $readonly = $params{readonly} ? "\n\t\tReadOnly => 1," : ''; my $unicode = $params{unicode} ? "\n\t\tsqlite_unicode => 1," : ''; my $version = $unicode ? '5.008005' : '5.006'; # Generate the support package code my $code = <<"END_PERL"; package $pkg; use $version; use strict; use Carp (); use DBI 1.607 (); use DBD::SQLite 1.27 (); my \$DBH = undef; sub orlite { '$VERSION' } sub sqlite { '$file' } sub dsn { '$dsn' } sub dbh { \$DBH or \$_[0]->connect; } sub connect { DBI->connect( \$_[0]->dsn, undef, undef, { PrintError => 0, RaiseError => 1,$readonly$unicode } ); } sub connected { defined \$DBH; } sub prepare { shift->dbh->prepare(\@_); } sub do { shift->dbh->do(\@_); } sub selectall_arrayref { shift->dbh->selectall_arrayref(\@_); } sub selectall_hashref { shift->dbh->selectall_hashref(\@_); } sub selectcol_arrayref { shift->dbh->selectcol_arrayref(\@_); } sub selectrow_array { shift->dbh->selectrow_array(\@_); } sub selectrow_arrayref { shift->dbh->selectrow_arrayref(\@_); } sub selectrow_hashref { shift->dbh->selectrow_hashref(\@_); } sub pragma { \$_[0]->do("pragma \$_[1] = \$_[2]") if \@_ > 2; \$_[0]->selectrow_arrayref("pragma \$_[1]")->[0] if defined wantarray; } sub iterate { my \$class = shift; my \$call = pop; my \$sth = \$class->prepare(shift); \$sth->execute(\@_); while ( \$_ = \$sth->fetchrow_arrayref ) { \$call->() or return 1;; } } sub begin { \$DBH or \$DBH = \$_[0]->connect; \$DBH->begin_work; } sub rollback { \$DBH or return 1; \$DBH->rollback; \$DBH->disconnect; undef \$DBH; return 1; } sub rollback_begin { if ( \$DBH ) { \$DBH->rollback; \$DBH->begin_work; } else { \$_[0]->begin; } return 1; } END_PERL # If you are a read-write database, we even allow you # to commit your transactions. $code .= <<"END_PERL" unless $readonly; sub commit { \$DBH or return 1; \$DBH->commit; \$DBH->disconnect; undef \$DBH; return 1; } sub commit_begin { if ( \$DBH ) { \$DBH->commit; \$DBH->begin_work; } else { \$_[0]->begin; } return 1; } END_PERL # Cleanup and shutdown operations if ( $cleanup ) { $code .= <<"END_PERL"; END { if ( \$DBH ) { \$DBH->rollback; \$DBH->do('$cleanup'); \$DBH->disconnect; undef \$DBH; } else { $pkg->do('$cleanup'); } } END_PERL } else { $code .= <<"END_PERL"; END { $pkg->rollback if \$DBH; } END_PERL } # Optionally generate the table classes my $tables = undef; if ( $params{tables} ) { # Capture the raw schema table information $tables = $dbh->selectall_arrayref( 'select * from sqlite_master where name not like ? and type in ( ?, ? )', { Slice => {} }, 'sqlite_%', 'table', 'view', ); # Capture the raw schema information and do first-pass work foreach my $t ( @$tables ) { # Convenience pre-quoted form of the table name $t->{qname} = $dbh->quote_identifier(undef, undef, $t->{name}); # What will be the class for this table $t->{class} = $t->{name}; if ( $t->{class} ne lc $t->{class} ) { $t->{class} =~ s/([a-z])([A-Z])/${1}_${2}/g; $t->{class} =~ s/_+/_/g; } $t->{class} = ucfirst lc $t->{class}; $t->{class} =~ s/_([a-z])/uc($1)/ge; $t->{class} = "${pkg}::$t->{class}"; # Load the structural column list my $columns = $t->{columns} = $dbh->selectall_arrayref( "pragma table_info('$t->{name}')", { Slice => {} }, ); # The list of columns we will select, which can # be different to the general list. my $select = $t->{select} = [ @$columns ]; # Track array vs hash implementation on a per-table # basis so that we can force views to always be done # array-wise (to compensate for some weird SQLite # column quoting differences between tables and views $t->{array} = $params{array}; if ( $t->{type} eq 'view' ) { $t->{array} = 1; } # Track usage of rowid on a per-table basis because # views don't always support rowid. $t->{rowid} = $t->{type} eq 'table'; foreach my $c ( @$select ) { # Convenience escaping for the column names $c->{qname} = $dbh->quote_identifier($c->{name}); # Affinity detection if ( $c->{type} =~ /INT/i ) { $c->{affinity} = 'INTEGER'; } elsif ( $c->{type} =~ /(?:CHAR|CLOB|TEXT)/i ) { $c->{affinity} = 'TEXT'; } elsif ( $c->{type} =~ /BLOB/i or not $c->{type} ) { $c->{affinity} = 'BLOB'; # Unicode currently breaks BLOB columns if ( $unicode ) { die "BLOB column $t->{name}.$c->{name} is not supported in unicode database"; } } elsif ( $c->{type} =~ /(?:REAL|FLOA|DOUB)/i ) { $c->{affinity} = 'REAL'; } else { $c->{affinity} = 'NUMERIC'; } } # Analyze the primary keys structure $t->{pk} = [ grep { $_->{pk} } @$columns ]; $t->{pkn} = scalar @{$t->{pk}}; if ( $t->{pkn} == 1 ) { $t->{pk1} = $t->{pk}->[0]; if ( $t->{pk1}->{affinity} eq 'INTEGER' ) { $t->{pki} = $t->{pk1}; } } if ( $t->{pki} ) { $t->{rowid} &&= $t->{pki}; if ( $t->{pki}->{name} eq $t->{name} . '_id' ) { $t->{id} = $t->{pki}; } } elsif ( $t->{rowid} ) { # Add rowid to the query $t->{rowid} = { cid => -1, name => 'rowid', qname => '"rowid"', type => 'integer', affinity => 'INTEGER', notnull => 1, dflt_value => undef, pk => 0, }; push @$select, $t->{rowid}; } # Do we allow object creation? $t->{create} = $t->{pkn}; $t->{create} = 1 if $t->{rowid}; $t->{create} = 0 if $readonly; # Generate the object keys for the columns if ( $t->{array} ) { foreach my $i ( 0 .. $#$select ) { $select->[$i]->{xs} = $i; $select->[$i]->{key} = "[$i]"; } } else { foreach my $c ( @$select ) { $c->{xs} = "'$c->{name}'"; $c->{key} = "{$c->{name}}"; } } # Generate the main SQL fragments $t->{sql_scols} = join ', ', map { $_->{qname} } @$select; $t->{sql_icols} = join ', ', map { $_->{qname} } @$columns; $t->{sql_ivals} = join ', ', ( '?' ) x scalar @$columns; $t->{sql_select} = "select $t->{sql_scols} from $t->{qname}"; $t->{sql_insert} = "insert into $t->{qname} " . "( $t->{sql_icols} ) " . "values ( $t->{sql_ivals} )"; $t->{sql_where} = join ' and ', map { "$_->{qname} = ?" } @{$t->{pk}}; # Generate the new Perl fragments $t->{pl_new} = join "\n", map { $t->{array} ? "\t\t\$attr{$_->{name}}," : "\t\t$_->{name} => \$attr{$_->{name}}," } @$columns; $t->{pl_insert} = join "\n", map { "\t\t\$self->$_->{key}," } @$columns; $t->{pl_fill} = ''; if ( $t->{pki} ) { $t->{pl_fill} = "\t\$self->$t->{pki}->{key} " . "= \$dbh->func('last_insert_rowid') " . "unless \$self->$t->{pki}->{key};"; } elsif ( $t->{rowid} ) { $t->{pl_fill} = "\t\$self->$t->{rowid}->{key} " . "= \$dbh->func('last_insert_rowid');"; } } # Generate the foreign key metadata my %tindex = map { $_->{name} => $_ } @$tables; foreach my $t ( @$tables ) { # Locate the foreign keys my %fk = (); my @fk_sql = $t->{sql} =~ /[(,]\s*(.+?REFERENCES.+?)\s*[,)]/g; # Extract the details foreach ( @fk_sql ) { unless ( /^(\w+).+?REFERENCES\s+(\w+)\s*\(\s*(\w+)/ ) { die "Invalid foreign key $_"; } $fk{"$1"} = [ "$2", $tindex{"$2"}, "$3" ]; } foreach ( @{$t->{columns}} ) { $_->{fk} = $fk{$_->{name}}; } # One final code fragment we need the fk for $t->{pl_accessor} = join "\n", map { "\t\t$_->{name} => $_->{xs}," } grep { ! $_->{fk} } @{$t->{columns}}; } # Generate the per-table code foreach my $t ( @$tables ) { my @select = @{$t->{select}}; my @columns = @{$t->{columns}}; my $slice = $t->{array} ? '{}' : '{ Slice => {} }'; # Generate the package header if ( $params{shim} ) { # Generate a shim-wrapper class $code .= <<"END_PERL"; package $t->{class}; \@$t->{class}::ISA = '$t->{class}::Shim'; package $t->{class}::Shim; END_PERL } else { # Plain vanilla package header $code .= <<"END_PERL"; package $t->{class}; END_PERL } # Generate the common elements for all classes $code .= <<"END_PERL"; sub base { '$pkg' } sub table { '$t->{name}' } sub table_info { $pkg->selectall_arrayref( "pragma table_info('$t->{name}')", { Slice => {} }, ); } sub select { my \$class = shift; my \$sql = '$t->{sql_select} '; \$sql .= shift if \@_; my \$rows = $pkg->selectall_arrayref( \$sql, $slice, \@_ ); bless \$_, '$t->{class}' foreach \@\$rows; wantarray ? \@\$rows : \$rows; } sub count { my \$class = shift; my \$sql = 'select count(*) from $t->{qname} '; \$sql .= shift if \@_; $pkg->selectrow_array( \$sql, {}, \@_ ); } END_PERL # Handle different versions, because arrayref acts funny if ( $t->{array} ) { $code .= <<"END_PERL"; sub iterate { my \$class = shift; my \$call = pop; my \$sql = '$t->{sql_select} '; \$sql .= shift if \@_; my \$sth = $pkg->prepare(\$sql); \$sth->execute(\@_); while ( \$_ = \$sth->fetchrow_arrayref ) { \$_ = bless [ \@\$_ ], '$t->{class}'; \$call->() or last; } \$sth->finish; } END_PERL } else { $code .= <<"END_PERL"; sub iterate { my \$class = shift; my \$call = pop; my \$sql = '$t->{sql_select} '; \$sql .= shift if \@_; my \$sth = $pkg->prepare(\$sql); \$sth->execute(\@_); while ( \$_ = \$sth->fetchrow_hashref ) { bless \$_, '$t->{class}'; \$call->() or last; } \$sth->finish; } END_PERL } # Add the primary key based single object loader if ( $t->{pkn} ) { if ( $t->{array} ) { $code .= <<"END_PERL"; sub load { my \$class = shift; my \@row = $pkg->selectrow_array( '$t->{sql_select} where $t->{sql_where}', undef, \@_, ); unless ( \@row ) { Carp::croak("$t->{class} row does not exist"); } bless \\\@row, '$t->{class}'; } END_PERL } else { $code .= <<"END_PERL"; sub load { my \$class = shift; my \$row = $pkg->selectrow_hashref( '$t->{sql_select} where $t->{sql_where}', undef, \@_, ); unless ( \$row ) { Carp::croak("$t->{class} row does not exist"); } bless \$row, '$t->{class}'; } END_PERL } } # Generate the elements for tables with primary keys if ( $t->{create} ) { my $l = $t->{array} ? '[' : '{'; my $r = $t->{array} ? ']' : '}'; my $set = $t->{array} ? '$self->set( $_ => $set{$_} ) foreach keys %set;' : '$self->{$_} = $set{$_} foreach keys %set;'; $code .= <<"END_PERL"; sub new { my \$class = shift; my \%attr = \@_; bless $l $t->{pl_new} $r, \$class; } sub create { shift->new(\@_)->insert; } sub insert { my \$self = shift; my \$dbh = $pkg->dbh; \$dbh->do( '$t->{sql_insert}', {}, $t->{pl_insert} ); $t->{pl_fill} return \$self; } sub update { my \$self = shift; my \%set = \@_; my \$rows = $pkg->do( 'update $t->{qname} set ' . join( ', ', map { "\\"\$_\\" = ?" } keys \%set ) . ' where "rowid" = ?', {}, values \%set, \$self->rowid, ); unless ( \$rows == 1 ) { Carp::croak("Expected to update 1 row, actually updated \$rows"); } $set return 1; } sub delete { return $pkg->do( 'delete from $t->{qname} where "rowid" = ?', {}, shift->rowid, ) if ref \$_[0]; Carp::croak("Static $pkg->delete has been deprecated"); } sub delete_where { shift; $pkg->do('delete from $t->{qname} where ' . shift, {}, \@_); } sub truncate { $pkg->do('delete from $t->{qname}'); } END_PERL } if ( $t->{create} and $t->{array} ) { # Add an additional set method to avoid having # the user have to enter manual positions. $code .= <<"END_PERL"; sub set { my \$self = shift; my \$i = { $t->{pl_accessor} }->{\$_[0]}; Carp::croak("Bad name '\$_[0]'") unless defined \$i; \$self->[\$i] = \$_[1]; } END_PERL } # Generate the boring accessors if ( $params{xsaccessor} ) { my $type = $t->{create} ? 'accessors' : 'getters'; my $xsclass = $t->{array} ? 'Class::XSAccessor::Array' : 'Class::XSAccessor'; my $id = $t->{id} ? "\t\t$t->{id}->{name} => $t->{id}->{xs},\n" : ''; my $rowid = ($t->{id} and $t->{rowid}) ? "\t\t$t->{rowid}->{name} => $t->{rowid}->{xs},\n" : ''; $code .= <<"END_PERL"; use $xsclass 1.05 { getters => { ${rowid}${id}$t->{pl_accessor} }, }; END_PERL } else { if ( $t->{pki} and $t->{rowid} ) { $code .= <<"END_PERL"; sub rowid { \$_[0]->$t->{rowid}->{key}; } END_PERL } if ( $t->{id} ) { $code .= <<"END_PERL"; sub id { \$_[0]->$t->{id}->{key}; } END_PERL } $code .= join "\n\n", map { <<"END_PERL" } grep { ! $_->{fk} } @select; sub $_->{name} { \$_[0]->$_->{key}; } END_PERL } # Generate the foreign key accessors $code .= join "\n\n", map { <<"END_PERL" } grep { $_->{fk} } @columns; sub $_->{name} { ($_->{fk}->[1]->{class}\->select('where \"$_->{fk}->[1]->{pk}->[0]->{name}\" = ?', \$_[0]->$_->{key}))[0]; } END_PERL } } # We are finished with the database $dbh->disconnect; # Start the post-table content again $code .= "\npackage $pkg;\n" if $params{tables}; # Append any custom code for the user $code .= "\n$params{append}" if defined $params{append}; # Load the overload classes for each of the tables if ( $tables ) { $code .= join( "\n", "local \$@ = undef;", map { "eval { require $_->{class} };" } @$tables ); } # End the class normally $code .= "\n\n1;\n"; # Save to the cache location if caching is enabled if ( $cached ) { my $dir = File::Basename::dirname($cached); unless ( -d $dir ) { File::Path::mkpath( $dir, { verbose => 0 } ); } # Save a copy of the code to the file local *FILE; open( FILE, ">$cached" ) or Carp::croak("open($cached): $!"); print FILE $code; close FILE; } # Compile the code local $@; if ( $^P and $^V >= 5.008009 ) { local $^P = $^P | 0x800; eval($code); die $@ if $@; } elsif ( $DEBUG ) { dval($code); } else { eval($code); die $@ if $@; } return 1; } sub dval { # Write the code to the temp file require File::Temp; my ($fh, $filename) = File::Temp::tempfile(); $fh->print($_[0]); close $fh; require $filename; unlink $filename; # Print the debugging output # my @trace = map { # s/\s*[{;]$//; # s/^s/ s/; # s/^p/\np/; # "$_\n" # } grep { # /^(?:package|sub)\b/ # } split /\n/, $_[0]; # print STDERR @trace, "\nCode saved as $filename\n\n"; return 1; } sub prune { my $class = shift; push @PRUNE, map { File::Spec->rel2abs($_) } @_; } 1; __END__ =pod =head1 NAME ORLite - Extremely light weight SQLite-specific ORM =head1 SYNOPSIS package Foo; # Simplest possible usage use strict; use ORLite 'data/sqlite.db'; my @awesome = Foo::Person->select( 'where first_name = ?', 'Adam', ); package Bar; # All available options enabled or specified. # Some options shown are mutually exclusive, # this code would not actually run. use ORLite { package => 'My::ORM', file => 'data/sqlite.db', user_version => 12, readonly => 1, create => sub { my $dbh = shift; $dbh->do('CREATE TABLE foo ( bar TEXT NOT NULL )'); }, tables => [ 'table1', 'table2' ], cleanup => 'VACUUM', prune => 1, }; =head1 DESCRIPTION L is a light single file SQL database that provides an excellent platform for embedded storage of structured data. However, while it is superficially similar to a regular server-side SQL database, SQLite has some significant attributes that make using it like a traditional database difficult. For example, SQLite is extremely fast to connect to compared to server databases (1000 connections per second is not unknown) and is particularly bad at concurrency, as it can only lock transactions at a database-wide level. This role as a superfast internal data store can clash with the roles and designs of traditional object-relational modules like L or L. What this situation would seem to need is an object-relation system that is designed specifically for SQLite and is aligned with its idiosyncracies. ORLite is an object-relation system specifically tailored for SQLite that follows many of the same principles as the ::Tiny series of modules and has a design and feature set that aligns directly to the capabilities of SQLite. Further documentation will be available at a later time, but the synopsis gives a pretty good idea of how it works. =head2 How ORLite Works ORLite discovers the schema of a SQLite database, and then generates the code for a complete set of classes that let you work with the objects stored in that database. In the simplest form, your target root package "uses" ORLite, which will do the schema discovery and code generation at compile-time. When called, ORLite generates two types of packages. Firstly, it builds database connectivity, transaction support, and other purely database level functionality into your root namespace. Secondly, it will create one sub-package underneath the namespace of the root module for each table or view it finds in the database. Once the basic table support has been generated, it will also try to load an "overlay" module of the same name. Thus, by created a Foo::TableName module on disk containing "extra" code, you can extend the original and add additional functionality to it. =head1 OPTIONS ORLite takes a set of options for the class construction at compile time as a HASH parameter to the "use" line. As a convenience, you can pass just the name of an existing SQLite file to load, and ORLite will apply defaults to all other options. # The following are equivalent use ORLite $filename; use ORLite { file => $filename, }; The behaviour of each of the options is as follows: =head2 package The optional C parameter is used to provide the Perl root namespace to generate the code for. This class does not need to exist as a module on disk, nor does it need to have anything loaded or in the namespace. By default, the package used is the package that is calling ORLite's import method (typically via the C line). =head2 file The compulsory C parameter (the only compulsory parameter) provides the path to the SQLite file to use for the ORM class tree. If the file already exists, it must be a valid SQLite file match that supported by the version of L that is installed on your system. L will throw an exception if the file does not exist, B you also provide the C option to signal that L should create a new SQLite file on demand. If the C option is provided, the path provided must be creatable. When creating the database, L will also create any missing directories as needed. =head2 user_version When working with ORLite, the biggest risk to the stability of your code is often the reliability of the SQLite schema structure over time. When the database schema changes the code generated by ORLite will also change. This can easily result in an unexpected change in the API of your class tree, breaking the code that sits on top of those generated APIs. To resolve this, L supports a feature called schema version-locking. Via the C SQLite pragma, you can set a revision for your database schema, increasing the number each time to make a non-trivial chance to your schema. SQLite> PRAGMA user_version = 7 When creating your L package, you should specificy this schema version number via the C option. use ORLite { file => $filename, user_version => 7, }; When connecting to the SQLite database, the C you provide will be checked against the version in the schema. If the versions do not match, then the schema has unexpectedly changed, and the code that is generated by L would be different to the expected API. Rather than risk potentially destructive errors caused by the changing code, L will simply refuse to run and throw an exception. Thus, using the C feature allows you to write code against a SQLite database with high-certainty that it will continue to work. Or at the very least, that should the SQLite schema change in the future your code fill fail quickly and safely instead of running away and causing unknown behaviour. By default, the C option is false and the value of the SQLite C will B be checked. =head2 readonly To conserve memory and reduce complexity, L will generate the API differently based on the writability of the SQLite database. Features like transaction support and methods that result in C, C and C queries will only be added if they can actually be run, resulting in an immediate "no such method" exception at the Perl level instead of letting the application do more work only to hit an inevitable SQLite error. By default, the C option is based on the filesystem permissions of the SQLite database (which matches SQLite's own writability behaviour). However the C option can be explicitly provided if you wish. Generally you would do this if you are working with a read-write database, but you only plan to read from it. Forcing C to true will halve the size of the code that is generated to produce your ORM, reducing the size of any auto-generated API documentation using L by a similar amount. It also ensures that this process will only take shared read locks on the database (preventing the chance of creating a dead-lock on the SQLite database). =head2 create The C option is used to expand L beyond just consuming other people's databases to produce and operating on databases user the direct control of your code. The C option supports two alternative forms. If C is set to a simple true value, an empty SQLite file will be created if the location provided in the C option does not exist. If C is set to a C reference, this function will be executed on the new database B L attempts to scan the schema. The C reference will be passed a plain L connection handle, which you should operate on normally. Note that because C is fired before the code generation phase, none of the functionality produced by the generated classes is available during the execution of the C code. The use of C option is incompatible with the C option. =head2 tables The C option should be a reference to an array containing a list of table names. For large or complex SQLite databases where you only need to make use of a fraction of the schema limiting the set of tables will reduce both the startup time needed to scan the structure of the SQLite schema, and reduce the memory cost of the class tree. If the C option is not provided, L will attempt to produce a class for every table in the main schema that is not prefixed with with C. =head2 cache use ORLite { file => 'dbi:SQLite:sqlite.db', user_version => 2, cache => 'cache/directory', }; The C option is used to reduce the time needed to scan the SQLite database table structures and generate the code for them, by saving the generated code to a cache directory and loading from that file instead of generating it each time from scratch. =head2 cleanup When working with embedded SQLite databases containing rapidly changing state data, it is important for database performance and general health to make sure you VACUUM or ANALYZE the database regularly. The C option should be a single literal SQL statement. If provided, this statement will be automatically run on the database during C-time, after the last transaction has been completed. This will typically either by a full C<'VACUUM; ANALYZE'> or the more simple C<'VACUUM'>. =head2 prune In some situation, such as during test scripts, an application will only need the created SQLite database temporarily. In these situations, the C option can be provided to instruct L to delete the SQLite database when the program ends. If any directories were made in order to create the SQLite file, these directories will be cleaned up and removed as well. If C is enabled, you should generally not use C as any cleanup operation will be made pointless when C deletes the file. By default, the C option is set to false. =head2 shim In some situtations you may wish to make extensive changes to the behaviour of the classes and methods generated by ORLite. Under normal circumstances all code is generated into the table class directly, which can make overriding method difficult. The C option will make ORLite generate all of it's methods into a seperate C class, and leave the main table class C as a transparent subclass of the shim. This allows you to alter the behaviour of a table class without having to do nasty tricks with symbol tables in order to alter or replace methods. package My::Person; # Write a log message when we create a new object sub create { my $class = shift; my $self = SUPER::create(@_); my $name = $self->name; print LOG "Created new person '$name'\n"; return $self; } The C option is global. It will alter the structure of all table classes at once. However, unless you are making alterations to a class the impact of this different class structure should be zero. =head2 unicode You can use this option to tell L that your database uses unicode. At the moment, it just enables the C option while connecting to your database. There'll be more in the future. =head1 ROOT PACKAGE METHODS All ORLite root packages receive an identical set of methods for controlling connections to the database, transactions, and the issueing of queries of various types to the database. The example root package Foo::Bar is used in any examples. All methods are static, ORLite does not allow the creation of a Foo::Bar object (although you may wish to add this capability yourself). =head2 dsn my $string = Foo::Bar->dsn; The C accessor returns the dbi connection string used to connect to the SQLite database as a string. =head2 dbh my $handle = Foo::Bar->dbh; To reliably prevent potential SQLite deadlocks resulting from multiple connections in a single process, each ORLite package will only ever maintain a single connection to the database. During a transaction, this will be the same (cached) database handle. Although in most situations you should not need a direct DBI connection handle, the C method provides a method for getting a direct connection in a way that is compatible with ORLite's connection management. Please note that these connections should be short-lived, you should never hold onto a connection beyond the immediate scope. The transaction system in ORLite is specifically designed so that code using the database should never have to know whether or not it is in a transation. Because of this, you should B call the -Edisconnect method on the database handles yourself, as the handle may be that of a currently running transaction. Further, you should do your own transaction management on a handle provided by the method. In cases where there are extreme needs, and you B have to violate these connection handling rules, you should create your own completely manual DBI-Econnect call to the database, using the connect string provided by the C method. The C method returns a L object, or throws an exception on error. =head2 connect my $dbh = Foo::Bar->connect; The C method is provided for the (extremely rare) situation in which you need a raw connection to the database, evading the normal tracking and management provided of the ORM. The use of raw connections in this manner is strongly discouraged, as you can create fatal deadlocks in SQLite if either the core ORM or the raw connection uses a transaction at any time. To summarise, do not use this method unless you B know what you are doing. B =head2 connected my $active = Foo::Bar->connected; The C method provides introspection of the connection status of the library. It returns true if there is any connection or transaction open to the database, or false otherwise. =head2 begin Foo::Bar->begin; The C method indicates the start of a transaction. In the same way that ORLite allows only a single connection, likewise it allows only a single application-wide transaction. No indication is given as to whether you are currently in a transaction or not, all code should be written neutrally so that it works either way or doesn't need to care. Returns true or throws an exception on error. While transaction support is always built for every L-generated class tree, if the database is opened C the C method will not exist at all in the API, and your only way of ending the transaction (and the resulting persistent connection) will be C. =head2 commit Foo::Bar->commit; The C method commits the current transaction. If called outside of a current transaction, it is accepted and treated as a null operation. Once the commit has been completed, the database connection falls back into auto-commit state. If you wish to immediately start another transaction, you will need to issue a separate -Ebegin call. Returns true or throws an exception on error. =head2 commit_begin Foo::Bar->begin; # Code for the first transaction... Foo::Bar->commit_begin; # Code for the last transaction... Foo::Bar->commit; By default, L-generated code uses opportunistic connections. Every you call results in a fresh L C, and a C occurs after query processing and before the data is returned. Connections are B held open indefinitely during a transaction, with an immediate C after your C. This makes ORLite very easy to use in an ad-hoc manner, but can have performance implications. While SQLite itself can handle 1000 connections per second, the repeated destruction and repopulation of SQLite's data page caches between your statements (or between transactions) can slow things down dramatically. The C method is used to C the current transaction and immediately start a new transaction, without disconnecting from the database. Its exception behaviour and return value is identical to that of a plain C call. =head2 do Foo::Bar->do( 'insert into table (foo, bar) values (?, ?)', {}, $foo_value, $bar_value, ); The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 selectall_arrayref The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 selectall_hashref The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 selectcol_arrayref The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 selectrow_array The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 selectrow_arrayref The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 selectrow_hashref The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction. It takes the same parameters and has the same return values and error behaviour. =head2 prepare The C method is a direct wrapper around the equivalent L method, but applied to the appropriate locally-provided connection or transaction It takes the same parameters and has the same return values and error behaviour. In general though, you should try to avoid the use of your own prepared statements if possible, although this is only a recommendation and by no means prohibited. =head2 pragma # Get the user_version for the schema my $version = Foo::Bar->pragma('user_version'); The C method provides a convenient method for fetching a pragma for a datase. See the SQLite documentation for more details. =head1 TABLE PACKAGE METHODS When you use ORLite, your database tables will be available as objects named in a camel-cased fashion. So, if your model name is Foo::Bar... use ORLite { package => 'Foo::Bar', file => 'data/sqlite.db', }; ... then a table named 'user' would be accessed as C, while a table named 'user_data' would become C. =head2 base my $namespace = Foo::Bar::User->base; # Returns 'Foo::Bar' Normally you will only need to work directly with a table class, and only with one ORLite package. However, if for some reason you need to work with multiple ORLite packages at the same time without hardcoding the root namespace all the time, you can determine the root namespace from an object or table class with the C method. =head2 table print Foo::Bar::UserData->table; # 'user_data' While you should not need the name of table for any simple operations, from time to time you may need it programatically. If you do need it, you can use the C method to get the table name. =head2 table_info # List the columns in the underlying table my $columns = Foo::Bar::User->table_info; foreach my $c ( @$columns ) { print "Column $c->{name} $c->{type}"; print " not null" if $c->{notnull}; print " default $c->{dflt_value}" if defined $c->{dflt_value}; print " primary key" if $c->{pk}; print "\n"; } The C method is a wrapper around the SQLite C pragma, and provides simplified access to the column metadata for the underlying table should you need it for some advanced function that needs direct access to the column list. Returns a reference to an C containing a list of columns, where each column is a reference to a C with the keys C, C, C, C, C and C. =head2 new my $user = Foo::Bar::User->new( name => 'Your Name', age => 23, ); The C constructor creates an anonymous object, without reading or writing it to the database. It also won't do validation of any kind, since ORLite is designed for use with embedded databases and presumes that you know what you are doing. =head2 insert my $user = Foo::Bar::User->new( name => 'Your Name', age => 23, )->insert; The C method takes an existing anonymous object and inserts it into the database, returning the object back as a convenience. It provides the second half of the slower manual two-phase object construction process. If the table has an auto-incrementing primary key (and you have not provided a value for it yourself) the identifier for the new record will be fetched back from the database and set in your object. my $object = Foo::Bar::User->new( name => 'Foo' )->insert; print "Created new user with id " . $user->id . "\n"; =head2 create my $user = Foo::Bar::User->create( name => 'Your Name', age => 23, ); While the C + C methods are useful when you need to do interesting constructor mechanisms, for most situations you already have all the attributes ready and just want to create and insert the record in a single step. The C method provides this shorthand mechanism and is just the functional equivalent of the following. sub create { shift->new(@_)->insert; } It returns the newly created object after it has been inserted. =head2 load my $user = Foo::Bar::User->load( $id ); If your table has single column primary key, a C method will be generated in the class. If there is no primary key, the method is not created. The C method provides a shortcut mechanism for fetching a single object based on the value of the primary key. However it should only be used for cases where your code trusts the record to already exists. It returns a C object, or throws an exception if the object does not exist. =head2 id The C accessor is a convenience method that is added to your table class to increase the readability of your code when ORLite detects certain patterns of column naming. For example, take the following definition where convention is that all primary keys are the table name followed by "_id". create table foo_bar ( foo_bar_id integer not null primary key, name string not null, ) When ORLite detects the use of this pattern, and as long as the table does not have an "id" column, the additional C accessor will be added to your class, making these expressions equivalent both in function and performance. my $foo_bar = My::FooBar->create( name => 'Hello' ); # Column name accessor $foo_bar->foo_bar_id; # Convenience id accessor $foo_bar->id; As you can see, the latter involves much less repetition and reads much more cleanly. =head2 select my @users = Foo::Bar::User->select; my $users = Foo::Bar::User->select( 'where name = ?', @args ); The C provides only the thinnest of layers around pure SQL (it merely generates the "SELECT ... FROM table_name") you are free to use anything you wish in your query, including subselects and function calls. If called without any arguments, it will return all rows of the table in the natural sort order of SQLite. =head2 iterate Foo::Bar::User->iterate( sub { print $_->name . "\n"; } ); The C method enables the processing of large tables one record at a time without loading having to them all into memory in advance. This plays well to the strength of SQLite, allowing it to do the work of loading arbitrarily large stream of records from disk while retaining the full power of Perl when processing the records. The last argument to C must be a subroutine reference that will be called for each element in the list, with the object provided in the topic variable C<$_>. This makes the C code fragment above functionally equivalent to the following, except with an O(1) memory cost instead of O(n). foreach ( Foo::Bar::User->select ) { print $_->name . "\n"; } You can filter the list via SQL in the same way you can with C method. =head2 delete # Delete a single object from the database $user->delete; # Delete a range of rows from the database Foo::Bar::User->delete( 'where age <= ?', 13 ); The C method will delete the single row representing an object, based on the primary key or SQLite rowid of that object. The object that you delete will be left intact and untouched, and you remain free to do with it whatever you wish. =head2 delete_where # Delete a range of rows from the database Foo::Bar::User->delete( 'age <= ?', 13 ); The C static method allows the delete of large numbers of rows from a database while protecting against accidentally doing a boundless delete (the C method is provided specifically for this purpose). It takes the same parameters for deleting as the C