diff options
351 files changed, 6628 insertions, 6391 deletions
diff --git a/odb-examples/GPLv2 b/GPLv2 index 3912109..3912109 100644 --- a/odb-examples/GPLv2 +++ b/GPLv2 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), 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 prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + 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 the public, 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 +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program 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, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. @@ -1,4 +1,9 @@ -Copyright (c) 2005-2024 Code Synthesis. +Copyright (c) 2005-2025 Code Synthesis. + +For more information on ODB licensing as well as for answers to some of the +common licensing questions, visit the ODB License page: + +http://www.codesynthesis.com/products/odb/license.xhtml The individual ODB components are licensed as follows (see the LICENSE file in each package for the exact terms and conditions): @@ -19,6 +24,8 @@ libodb-mssql Non-Commercial Use and Evaluation License (NCUEL) or Commercial Proprietary License (CPL) -odb-tests odb-example + Not copyrighted - public domain (UNLICENSE) + +odb-tests GPL-2.0-only @@ -0,0 +1,294 @@ + ODB NON-COMMERCIAL USE AND EVALUATION LICENSE (NCUEL) + +INTENT + +The intent of this license is to allow you to use ODB with commercial +databases, such as Oracle, Microsoft SQL Server, IBM DB/2, etc., free +of charge non-commercially or for evaluation. + +Furthermore, if a commercial database has a free edition, often called +express edition, such as Oracle Express, Microsoft SQL Server Express, +IBM DB/2 Express-C, etc., that can be used for commercial purposes free +of charge, then this license allows you to use ODB with such an edition +for commercial purposes also free of charge. + +Note also that the development of an application that will be used for +commercial purposes constitutes a commercial use and is not allowed, +except with a free edition of a commercial database. However, this +license allows you to evaluate ODB; that is, to use the Software for +a reasonable period for the purpose of determining its suitability for +a particular application as well as to conduct exploratory development +or proof-of-concept prototyping. + +Finally, any application that uses ODB under this license, whether non- +commercially, for evaluation, or commercially with a free edition of a +database, is subject to the terms and conditions similar to that of the +GPL version 2. In particular, this means that if and when you distribute +your application, you are required to also release its source code. + +If you have any questions concerning this License, please contact us at: +info@codesynthesis.com. + +LEGAL TERMS AND CONDITIONS + +This Code Synthesis Non-Commercial Use and Evaluation License +Agreement for ODB Software ("License") is a legal agreement between +you, the Licensee, (either an individual or a single entity) and Code +Synthesis for non-commercially using, copying, distributing and +modifying the Software and any work derived from the Software, as +defined hereinbelow. Any commercial use, except as expressly provided +in Section 2.1, is subject to a different license. + +By using, modifying, or distributing the Software or any work derived +from the Software, Licensee indicates acceptance of this License and +agrees to be bound by all its terms and conditions for using, copying, +distributing, or modifying the Software and works derived from the +Software. If Licensee is agreeing to this License on behalf of an entity +other than an individual person, Licensee represents that Licensee is +binding and have the right to bind the entity to the terms and conditions +of this agreement. + +These terms and conditions only apply to the ODB components that are +explicitly licensed under this License (normally ODB runtime libraries +for commercial databases). Other ODB components may be licensed under +other licenses and are not affected in any way by the terms and +conditions found in this License. Similarly, ODB components licensed +under this License are not affected by the terms and conditions found +in other licenses. If you are using several ODB components that are +licensed under different licenses, you must comply with the terms and +conditions of each such license. + +No rights are granted to the Software except as expressly set forth +herein. Nothing other than this License grants Licensee permission to +use, copy, distribute or modify the Software or any work derived from +the Software. Licensee may not use, copy, distribute or modify the +Software or any work derived from the Software except as expressly +provided under this License. If Licensee does not accept the terms and +conditions of this License, Licensee shall not use, copy, distribute +or modify the Software. + +In consideration for Licensee's forbearance of commercial use of the +Software, except as expressly provided in Section 2.1, Code Synthesis +grants Licensee non-exclusive, royalty-free and without fees rights +as expressly provided herein. + +1. DEFINITIONS. + +A "commercial database" is a database product that has associated +fees and/or royalties payable for production and/or commercial use +of the database product. Commercial databases include, but are not +limited to, Oracle, Microsoft SQL Server, and IBM DB/2. + +A "free edition of a commercial database" is a special, limited edition +of a commercial database, often called express edition, that does not +require fees and/or royalties for production and/or commercial use. +Free editions of commercial databases include, but are not limited to, +Oracle Express, Microsoft SQL Server Express, and IBM DB/2 Express-C. + +The "Software" is one of the ODB runtime libraries for one of the +commercial databases, including, but not limited to, demo programs, +associated media and printed materials, and any included "on-line" +documentation. + +A "work derived from the Software" is any derivative work as defined +in the copyright law of the nation or state where rights to the work +derived from the Software are exercisable; that is to say, a program +which is linked with or otherwise incorporates the ODB runtime library +or a translation, improvement, enhancement, extension or other +modification of the Software which has sufficient originality to +qualify in such a nation or state as a copyrightable work is a work +derived from the Software. + +To "use" means to execute (i.e. run) the Software. + +To "copy" means to create one or more copies of the Software. + +To "distribute" means to broadcast, publish, transfer, post, upload, +download or otherwise disseminate in any medium to any third party. + +To "modify" means to create a work derived from the Software. + +To "evaluate" means to use the Software for a reasonable period for +the purpose of determining its suitability for a particular application +as well as to conduct exploratory development or proof-of-concept +prototyping. + +A "commercial use" is: + +(1) the use of the Software or any work derived from the Software in +connection with, for or in aid of the generation of revenue, such as +in the conduct of Licensee's daily business operations; or + +(2) any copying, distribution or modification of the Software or any +work derived from the Software to any party where payment or other +consideration is made in connection with such copying, distribution or +modification, whether directly (as in payment for a copy of the +Software) or indirectly (including but not limited to payment for some +good or service related to the Software, or payment for some product +or service that includes a copy of the Software "without charge"). +However, the following actions which involve payment do not in and +of themselves constitute a commercial use: + +(a) posting the Software on a public access information storage and +retrieval service for which a fee is received for retrieving +information (such as an on-line service), provided that the fee is not +content-dependent. Such fees which are not content dependent include, +but are not limited to, fees which are based solely on the storage +capacity required to store the information, and fees which are based +solely on the time required to transfer the information from/to the +public access information storage and retrieval service; and + +(b) distributing the Software on a CD-ROM, provided that the Software +is reproduced entirely and verbatim on such CD-ROM, and provided further +that all information on such CD-ROM may be distributed in a manner which +does not constitute a commercial use. + +2. GRANT OF LICENSE. + +2.1. LICENSE TO USE. +Licensee may use the Software provided that such use does not constitute +a commercial use. + +Licensee may also use the Software commercially with a free edition of a +commercial database, if such an edition is available. If Licensee +distributes works derived from the Software and such works may be used +commercially by third parties, Licensee must cause such commercial use +to be limited to a free edition of a commercial database. + +2.2. LICENSE TO EVALUATE. +Licensee may evaluation the Software for commercial use. + +2.3. LICENSE TO COPY AND DISTRIBUTE. +Licensee may copy and distribute literal (i.e., verbatim) copies of the +Software as Licensee receives it throughout the world, in any medium, +provided that Licensee distributes an unmodified, easily-readable copy +of this License with the Software, and provided further that such +distribution does not constitute a commercial use. + +2.4. LICENSE TO CREATE WORKS DERIVED FROM THE SOFTWARE. +Licensee may create works derived from the Software, provided that any +such work derived from the Software carries prominent notices stating +both the manner in which Licensee has created a work derived from the +Software (for example, notices stating that the work derived from the +Software is linked with or otherwise incorporates the ODB runtime +library, or notices stating that the work derived from the Software +is an enhancement to the Software which Licensee has created) and the +date any such work derived from the Software was created. + +2.5. LICENSE TO COPY AND DISTRIBUTE WORKS DERIVED FROM THE SOFTWARE. +Licensee may copy and distribute works derived from the Software +throughout the world, provided that Licensee distributes an +unmodified, easily-readable copy of this License with such works +derived from the Software, and provided further that such distribution +does not constitute a commercial use. Licensee must cause any work +derived from the Software that Licensee distributes to be licensed as +a whole and at no charge to all third parties under the terms of this +License or another free/open source license that does not restrict any +rights of any third party that would have been granted should such work +have been licensed under this License. + +Any work derived from the Software must be accompanied by the complete +corresponding machine-readable source code of such work derived from +the Software, delivered on a medium customarily used for software +interchange. The source code for the work derived from the Software +means the preferred form of the work derived from the Software for +making modifications to it. For an executable work derived from the +Software, complete source code means all of the source code for all +modules of the work derived from the Software, all associated +interface definition files and all scripts used to control compilation +and installation of all or any part of the work derived from the +Software. However, the source code delivered need not include anything +that is normally distributed, in either source code or binary (object- +code) form, with major components (including but not limited to +compilers, linkers, and kernels) of the operating system on which the +executable work derived from the Software runs, unless that component +itself accompanies the executable code of the work derived from the +Software. + +Furthermore, if the executable code or object code of the work derived +from the Software may be copied from a designated place, and if the +source code of the work derived from the Software may be copied from +the same place, then the work derived from the Software shall be +construed as accompanied by the complete corresponding machine-readable +source code of such work derived from the Software, even though third +parties are not compelled to copy the source code along with the +executable code or object code. + +If the work derived from the Software normally reads commands +interactively when run, Licensee must cause the work derived from the +Software, at each time it commences operation, to print or display an +announcement including either a notice consisting of the verbatim +warranty and liability provisions of this License, or a notice that +Licensee, and not Code Synthesis provides a warranty. + +Licensee may not impose any further restrictions on the exercise of +the rights granted herein by any recipient of any work derived from +the Software. + +3. RESTRICTIONS. + +Licensee acknowledges that the Software is protected by copyright laws +and international copyright treaties, as well as other intellectual +property laws and treaties. The Software is licensed, not sold. All +title and copyrights in and to the Software are owned exclusively by +Code Synthesis. + +Licensee may not sublicense, assign or transfer this License, the +Software or any work derived from the Software except as permitted by +this License. + +Licensee is expressly prohibited from using, copying, distributing, +studying the source code, or otherwise examining the Software for +the purpose of reverse engineering or duplicating its functionality +(unless enforcement of this restrictions is prohibited by applicable +law). + +4. LIMITED WARRANTY. + +4.1 NO WARRANTIES. +CODE SYNTHESIS EXPRESSLY DISCLAIMS ANY WARRANTY FOR THE SOFTWARE. THE +SOFTWARE IS PROVIDED TO LICENSEE "AS IS," WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE USE, +QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH LICENSEE. SHOULD THE +SOFTWARE PROVE DEFECTIVE, LICENSEE ASSUMES THE COST OF ALL NECESSARY +SERVICING, REPAIR OR CORRECTION. + +4.2. NO LIABILITY FOR DAMAGES. +IN NO EVENT WILL CODE SYNTHESIS, OR ANY OTHER PARTY WHO MAY COPY, +DISTRIBUTE OR MODIFY THE SOFTWARE AS PERMITTED HEREIN, BE LIABLE FOR +ANY GENERAL, DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL +DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF +BUSINESS PROFITS, BUSINESS INTERRUPTION, INACCURATE INFORMATION, LOSS +OF INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR +INABILITY TO USE THE SOFTWARE, EVEN IF CODE SYNTHESIS OR SUCH OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +5. TERMINATION. + +Any violation or any attempt to violate any of the terms and conditions +of this License will automatically terminate Licensee's rights under +this License. Licensee further agrees upon such termination to cease +any and all using, copying, distributing and modifying of the Software +and any work derived from the Software, and further to destroy any and +all of Licensee's copies of the Software and any work derived from the +Software. + +However, parties who have received copies of the Software or copies of +any work derived from the Software, or rights, from Licensee under this +License will not have their licenses terminated so long as such parties +remain in full compliance with this License. + +6. LICENSE SCOPE AND MODIFICATION. + +This License sets forth the entire agreement between Licensee and Code +Synthesis and supersedes all prior agreements and understandings between +the parties relating to the subject matter hereof. None of the terms of +this License may be waived or modified except as expressly agreed in +writing by both Licensee and Code Synthesis. + +7. SEVERABILITY. + +Should any provision of this License be declared void or unenforceable, +the validity of the remaining provisions shall not be affected thereby. @@ -1,17 +1,31 @@ Version 2.5.0 + * Database classes are now move-constructible. This means they can be + returned by value from functions in C++11 and later. + * Support for mapping C++ types as other C++ types. For example: - #pragma db map type(bool) as(std::string) \ - to((?) ? "true" : "false") from((?) == "true") + #pragma db map type(bool) \ + as(std::string) \ + to((?) ? "true" : "false") \ + from((?) == "true") - @@ Ref to the manual. + See Section 14.8.1, "C++ Type Mapping Pragmas" in the ODB manual for + details. * Support for custom table definition options in addition to column definition options. For details, refer to Section 14.1.16, "options" in the ODB manual. - * Support for nested object ids. Now the 'id' pragma specifier can optionally + * New helper header, <odb/nested-container.hxx>, provides manual nested + container support. For details, see the container-nested example in + odb-examples. + + * New helper header, <odb/c-array-traits.hxx>, provides optional + mapping of C arrays as containers. Note that this mapping is not + enabled by default. See instructions inside the header for details. + + * Support for nested object ids. Now the `id` pragma specifier can optionally include the data member path to the id inside a composite value. For example: @@ -19,57 +33,36 @@ Version 2.5.0 std::pair<int, int> p; Note that one somewhat counter-intuitive aspect of this new feature is - that the whole member marked with id ('p' in the above example) and not - just the actual id member ('p.first' in the above example) is treated as - readonly. + that the whole member marked with id (`p` in the above example) and not + just the actual id member (p.first in the above example) is treated as + read-only. + + Such nested id also cannot be automatically assigned (that is, use the + `auto` specifier). - Such nested id also cannot be automatically assigned ('auto' specifier). + To match this support the `inverse` pragma specifier now also allows + nested data members. * Support for defining views as instantiations of C++ class templates, similar to objects and composite value types. - * Allow the use of object pointers as map keys. Also remove the restriction - for map keys and set values to be NOT NULL. - - * New 'points_to' pragma allows the establishment of relationship without - using object pointers. + * Support for using object pointers as map keys. Also the restriction for map + keys and set values to be NOT NULL was removed. - * The 'inverse' pragma now supports nested data members. + * New `points_to` pragma allows the establishment of relationships without + using object pointers. See Section 14.4.37, "points_to" in the ODB manual + for details. - * Helper header (<odb/nested-container.hxx>) for nested container emulation. - It is still fairly experimental and only supports vector<vector<T>>. For - example: - - #include <odb/nested-container.hxx> - - #pragma db object - class package - { - using licenses_type = std::vector<std::string> - using license_alternatives_type = std::vector<licenses_type> - - license_alternatives_type license_alternatives; + * A statement in a view that is prefixed with the /*SELECT*/ comment is + recognized and handled as a SELECT statement. This can be used to work + around unrecognized SELECT query prefixes. - // Database mapping. - // - using _license_key = odb::nested_key<licenses_type>; - using _licenses_type = std::map<_license_key, std::string>; + * Support for ordering virtual data members. For details, see Section + 14.4.13, "virtual" in the ODB manual. - #pragma db value(_license_key) - #pragma db member(_license_key::outer) column("alternative_index") - #pragma db member(_license_key::inner) column("index") - - #pragma db member(license_alternatives) id_column("") value_column("") - #pragma db member(licenses) \ - virtual(_licenses_type) \ - after(license_alternatives) \ - get(odb::nested_get (this.license_alternatives)) \ - set(odb::nested_set (this.license_alternatives, std::move (?))) \ - id_column("") key_column("") value_column("license") - }; - - * Database classes are now move-constructible. This means they can be - returned by value from a function in C++11. + * The special (!) placeholder denotes the database instance in the modifier + expressions. For details, see Section 14.4.5, "get/set/access" in the + ODB manual. * Support for bulk operations in PostgreSQL 14 using the new pipeline mode. For details on bulk operations see Section 15.3, "Bulk Database Operations" @@ -78,19 +71,55 @@ Version 2.5.0 7.4 or later. The development of this support was sponsored by Qube Research & Technologies Limited. - * Support for SQLite ATTACH DATABASE. Attached databases are represented as - special odb::sqlite::database instances. @@ TODO: doc ref. + * Support for calling PostgreSQL stored procedures and functions. For + details and limitations refer to Section 19.7, "PostgreSQL Stored + Procedures and Functions" in the ODB manual. + + * New serial_connection_factory in the SQLite runtime. + + This factory can be used when the database access is guaranteed to be + serial. See Section 18.3, "SQLite Connection and Connection Factory" + in the ODB manual for details. + + * Support for attaching additional SQLite databases to the main database + connections (ATTACH DATABASE statement). See Section 18.4, "Attached + SQLite Databases" in the ODB manual for details. * Support for SQLite incremental BLOB/TEXT I/O (the sqlite3_blob_open() functionality). For details, refer to Section 18.1.3, "Incremental BLOB/TEXT I/O" in the ODB manual. - * In PostgreSQL a SELECT statement in a view that is prefixed with the - /*CALL*/ comment is recognized and handled as a stored procedure call. + * Support for mixed auto/manual id assignment in SQLite. + + Now one can do: + + #pragma db id auto + odb::nullable<int64_t> id; + + And then set the id to NULL to get auto-assignment or to the actual value + to use a manual id. + + * Support for mixed auto/0 id assignment in MySQL. + + Now one can do: + + #pragma db id auto + odb::nullable<int64_t> id; + + And then, when used with NO_AUTO_VALUE_ON_ZERO, set the id to NULL to get + auto-assignment or to 0 to use 0 as the id. + + * Map string object ids to MySQL VARCHAR(128) instead of 255 to support + 4-byte UTF-8. + + This is a backwards-incompatible change in that it may change your schema. + To obtain the old behavior you will have to explicitly re-map std::string + with the id_type pragma or explicitly specify the database type for each + affected id member with the type pragma. * Due to warnings issued by some compiler, std::auto_ptr is no longer mapped - as an object pointer or wrapper in the C++11 mode. Use std::unique_ptr - instead. + as an object pointer or wrapper in the C++11 and later modes. Use + std::unique_ptr instead. Version 2.4.0 diff --git a/PACKAGE-README.md b/PACKAGE-README.md new file mode 100644 index 0000000..22f299d --- /dev/null +++ b/PACKAGE-README.md @@ -0,0 +1,70 @@ +# ODB - ORM for C++ + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. ODB supports the MySQL, SQLite, +PostgreSQL, Oracle, and Microsoft SQL Server relational databases. It also +comes with optional profiles for Boost and Qt which allow you to seamlessly +use value types, containers, and smart pointers from these libraries in your +persistent C++ classes. + +For further information, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +## Usage + +ODB consists of several packages with the main ones being `odb` (the ODB +compiler), `libodb` (the common runtime library), and `libodb-<database>` (the +database runtime libraries). There are also `libodb-boost` and `libodb-qt` +(profile libraries) as well as `odb-tests` and `odb-examples`. + +When specifying dependencies on the ODB packages in your project, the `odb` +package should be a build-time dependency. You will always have a dependency +on `libodb` plus one or more `libodb-<database>`, depending on which +database(s) you wish to target. To be able to persist types from either Boost +or Qt you would also add the corresponding profile library. + +So, putting it all together, your project's `manifest` would normally have the +following fragment if, for example, you want to target SQLite: + +``` +depends: * odb ^2.5.0 +depends: libodb ^2.5.0 +depends: libodb-sqlite ^2.5.0 +``` + +Or the following fragment if using PostgreSQL as well as the Boost profile: + +``` +depends: * odb ^2.5.0 +depends: libodb ^2.5.0 +depends: libodb-pgsql ^2.5.0 +depends: libodb-boost ^2.5.0 +``` + +Then your `buildfile` would have something along these lines if using +SQLite: + +``` +import! [metadata] odb = odb%exe{odb} + +import libs = libodb%lib{odb} +import libs += libodb-sqlite%lib{odb-sqlite} +``` + +Or along these lines if using PostgreSQL and the Boost profile: + +``` +import! [metadata] odb = odb%exe{odb} + +import libs = libodb%lib{odb} +import libs += libodb-pgsql%lib{odb-pgsql} +import libs += libodb-boost%lib{odb-boost} +``` + +Note that the `odb` executable provides `build2` metadata. + +The invocation of the ODB compiler (in order to generate the database support +code from your headers) can be implemented using ad hoc recipes or rules. See +the `odb-examples` package for the complete examples. @@ -1,9 +1,9 @@ # ODB - ORM for C++ ODB is an open-source, cross-platform, and cross-database object-relational -mapping (ORM) system for C++. It allows you to persist C++ objects to a +mapping (ORM) system for C++. It allows you to persist C++ classes to a relational database without having to deal with tables, columns, or SQL and -without manually writing any mapping code. ODB supports MySQL, SQLite, +without manually writing any mapping code. ODB supports the MySQL, SQLite, PostgreSQL, Oracle, and Microsoft SQL Server relational databases. It also comes with optional profiles for Boost and Qt which allow you to seamlessly use value types, containers, and smart pointers from these libraries in your @@ -54,11 +54,24 @@ bdep init @mssql -d libodb -d libodb-mssql -d odb-tests -d odb-examples Note that while the target configurations can use any compiler (and you can create multiple such configurations for different compilers), the host -configuration must use GCC because the ODB compiler is implemented as a GCC -plugin. +configuration must use GCC with plugin support enabled because the ODB +compiler is implemented as a GCC plugin. GCC plugin headers are usually +distributed as a separate package which is not installed by default. To +install it on Debian and alike distributions (where `N` is the GCC major +version): -You can use system-installed versions of the client libraries and tools -instead of building them from source. For example: +``` +apt-get install gcc-N-plugin-dev +``` + +To install it on Fedora and alike distributions: + +``` +dnf install gcc-plugin-devel +``` + +You can use system-installed versions of the database client libraries and +tools instead of building them from source. For example: ``` bdep config link @pgsql @host diff --git a/UNLICENSE b/UNLICENSE new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> diff --git a/libodb-boost/GPLv2 b/libodb-boost/GPLv2 index 3912109..08e5586 100644..120000 --- a/libodb-boost/GPLv2 +++ b/libodb-boost/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/libodb-boost/INSTALL b/libodb-boost/INSTALL deleted file mode 100644 index 5c67dce..0000000 --- a/libodb-boost/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-boost - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-boost/LICENSE b/libodb-boost/LICENSE index d96b938..bed2288 100644 --- a/libodb-boost/LICENSE +++ b/libodb-boost/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -16,5 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 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 St, Fifth Floor, Boston, MA 02110-1301 USA +version 2 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com.
\ No newline at end of file diff --git a/libodb-boost/PACKAGE-README.md b/libodb-boost/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-boost/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-boost/README b/libodb-boost/README deleted file mode 100644 index 7ad79b8..0000000 --- a/libodb-boost/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the Boost ODB profile library. The Boost profile -provides support for persisting Boost smart pointers, containers, and -value types with the ODB system. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-boost/README.md b/libodb-boost/README.md new file mode 100644 index 0000000..5fa1791 --- /dev/null +++ b/libodb-boost/README.md @@ -0,0 +1,14 @@ +# libodb-boost - Boost ODB profile library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the Boost ODB profile library. The Boost profile +provides support for persisting Boost smart pointers, containers, and value +types. diff --git a/libodb-boost/buildfile b/libodb-boost/buildfile index 8a0d6d9..631a236 100644 --- a/libodb-boost/buildfile +++ b/libodb-boost/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : GNU GPL v2; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv2 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-boost/manifest b/libodb-boost/manifest index ef8ab78..dc2cbd5 100644 --- a/libodb-boost/manifest +++ b/libodb-boost/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-boost -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: Boost ODB profile library license: GPL-2.0-only license: other: proprietary ; Not free/open source. topics: C++, ORM, Boost, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -15,10 +16,121 @@ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com builds: all requires: c++11 +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. +depends: libodb == $ + +# Binary distribution packages. Overall notes: # -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +# - Build as C++11 for maximum compatibility (this is a C++11 codebase). -depends: libodb == $ +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: +\ ++bpkg.bindist.debian: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +\ + +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: +\ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +\ + +# Windows binary distribution archives (release and debug). +# +# - Don't bundle libodb dependency, assuming that the archive will normally be +# extracted into the directory with the database-specific runtime libraries +# and, thus, containing libodb. +# +# - Build using the same custom bot which is used to build libodb. +# +# - For Debug we only produce the shared library (if we wanted to also do +# static, then would need to use /Z7), adding the `D` suffix to the library +# name. +# +bindist-windows-release-builds: bindist +bindist-windows-release-build-include: windows*-msvc** +bindist-windows-release-build-exclude: ** +#bindist-windows-release-build-bot: -- see below. +bindist-windows-release-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +b.create:config.cc.coptions="/W2 /O2" +b.create:config.cxx.std=c++11 +\ + +bindist-windows-debug-builds: bindist +bindist-windows-debug-build-include: windows*-msvc** +bindist-windows-debug-build-exclude: ** +#bindist-windows-debug-build-bot: -- see below. +bindist-windows-debug-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +bpkg.bindist.archive:--archive-build-meta=+debug +bpkg.create:config.bin.lib=shared +bpkg.create:config.bin.lib.suffix=D +b.create:config.cc.coptions="/W2 /Zi /MDd" +b.create:config.cc.loptions="/DEBUG:FULL" +b.test-installed.create:config.cc.coptions="/W2 /MDd" +b.test-installed.create:config.import.libodb_boost.odb_boost.lib=odb-boostD +b.create:config.cxx.std=c++11 +\ + +bindist-windows-release-build-bot: +\ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== +-----END PUBLIC KEY----- +\ + +bindist-windows-debug-build-bot: +\ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== +-----END PUBLIC KEY----- +\ diff --git a/libodb-boost/odb/boost/date-time/mysql/posix-time-traits.hxx b/libodb-boost/odb/boost/date-time/mysql/posix-time-traits.hxx index 28c42c1..a8bae22 100644 --- a/libodb-boost/odb/boost/date-time/mysql/posix-time-traits.hxx +++ b/libodb-boost/odb/boost/date-time/mysql/posix-time-traits.hxx @@ -71,9 +71,9 @@ namespace odb i.day = d.day (); const time_duration& t (v.time_of_day ()); - i.hour = t.hours (); - i.minute = t.minutes (); - i.second = t.seconds (); + i.hour = static_cast<unsigned int> (t.hours ()); + i.minute = static_cast<unsigned int> (t.minutes ()); + i.second = static_cast<unsigned int> (t.seconds ()); unsigned long long ms (t.fractional_seconds ()); ms = ms * 1000000ULL / time_duration::ticks_per_second (); @@ -140,9 +140,9 @@ namespace odb i.day = d.day (); const time_duration& t (v.time_of_day ()); - i.hour = t.hours (); - i.minute = t.minutes (); - i.second = t.seconds (); + i.hour = static_cast<unsigned int> (t.hours ()); + i.minute = static_cast<unsigned int> (t.minutes ()); + i.second = static_cast<unsigned int> (t.seconds ()); unsigned long long ms (t.fractional_seconds ()); ms = ms * 1000000ULL / time_duration::ticks_per_second (); @@ -205,9 +205,9 @@ namespace odb i.month = 0; i.day = 0; - i.hour = std::abs (v.hours ()); - i.minute = std::abs (v.minutes ()); - i.second = std::abs (v.seconds ()); + i.hour = static_cast<unsigned int> (std::abs (v.hours ())); + i.minute = static_cast<unsigned int> (std::abs (v.minutes ())); + i.second = static_cast<unsigned int> (std::abs (v.seconds ())); // Some compilers, e.g., VC8, don't have 64-bit abs() overload. // diff --git a/libodb-boost/odb/boost/version.hxx.in b/libodb-boost/odb/boost/version.hxx.in index 15aed4e..c7f0acf 100644 --- a/libodb-boost/odb/boost/version.hxx.in +++ b/libodb-boost/odb/boost/version.hxx.in @@ -61,14 +61,14 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // // NOTE: also hardcoded in *.options. // -#define ODB_BOOST_VERSION 2047600 -#define ODB_BOOST_VERSION_STR "2.5.0-b.26" +#define ODB_BOOST_VERSION 2055100 +#define ODB_BOOST_VERSION_STR "2.6.0-b.1" // libodb-boost version: odb interface version plus the bugfix version. Note // that LIBODB_BOOST_VERSION is always greater or equal to ODB_BOOST_VERSION // since if the Boost interface virsion is incremented then the bugfix version // must be incremented as well. // -#define LIBODB_BOOST_VERSION 2049976 +#define LIBODB_BOOST_VERSION 2059951 #endif // LIBODB_BOOST_VERSION diff --git a/libodb-boost/odb/boost/version.options b/libodb-boost/odb/boost/version.options index 904dcc5..4b4a2c4 100644 --- a/libodb-boost/odb/boost/version.options +++ b/libodb-boost/odb/boost/version.options @@ -7,6 +7,6 @@ # --hxx-prologue '#include <odb/boost/version.hxx>' ---hxx-prologue '#if ODB_BOOST_VERSION != 2047600 // 2.5.0-b.26' +--hxx-prologue '#if ODB_BOOST_VERSION != 2055100 // 2.6.0-b.1' --hxx-prologue '# error ODB and C++ compilers see different libodb-boost interface versions' --hxx-prologue '#endif' diff --git a/libodb-boost/tests/build/bootstrap.build b/libodb-boost/tests/build/bootstrap.build index 6ee38db..dce9c4c 100644 --- a/libodb-boost/tests/build/bootstrap.build +++ b/libodb-boost/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb-mssql/INSTALL b/libodb-mssql/INSTALL deleted file mode 100644 index b6e2be5..0000000 --- a/libodb-mssql/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-mssql - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-mssql/LICENSE b/libodb-mssql/LICENSE index 2581d22..5b95d75 100644 --- a/libodb-mssql/LICENSE +++ b/libodb-mssql/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. Permission is granted to use, copy, modify, and distribute this program under the ODB Non-Commercial Use and Evaluation License @@ -17,5 +17,5 @@ ODB Non-Commercial Use and Evaluation License for details. You should have received a copy of the ODB Non-Commercial Use and Evaluation License (normally located in the NCUEL file that is -accompanying the distribution); if not, contact Code Synthesis -Tools CC at info@codesynthesis.com. +accompanying the distribution); if not, contact Code Synthesis at +info@codesynthesis.com. diff --git a/libodb-mssql/NCUEL b/libodb-mssql/NCUEL index f5211c1..a470ab5 100644..120000 --- a/libodb-mssql/NCUEL +++ b/libodb-mssql/NCUEL @@ -1,294 +1 @@ - ODB NON-COMMERCIAL USE AND EVALUATION LICENSE (NCUEL) - -INTENT - -The intent of this license is to allow you to use ODB with commercial -databases, such as Oracle, Microsoft SQL Server, IBM DB/2, etc., free -of charge non-commercially or for evaluation. - -Furthermore, if a commercial database has a free edition, often called -express edition, such as Oracle Express, Microsoft SQL Server Express, -IBM DB/2 Express-C, etc., that can be used for commercial purposes free -of charge, then this license allows you to use ODB with such an edition -for commercial purposes also free of charge. - -Note also that the development of an application that will be used for -commercial purposes constitutes a commercial use and is not allowed, -except with a free edition of a commercial database. However, this -license allows you to evaluate ODB; that is, to use the Software for -a reasonable period for the purpose of determining its suitability for -a particular application as well as to conduct exploratory development -or proof-of-concept prototyping. - -Finally, any application that uses ODB under this license, whether non- -commercially, for evaluation, or commercially with a free edition of a -database, is subject to the terms and conditions similar to that of the -GPL version 2. In particular, this means that if and when you distribute -your application, you are required to also release its source code. - -If you have any questions concerning this License, please contact us at: -info@codesynthesis.com. - -LEGAL TERMS AND CONDITIONS - -This Code Synthesis Non-Commercial Use and Evaluation License -Agreement for ODB Software ("License") is a legal agreement between -you, the Licensee, (either an individual or a single entity) and Code -Synthesis Tools CC ("Code Synthesis") for non-commercially using, -copying, distributing and modifying the Software and any work derived -from the Software, as defined hereinbelow. Any commercial use, except -as expressly provided in Section 2.1, is subject to a different license. - -By using, modifying, or distributing the Software or any work derived -from the Software, Licensee indicates acceptance of this License and -agrees to be bound by all its terms and conditions for using, copying, -distributing, or modifying the Software and works derived from the -Software. If Licensee is agreeing to this License on behalf of an entity -other than an individual person, Licensee represents that Licensee is -binding and have the right to bind the entity to the terms and conditions -of this agreement. - -These terms and conditions only apply to the ODB components that are -explicitly licensed under this License (normally ODB runtime libraries -for commercial databases). Other ODB components may be licensed under -other licenses and are not affected in any way by the terms and -conditions found in this License. Similarly, ODB components licensed -under this License are not affected by the terms and conditions found -in other licenses. If you are using several ODB components that are -licensed under different licenses, you must comply with the terms and -conditions of each such license. - -No rights are granted to the Software except as expressly set forth -herein. Nothing other than this License grants Licensee permission to -use, copy, distribute or modify the Software or any work derived from -the Software. Licensee may not use, copy, distribute or modify the -Software or any work derived from the Software except as expressly -provided under this License. If Licensee does not accept the terms and -conditions of this License, Licensee shall not use, copy, distribute -or modify the Software. - -In consideration for Licensee's forbearance of commercial use of the -Software, except as expressly provided in Section 2.1, Code Synthesis -grants Licensee non-exclusive, royalty-free and without fees rights -as expressly provided herein. - -1. DEFINITIONS. - -A "commercial database" is a database product that has associated -fees and/or royalties payable for production and/or commercial use -of the database product. Commercial databases include, but are not -limited to, Oracle, Microsoft SQL Server, and IBM DB/2. - -A "free edition of a commercial database" is a special, limited edition -of a commercial database, often called express edition, that does not -require fees and/or royalties for production and/or commercial use. -Free editions of commercial databases include, but are not limited to, -Oracle Express, Microsoft SQL Server Express, and IBM DB/2 Express-C. - -The "Software" is one of the ODB runtime libraries for one of the -commercial databases, including, but not limited to, demo programs, -associated media and printed materials, and any included "on-line" -documentation. - -A "work derived from the Software" is any derivative work as defined -in the copyright law of the nation or state where rights to the work -derived from the Software are exercisable; that is to say, a program -which is linked with or otherwise incorporates the ODB runtime library -or a translation, improvement, enhancement, extension or other -modification of the Software which has sufficient originality to -qualify in such a nation or state as a copyrightable work is a work -derived from the Software. - -To "use" means to execute (i.e. run) the Software. - -To "copy" means to create one or more copies of the Software. - -To "distribute" means to broadcast, publish, transfer, post, upload, -download or otherwise disseminate in any medium to any third party. - -To "modify" means to create a work derived from the Software. - -To "evaluate" means to use the Software for a reasonable period for -the purpose of determining its suitability for a particular application -as well as to conduct exploratory development or proof-of-concept -prototyping. - -A "commercial use" is: - -(1) the use of the Software or any work derived from the Software in -connection with, for or in aid of the generation of revenue, such as -in the conduct of Licensee's daily business operations; or - -(2) any copying, distribution or modification of the Software or any -work derived from the Software to any party where payment or other -consideration is made in connection with such copying, distribution or -modification, whether directly (as in payment for a copy of the -Software) or indirectly (including but not limited to payment for some -good or service related to the Software, or payment for some product -or service that includes a copy of the Software "without charge"). -However, the following actions which involve payment do not in and -of themselves constitute a commercial use: - -(a) posting the Software on a public access information storage and -retrieval service for which a fee is received for retrieving -information (such as an on-line service), provided that the fee is not -content-dependent. Such fees which are not content dependent include, -but are not limited to, fees which are based solely on the storage -capacity required to store the information, and fees which are based -solely on the time required to transfer the information from/to the -public access information storage and retrieval service; and - -(b) distributing the Software on a CD-ROM, provided that the Software -is reproduced entirely and verbatim on such CD-ROM, and provided further -that all information on such CD-ROM may be distributed in a manner which -does not constitute a commercial use. - -2. GRANT OF LICENSE. - -2.1. LICENSE TO USE. -Licensee may use the Software provided that such use does not constitute -a commercial use. - -Licensee may also use the Software commercially with a free edition of a -commercial database, if such an edition is available. If Licensee -distributes works derived from the Software and such works may be used -commercially by third parties, Licensee must cause such commercial use -to be limited to a free edition of a commercial database. - -2.2. LICENSE TO EVALUATE. -Licensee may evaluation the Software for commercial use. - -2.3. LICENSE TO COPY AND DISTRIBUTE. -Licensee may copy and distribute literal (i.e., verbatim) copies of the -Software as Licensee receives it throughout the world, in any medium, -provided that Licensee distributes an unmodified, easily-readable copy -of this License with the Software, and provided further that such -distribution does not constitute a commercial use. - -2.4. LICENSE TO CREATE WORKS DERIVED FROM THE SOFTWARE. -Licensee may create works derived from the Software, provided that any -such work derived from the Software carries prominent notices stating -both the manner in which Licensee has created a work derived from the -Software (for example, notices stating that the work derived from the -Software is linked with or otherwise incorporates the ODB runtime -library, or notices stating that the work derived from the Software -is an enhancement to the Software which Licensee has created) and the -date any such work derived from the Software was created. - -2.5. LICENSE TO COPY AND DISTRIBUTE WORKS DERIVED FROM THE SOFTWARE. -Licensee may copy and distribute works derived from the Software -throughout the world, provided that Licensee distributes an -unmodified, easily-readable copy of this License with such works -derived from the Software, and provided further that such distribution -does not constitute a commercial use. Licensee must cause any work -derived from the Software that Licensee distributes to be licensed as -a whole and at no charge to all third parties under the terms of this -License or another free/open source license that does not restrict any -rights of any third party that would have been granted should such work -have been licensed under this License. - -Any work derived from the Software must be accompanied by the complete -corresponding machine-readable source code of such work derived from -the Software, delivered on a medium customarily used for software -interchange. The source code for the work derived from the Software -means the preferred form of the work derived from the Software for -making modifications to it. For an executable work derived from the -Software, complete source code means all of the source code for all -modules of the work derived from the Software, all associated -interface definition files and all scripts used to control compilation -and installation of all or any part of the work derived from the -Software. However, the source code delivered need not include anything -that is normally distributed, in either source code or binary (object- -code) form, with major components (including but not limited to -compilers, linkers, and kernels) of the operating system on which the -executable work derived from the Software runs, unless that component -itself accompanies the executable code of the work derived from the -Software. - -Furthermore, if the executable code or object code of the work derived -from the Software may be copied from a designated place, and if the -source code of the work derived from the Software may be copied from -the same place, then the work derived from the Software shall be -construed as accompanied by the complete corresponding machine-readable -source code of such work derived from the Software, even though third -parties are not compelled to copy the source code along with the -executable code or object code. - -If the work derived from the Software normally reads commands -interactively when run, Licensee must cause the work derived from the -Software, at each time it commences operation, to print or display an -announcement including either a notice consisting of the verbatim -warranty and liability provisions of this License, or a notice that -Licensee, and not Code Synthesis provides a warranty. - -Licensee may not impose any further restrictions on the exercise of -the rights granted herein by any recipient of any work derived from -the Software. - -3. RESTRICTIONS. - -Licensee acknowledges that the Software is protected by copyright laws -and international copyright treaties, as well as other intellectual -property laws and treaties. The Software is licensed, not sold. All -title and copyrights in and to the Software are owned exclusively by -Code Synthesis. - -Licensee may not sublicense, assign or transfer this License, the -Software or any work derived from the Software except as permitted by -this License. - -Licensee is expressly prohibited from using, copying, distributing, -studying the source code, or otherwise examining the Software for -the purpose of reverse engineering or duplicating its functionality -(unless enforcement of this restrictions is prohibited by applicable -law). - -4. LIMITED WARRANTY. - -4.1 NO WARRANTIES. -CODE SYNTHESIS EXPRESSLY DISCLAIMS ANY WARRANTY FOR THE SOFTWARE. THE -SOFTWARE IS PROVIDED TO LICENSEE "AS IS," WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE USE, -QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH LICENSEE. SHOULD THE -SOFTWARE PROVE DEFECTIVE, LICENSEE ASSUMES THE COST OF ALL NECESSARY -SERVICING, REPAIR OR CORRECTION. - -4.2. NO LIABILITY FOR DAMAGES. -IN NO EVENT WILL CODE SYNTHESIS, OR ANY OTHER PARTY WHO MAY COPY, -DISTRIBUTE OR MODIFY THE SOFTWARE AS PERMITTED HEREIN, BE LIABLE FOR -ANY GENERAL, DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL -DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF -BUSINESS PROFITS, BUSINESS INTERRUPTION, INACCURATE INFORMATION, LOSS -OF INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR -INABILITY TO USE THE SOFTWARE, EVEN IF CODE SYNTHESIS OR SUCH OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -5. TERMINATION. - -Any violation or any attempt to violate any of the terms and conditions -of this License will automatically terminate Licensee's rights under -this License. Licensee further agrees upon such termination to cease -any and all using, copying, distributing and modifying of the Software -and any work derived from the Software, and further to destroy any and -all of Licensee's copies of the Software and any work derived from the -Software. - -However, parties who have received copies of the Software or copies of -any work derived from the Software, or rights, from Licensee under this -License will not have their licenses terminated so long as such parties -remain in full compliance with this License. - -6. LICENSE SCOPE AND MODIFICATION. - -This License sets forth the entire agreement between Licensee and Code -Synthesis and supersedes all prior agreements and understandings between -the parties relating to the subject matter hereof. None of the terms of -this License may be waived or modified except as expressly agreed in -writing by both Licensee and Code Synthesis. - -7. SEVERABILITY. - -Should any provision of this License be declared void or unenforceable, -the validity of the remaining provisions shall not be affected thereby. +../NCUEL
\ No newline at end of file diff --git a/libodb-mssql/PACKAGE-README.md b/libodb-mssql/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-mssql/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-mssql/README b/libodb-mssql/README deleted file mode 100644 index 21671b7..0000000 --- a/libodb-mssql/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the Microsoft SQL Server ODB runtime library. -Every application that includes code generated for the SQL Server -database will need to link to this library. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-mssql/README.md b/libodb-mssql/README.md new file mode 100644 index 0000000..f5a33e5 --- /dev/null +++ b/libodb-mssql/README.md @@ -0,0 +1,17 @@ +# libodb-mssql - MSSQL ODB runtime library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the Microsoft SQL Server (MSSQL) ODB runtime library. +Applications that include code generated for the MSSQL database will need to +link this library. + +This runtime library in turn depends on `libunixodbc` (Linux only) and the SQL +Server Native Client ODBC driver. diff --git a/libodb-mssql/buildfile b/libodb-mssql/buildfile index db1aceb..e9f3aa1 100644 --- a/libodb-mssql/buildfile +++ b/libodb-mssql/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : ODB NCUEL; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{NCUEL LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{NCUEL LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-mssql/manifest b/libodb-mssql/manifest index 324cf80..376fa99 100644 --- a/libodb-mssql/manifest +++ b/libodb-mssql/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-mssql -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: Microsoft SQL Server ODB runtime library license: other: ODB NCUEL ; Non-Commercial Use and Evaluation License. license: other: proprietary ; Not free/open source. topics: C++, ORM, Microsoft SQL Server, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -14,16 +15,12 @@ src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com requires: c++11 -# @@ DEP -#requires: ? libunixodbc ; Only on UNIX. - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +requires: mssql-odbc ; MS SQL Server ODBC driver. +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- depends: libodb == $ -depends: * cli ^1.2.0- ? ($config.libodb_mssql.develop) +depends: * cli ^1.2.0 ? ($config.libodb_mssql.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=mssql @@ -43,7 +40,7 @@ builds: none ; Requires proprietary software. # Instead of the default configuration (see odb-{tests,examples} for # background). # -custom-builds: latest ; Requires proprietary software. +custom-builds: default ; Requires proprietary software. custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. @@ -66,11 +63,17 @@ custom-build-config: config.odb_examples.mssql.port=$getenv(DATABASE_PORT) config.odb_examples.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) }+ odb-examples + +# Configure odb-{tests,examples} packages' dependency libodb as system on the +# bpkg.test-separate-installed.configure.build step, since it is already +# installed as a dependency of libodb-mssql. +# +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # Instead of the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires proprietary software. +custom-multi-builds: default ; Requires proprietary software. custom-multi-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. @@ -86,13 +89,15 @@ custom-multi-build-config: config.odb_tests.mssql.port=$getenv(DATABASE_PORT) config.odb_tests.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) }+ odb-tests + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # The {boost,qt5,qt6}-custom configurations replace the # {boost,qt5,qt6}-default configurations (see odb-{tests,examples} for # background). # -boost-custom-builds: latest ; Requires proprietary software. +boost-custom-builds: default ; Requires proprietary software. boost-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. @@ -120,9 +125,11 @@ boost-custom-build-config: config.odb_examples.mssql.port=$getenv(DATABASE_PORT) config.odb_examples.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt5-custom-builds: latest ; Requires proprietary software. +qt5-custom-builds: default ; Requires proprietary software. qt5-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. @@ -150,9 +157,11 @@ qt5-custom-build-config: config.odb_examples.mssql.port=$getenv(DATABASE_PORT) config.odb_examples.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt6-custom-builds: latest ; Requires proprietary software. +qt6-custom-builds: default ; Requires proprietary software. qt6-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. @@ -180,6 +189,8 @@ qt6-custom-build-config: config.odb_examples.mssql.port=$getenv(DATABASE_PORT) config.odb_examples.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ custom-build-bot: @@ -200,24 +211,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -236,24 +229,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -272,24 +247,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -308,24 +265,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -343,21 +282,3 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv 9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ - -qt6-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ diff --git a/libodb-mssql/odb/mssql/buildfile b/libodb-mssql/odb/mssql/buildfile index a2b838f..5536a8a 100644 --- a/libodb-mssql/odb/mssql/buildfile +++ b/libodb-mssql/odb/mssql/buildfile @@ -123,7 +123,6 @@ if $develop diff $d/options.ixx $path($>[1]) >- && \ diff $d/options.cxx $path($>[2]) >- exit - end cp $path($>[0]) $d/options.hxx cp $path($>[1]) $d/options.ixx diff --git a/libodb-mssql/odb/mssql/database.cxx b/libodb-mssql/odb/mssql/database.cxx index 6e68bcb..e650e7c 100644 --- a/libodb-mssql/odb/mssql/database.cxx +++ b/libodb-mssql/odb/mssql/database.cxx @@ -550,7 +550,7 @@ namespace odb case select_statement::success: { svi.migration = migration != 0; - assert (st.fetch () == select_statement::no_data); + assert (st.fetch () == select_statement::no_data); // NDEBUG-ok. break; } case select_statement::no_data: diff --git a/libodb-mssql/odb/mssql/query.cxx b/libodb-mssql/odb/mssql/query.cxx index 6dd87e7..4dc94d5 100644 --- a/libodb-mssql/odb/mssql/query.cxx +++ b/libodb-mssql/odb/mssql/query.cxx @@ -196,7 +196,7 @@ namespace odb void query_base:: optimize () { - // Remove a single TRUE literal or one that is followe by one of + // Remove a single TRUE literal or one that is followed by one of // the other clauses. This avoids useless WHERE clauses like // // WHERE TRUE GROUP BY foo diff --git a/libodb-mssql/odb/mssql/query.hxx b/libodb-mssql/odb/mssql/query.hxx index 18db752..90784a5 100644 --- a/libodb-mssql/odb/mssql/query.hxx +++ b/libodb-mssql/odb/mssql/query.hxx @@ -218,8 +218,10 @@ namespace odb append (table, column); } + // Don't use the 'explicit' specifier to support stored procedure + // parameters. + // template <typename T> - explicit query_base (val_bind<T> v) : binding_ (0, 0) { @@ -227,7 +229,6 @@ namespace odb } template <typename T, database_type_id ID> - explicit query_base (val_bind_typed<T, ID> v) : binding_ (0, 0) { @@ -235,7 +236,6 @@ namespace odb } template <typename T> - explicit query_base (ref_bind<T> r) : binding_ (0, 0) { @@ -243,7 +243,6 @@ namespace odb } template <typename T, database_type_id ID> - explicit query_base (ref_bind_typed<T, ID> r) : binding_ (0, 0) { diff --git a/libodb-mssql/odb/mssql/version.hxx.in b/libodb-mssql/odb/mssql/version.hxx.in index 02a404f..d34b1cd 100644 --- a/libodb-mssql/odb/mssql/version.hxx.in +++ b/libodb-mssql/odb/mssql/version.hxx.in @@ -55,6 +55,6 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // 2.2.0.a1 02019901 // 3.0.0.b2 02999952 // -#define LIBODB_MSSQL_VERSION 2049976 +#define LIBODB_MSSQL_VERSION 2059951 #endif // LIBODB_MSSQL_VERSION diff --git a/libodb-mssql/tests/build/bootstrap.build b/libodb-mssql/tests/build/bootstrap.build index 895126c..8802c76 100644 --- a/libodb-mssql/tests/build/bootstrap.build +++ b/libodb-mssql/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb-mysql/GPLv2 b/libodb-mysql/GPLv2 index 3912109..08e5586 100644..120000 --- a/libodb-mysql/GPLv2 +++ b/libodb-mysql/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/libodb-mysql/INSTALL b/libodb-mysql/INSTALL deleted file mode 100644 index ef46275..0000000 --- a/libodb-mysql/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-mysql - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-mysql/LICENSE b/libodb-mysql/LICENSE index d96b938..bed2288 100644 --- a/libodb-mysql/LICENSE +++ b/libodb-mysql/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -16,5 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 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 St, Fifth Floor, Boston, MA 02110-1301 USA +version 2 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com.
\ No newline at end of file diff --git a/libodb-mysql/PACKAGE-README.md b/libodb-mysql/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-mysql/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-mysql/README b/libodb-mysql/README deleted file mode 100644 index 5e2315a..0000000 --- a/libodb-mysql/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the MySQL ODB runtime library. Every application -that includes code generated for the MySQL database will need to link -to this library. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-mysql/README.md b/libodb-mysql/README.md new file mode 100644 index 0000000..ddd212a --- /dev/null +++ b/libodb-mysql/README.md @@ -0,0 +1,16 @@ +# libodb-mysql - MySQL ODB runtime library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the MySQL ODB runtime library. Applications that include +code generated for the MySQL database will need to link this library. + +This runtime library in turn depends on `libmysqlclient`, MySQL client +library. Note that the MariaDB client library can be used instead of MySQL. diff --git a/libodb-mysql/build/root.build b/libodb-mysql/build/root.build index c98d520..2721324 100644 --- a/libodb-mysql/build/root.build +++ b/libodb-mysql/build/root.build @@ -3,6 +3,12 @@ config [bool] config.libodb_mysql.develop ?= false +# Enable the dependency on the mysql-client package to, for example, ease its +# bundling into the binary distribution package (see the bindist-windows-* +# package build configurations hack for the use case). +# +config [bool] config.libodb_mysql.mysql_client ?= false + # Configure which database client library to use for build2 versions greater # than 0.12.0 and always use MySQL client library otherwise (due to the lack # of the project configuration variables support). diff --git a/libodb-mysql/buildfile b/libodb-mysql/buildfile index a04e206..631a236 100644 --- a/libodb-mysql/buildfile +++ b/libodb-mysql/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : GNU GPL v2; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{GPLv2 LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv2 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-mysql/manifest b/libodb-mysql/manifest index fd3b7b6..da58720 100644 --- a/libodb-mysql/manifest +++ b/libodb-mysql/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-mysql -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: MySQL ODB runtime library license: GPL-2.0-only license: other: proprietary ; Not free/open source. topics: C++, ORM, MySQL, MariaDB, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -14,16 +15,14 @@ src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com requires: c++11 - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- #depends: libmysqlclient >= 5.0.3 | libmariadb ^10.2.2 depends: libmysqlclient >= 5.0.3 +depends: mysql-client >= 5.0.3 ? ($config.libodb_mysql.mysql_client) depends: libodb == $ -depends: * cli ^1.2.0- ? ($config.libodb_mysql.develop) +depends: * cli ^1.2.0 ? ($config.libodb_mysql.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=mysql @@ -52,6 +51,12 @@ default-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +# Configure odb-{tests,examples} packages' dependency libodb as system on the +# bpkg.test-separate-installed.configure.build step, since it is already +# installed as a dependency of libodb-mysql. +# +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # Only build this package configuration where it can be tested via odb-tests @@ -73,12 +78,14 @@ multi-build-config: config.odb_tests.mysql.host=$getenv(DATABASE_HOST) config.odb_tests.mysql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # Complements the default configuration (see odb-{tests,examples} for # background). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: default ; Requires default config with GCC as host compiler. custom-builds: -wasm custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. @@ -97,11 +104,13 @@ custom-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # Complements the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires latest config with GCC as host compiler. +custom-multi-builds: default ; Requires default config with GCC as host compiler. custom-multi-builds: -wasm custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. @@ -115,6 +124,8 @@ custom-multi-build-config: config.odb_tests.mysql.host=$getenv(DATABASE_HOST) config.odb_tests.mysql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # Only build the {boost,qt5,qt6}-default package configurations where they can @@ -147,6 +158,8 @@ boost-default-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ qt5-default-builds: default @@ -175,6 +188,8 @@ qt5-default-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ qt6-default-builds: default @@ -203,13 +218,15 @@ qt6-default-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # The {boost,qt5,qt6}-custom configurations complement the # {boost,qt5,qt6}-default configurations (see odb-{tests,examples} for # background). # -boost-custom-builds: latest ; Requires latest config with GCC as host compiler. +boost-custom-builds: default ; Requires default config with GCC as host compiler. boost-custom-builds: -wasm boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. @@ -233,9 +250,11 @@ boost-custom-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt5-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt5-custom-builds: default ; Requires default config with GCC as host compiler. qt5-custom-builds: -wasm qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. @@ -259,9 +278,11 @@ qt5-custom-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt6-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt6-custom-builds: default ; Requires default config with GCC as host compiler. qt6-custom-builds: -wasm qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. @@ -285,6 +306,8 @@ qt6-custom-build-config: config.odb_examples.mysql.host=$getenv(DATABASE_HOST) config.odb_examples.mysql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ custom-build-bot: @@ -305,24 +328,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -341,24 +346,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -377,25 +364,25 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: +qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ -qt5-custom-build-bot: +qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -413,25 +400,178 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: +# Binary distribution packages. Overall notes: +# +# - Build as C++11 for maximum compatibility (this is a C++11 codebase). + +# Note that on Debian 11, 12 the builds end up with the MariaDB's 'should not +# be included by clients' warning (see odb/mysql/details/config.hxx for +# details). We suppress it with the -Wno-cpp GCC option. +# +# @@ For the later Debian versions review if this option is still required. +# +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: +\ ++bpkg.bindist.debian: ++bbot.bindist.upload: +bpkg.bindist.debian:--debian-buildflags=prepend +b.create:config.cxx.std=c++11 +bpkg.configure.build:.../config.cc.poptions=[null] +bpkg.configure.build:.../config.cc.coptions=[null] +bpkg.configure.build:.../config.cc.loptions=[null] +bpkg.configure.build:.../config.cxx.coptions=-Wno-cpp +b.test-installed.create:config.cxx.coptions=-Wno-cpp +bpkg.test-separate-installed.create:config.cxx.coptions=-Wno-cpp +?sys:libmysqlclient +?sys:mysql-client + +{ + config.odb_tests.mysql.user=$getenv(DATABASE_USER) + config.odb_tests.mysql.database=$getenv(DATABASE_NAME) + config.odb_tests.mysql.host=$getenv(DATABASE_HOST) + config.odb_tests.mysql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.mysql.user=$getenv(DATABASE_USER) + config.odb_examples.mysql.database=$getenv(DATABASE_NAME) + config.odb_examples.mysql.host=$getenv(DATABASE_HOST) + config.odb_examples.mysql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- + +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: \ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +?sys:libmysqlclient +?sys:mysql-client -qt6-custom-build-bot: +{ + config.odb_tests.mysql.user=$getenv(DATABASE_USER) + config.odb_tests.mysql.database=$getenv(DATABASE_NAME) + config.odb_tests.mysql.host=$getenv(DATABASE_HOST) + config.odb_tests.mysql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.mysql.user=$getenv(DATABASE_USER) + config.odb_examples.mysql.database=$getenv(DATABASE_NAME) + config.odb_examples.mysql.host=$getenv(DATABASE_HOST) + config.odb_examples.mysql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + +# Windows binary distribution archives (release and debug). +# +# - Bundle the dependencies (libmysqlclient, etc) with --recursive=full, so +# that if the user needs to link any of these libraries directly, they can +# use their bundled versions, compatible with libodb-mysql. +# +# - Also bundle the database client program so that the user can use it, if +# they need to. Only for release. +# +# - Don't bundle libodb since it is packaged separately. +# +# - For Debug we only produce the shared library (if we wanted to also do +# static, then would need to use /Z7), adding the `D` suffix to the library +# name. +# +bindist-windows-release-builds: bindist +bindist-windows-release-build-include: windows*-msvc** +bindist-windows-release-build-exclude: ** +#bindist-windows-release-build-bot: -- see below. +bindist-windows-release-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=full +bpkg.bindist.archive:--recursive=?libodb=separate + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +b.create:config.cc.coptions="/W2 /O2" +b.create:config.cxx.std=c++11 + +{ config.libodb_mysql.mysql_client=true }+ libodb-mysql + +{ + config.odb_tests.mysql.user=$getenv(DATABASE_USER) + config.odb_tests.mysql.database=$getenv(DATABASE_NAME) + config.odb_tests.mysql.host=$getenv(DATABASE_HOST) + config.odb_tests.mysql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.mysql.user=$getenv(DATABASE_USER) + config.odb_examples.mysql.database=$getenv(DATABASE_NAME) + config.odb_examples.mysql.host=$getenv(DATABASE_HOST) + config.odb_examples.mysql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + +bindist-windows-debug-builds: bindist +bindist-windows-debug-build-include: windows*-msvc** +bindist-windows-debug-build-exclude: ** +#bindist-windows-debug-build-bot: -- see below. +bindist-windows-debug-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=full +bpkg.bindist.archive:--recursive=?libodb=separate + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +bpkg.bindist.archive:--archive-build-meta=+debug +bpkg.create:config.bin.lib=shared +bpkg.create:config.bin.lib.suffix=D +b.create:config.cc.coptions="/W2 /Zi /MDd" +b.create:config.cc.loptions="/DEBUG:FULL" +b.test-installed.create:config.cc.coptions="/W2 /MDd" +b.test-installed.create:config.import.libodb_mysql.odb_mysql.lib=odb-mysqlD +bpkg.test-separate-installed.create:config.cc.coptions="/W2 /MDd" +bpkg.test-separate-installed.create:config.import.libodb_mysql.odb_mysql.lib=odb-mysqlD +bpkg.test-separate-installed.create:config.import.libodb.odb.lib=odbD +b.create:config.cxx.std=c++11 + +{ + config.odb_tests.mysql.user=$getenv(DATABASE_USER) + config.odb_tests.mysql.database=$getenv(DATABASE_NAME) + config.odb_tests.mysql.host=$getenv(DATABASE_HOST) + config.odb_tests.mysql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.mysql.user=$getenv(DATABASE_USER) + config.odb_examples.mysql.database=$getenv(DATABASE_NAME) + config.odb_examples.mysql.host=$getenv(DATABASE_HOST) + config.odb_examples.mysql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + +bindist-windows-release-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -449,20 +589,20 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt6-custom-build-bot: +bindist-windows-debug-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ diff --git a/libodb-mysql/odb/mysql/buildfile b/libodb-mysql/odb/mysql/buildfile index 42e5e88..a2417b2 100644 --- a/libodb-mysql/odb/mysql/buildfile +++ b/libodb-mysql/odb/mysql/buildfile @@ -123,7 +123,6 @@ if $develop diff $d/options.ixx $path($>[1]) >- && \ diff $d/options.cxx $path($>[2]) >- exit - end cp $path($>[0]) $d/options.hxx cp $path($>[1]) $d/options.ixx diff --git a/libodb-mysql/odb/mysql/database.cxx b/libodb-mysql/odb/mysql/database.cxx index 6c0f1d6..f685312 100644 --- a/libodb-mysql/odb/mysql/database.cxx +++ b/libodb-mysql/odb/mysql/database.cxx @@ -326,7 +326,7 @@ namespace odb case select_statement::success: { svi.migration = migration != 0; - assert (st.fetch () == select_statement::no_data); + assert (st.fetch () == select_statement::no_data); // NDEBUG-ok. break; } case select_statement::no_data: diff --git a/libodb-mysql/odb/mysql/details/config.hxx b/libodb-mysql/odb/mysql/details/config.hxx index f093e9d..285a017 100644 --- a/libodb-mysql/odb/mysql/details/config.hxx +++ b/libodb-mysql/odb/mysql/details/config.hxx @@ -4,6 +4,8 @@ #ifndef ODB_MYSQL_DETAILS_CONFIG_HXX #define ODB_MYSQL_DETAILS_CONFIG_HXX +// NOTE: included in public interface (version.hxx.in). + // no pre #ifdef ODB_COMPILER @@ -18,6 +20,43 @@ # define LIBODB_MYSQL_INCLUDE_LONG 1 #endif +// Define LIBODB_MYSQL_MARIADB macro if MariaDB is installed in the +// libmysqlclient compatibility mode. +// +#ifndef LIBODB_MYSQL_MARIADB + +// Note that MariaDB issues the 'should not be included by clients' warning +// when <mysql/mysql_version.h> is included directly. Let's just suppress this +// warning. +// +// Also note that this approach doesn't work for GCC prior to the version 13. +// To suppress this warning for the older GCC versions the -Wno-cpp compiler +// option needs to be specified. +// +# if defined(__clang__) || defined(__GNUC__) +# pragma GCC diagnostic push + +// Note that the older versions of Clang don't recognize the -Wcpp warning +// group. For them we use the synonym -W#warnings instead. +// +# if defined(__clang__) && __clang_major__ < 6 +# pragma GCC diagnostic ignored "-W#warnings" +# else +# pragma GCC diagnostic ignored "-Wcpp" +# endif +# endif + +# include <mysql/mysql_version.h> + +# if defined(__clang__) || defined(__GNUC__) +# pragma GCC diagnostic pop +# endif + +# ifdef MARIADB_VERSION_ID +# define LIBODB_MYSQL_MARIADB +# endif +#endif + // no post #endif // ODB_MYSQL_DETAILS_CONFIG_HXX diff --git a/libodb-mysql/odb/mysql/query.cxx b/libodb-mysql/odb/mysql/query.cxx index a420495..dcb0d19 100644 --- a/libodb-mysql/odb/mysql/query.cxx +++ b/libodb-mysql/odb/mysql/query.cxx @@ -179,7 +179,9 @@ namespace odb s.compare (0, (n = 6), "HAVING") == 0 || s.compare (0, (n = 6), "having") == 0 || s.compare (0, (n = 4), "CALL") == 0 || - s.compare (0, (n = 4), "call") == 0) + s.compare (0, (n = 4), "call") == 0 || + s.compare (0, (n = 4), "WITH") == 0 || + s.compare (0, (n = 4), "with") == 0) { // It either has to be an exact match, or there should be // a whitespace following the keyword. @@ -194,7 +196,7 @@ namespace odb void query_base:: optimize () { - // Remove a single TRUE literal or one that is followe by one of + // Remove a single TRUE literal or one that is followed by one of // the other clauses. This avoids useless WHERE clauses like // // WHERE TRUE GROUP BY foo diff --git a/libodb-mysql/odb/mysql/query.hxx b/libodb-mysql/odb/mysql/query.hxx index d0972c9..0feb626 100644 --- a/libodb-mysql/odb/mysql/query.hxx +++ b/libodb-mysql/odb/mysql/query.hxx @@ -185,8 +185,10 @@ namespace odb append (table, column); } + // Don't use the 'explicit' specifier to support stored procedure + // parameters. + // template <typename T> - explicit query_base (val_bind<T> v) : binding_ (0, 0) { @@ -194,7 +196,6 @@ namespace odb } template <typename T, database_type_id ID> - explicit query_base (val_bind_typed<T, ID> v) : binding_ (0, 0) { @@ -202,7 +203,6 @@ namespace odb } template <typename T> - explicit query_base (ref_bind<T> r) : binding_ (0, 0) { @@ -210,7 +210,6 @@ namespace odb } template <typename T, database_type_id ID> - explicit query_base (ref_bind_typed<T, ID> r) : binding_ (0, 0) { diff --git a/libodb-mysql/odb/mysql/statement.cxx b/libodb-mysql/odb/mysql/statement.cxx index 83f294a..ebca77b 100644 --- a/libodb-mysql/odb/mysql/statement.cxx +++ b/libodb-mysql/odb/mysql/statement.cxx @@ -12,6 +12,8 @@ #include <odb/mysql/statement.hxx> #include <odb/mysql/error.hxx> +#include <odb/mysql/details/config.hxx> // LIBODB_MYSQL_MARIADB + using namespace std; namespace odb @@ -362,9 +364,14 @@ namespace odb translate_error (conn_, stmt_); // mysql_stmt_num_rows() returns the number of rows that have been - // fetched by store_result. + // fetched by store_result for MySQL and the total number of rows + // in the result set for MariaDB. // +#ifndef LIBODB_MYSQL_MARIADB size_ = rows_ + static_cast<size_t> (mysql_stmt_num_rows (stmt_)); +#else + size_ = static_cast<size_t> (mysql_stmt_num_rows (stmt_)); +#endif } else size_ = rows_; @@ -603,6 +610,19 @@ namespace odb if (param_version_ != param_.version) { + // It turns out that MariaDB requires the variable referenced by + // MYSQL_BIND::length member to be initialized even for the NULL + // values. Otherwise, mysql_stmt_execute() may fail with the + // CR_OUT_OF_MEMORY error. + // +#ifdef LIBODB_MYSQL_MARIADB + for (MYSQL_BIND *b (param_.bind), *e (b + param_.count); b != e; ++b) + { + if (b->is_null != 0 && *b->is_null && b->length != 0) + *b->length = 0; + } +#endif + size_t count (process_bind (param_.bind, param_.count)); if (mysql_stmt_bind_param (stmt_, param_.bind)) @@ -710,6 +730,18 @@ namespace odb if (param_version_ != param_.version) { + // It turns out that MariaDB requires the variable referenced by + // MYSQL_BIND::length member to be initialized even for the NULL + // values (see above for details). + // +#ifdef LIBODB_MYSQL_MARIADB + for (MYSQL_BIND *b (param_.bind), *e (b + param_.count); b != e; ++b) + { + if (b->is_null != 0 && *b->is_null && b->length != 0) + *b->length = 0; + } +#endif + size_t count (process_bind (param_.bind, param_.count)); if (mysql_stmt_bind_param (stmt_, param_.bind)) diff --git a/libodb-mysql/odb/mysql/version.hxx.in b/libodb-mysql/odb/mysql/version.hxx.in index 0526554..141c73d 100644 --- a/libodb-mysql/odb/mysql/version.hxx.in +++ b/libodb-mysql/odb/mysql/version.hxx.in @@ -3,6 +3,8 @@ #ifndef LIBODB_MYSQL_VERSION // Note: using the version macro itself. +#include <odb/mysql/details/config.hxx> // LIBODB_MYSQL_MARIADB + // New numeric version format is AAAAABBBBBCCCCCDDDE where: // // AAAAA - major version number @@ -76,6 +78,6 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // 2.2.0.a1 02019901 // 3.0.0.b2 02999952 // -#define LIBODB_MYSQL_VERSION 2049976 +#define LIBODB_MYSQL_VERSION 2059951 #endif // LIBODB_MYSQL_VERSION diff --git a/libodb-mysql/tests/build/bootstrap.build b/libodb-mysql/tests/build/bootstrap.build index 6ee38db..dce9c4c 100644 --- a/libodb-mysql/tests/build/bootstrap.build +++ b/libodb-mysql/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb-oracle/INSTALL b/libodb-oracle/INSTALL deleted file mode 100644 index 51daf9e..0000000 --- a/libodb-oracle/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-oracle - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-oracle/LICENSE b/libodb-oracle/LICENSE index 2581d22..bebb765 100644 --- a/libodb-oracle/LICENSE +++ b/libodb-oracle/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. Permission is granted to use, copy, modify, and distribute this program under the ODB Non-Commercial Use and Evaluation License @@ -18,4 +18,4 @@ ODB Non-Commercial Use and Evaluation License for details. You should have received a copy of the ODB Non-Commercial Use and Evaluation License (normally located in the NCUEL file that is accompanying the distribution); if not, contact Code Synthesis -Tools CC at info@codesynthesis.com. +at info@codesynthesis.com. diff --git a/libodb-oracle/NCUEL b/libodb-oracle/NCUEL index f5211c1..a470ab5 100644..120000 --- a/libodb-oracle/NCUEL +++ b/libodb-oracle/NCUEL @@ -1,294 +1 @@ - ODB NON-COMMERCIAL USE AND EVALUATION LICENSE (NCUEL) - -INTENT - -The intent of this license is to allow you to use ODB with commercial -databases, such as Oracle, Microsoft SQL Server, IBM DB/2, etc., free -of charge non-commercially or for evaluation. - -Furthermore, if a commercial database has a free edition, often called -express edition, such as Oracle Express, Microsoft SQL Server Express, -IBM DB/2 Express-C, etc., that can be used for commercial purposes free -of charge, then this license allows you to use ODB with such an edition -for commercial purposes also free of charge. - -Note also that the development of an application that will be used for -commercial purposes constitutes a commercial use and is not allowed, -except with a free edition of a commercial database. However, this -license allows you to evaluate ODB; that is, to use the Software for -a reasonable period for the purpose of determining its suitability for -a particular application as well as to conduct exploratory development -or proof-of-concept prototyping. - -Finally, any application that uses ODB under this license, whether non- -commercially, for evaluation, or commercially with a free edition of a -database, is subject to the terms and conditions similar to that of the -GPL version 2. In particular, this means that if and when you distribute -your application, you are required to also release its source code. - -If you have any questions concerning this License, please contact us at: -info@codesynthesis.com. - -LEGAL TERMS AND CONDITIONS - -This Code Synthesis Non-Commercial Use and Evaluation License -Agreement for ODB Software ("License") is a legal agreement between -you, the Licensee, (either an individual or a single entity) and Code -Synthesis Tools CC ("Code Synthesis") for non-commercially using, -copying, distributing and modifying the Software and any work derived -from the Software, as defined hereinbelow. Any commercial use, except -as expressly provided in Section 2.1, is subject to a different license. - -By using, modifying, or distributing the Software or any work derived -from the Software, Licensee indicates acceptance of this License and -agrees to be bound by all its terms and conditions for using, copying, -distributing, or modifying the Software and works derived from the -Software. If Licensee is agreeing to this License on behalf of an entity -other than an individual person, Licensee represents that Licensee is -binding and have the right to bind the entity to the terms and conditions -of this agreement. - -These terms and conditions only apply to the ODB components that are -explicitly licensed under this License (normally ODB runtime libraries -for commercial databases). Other ODB components may be licensed under -other licenses and are not affected in any way by the terms and -conditions found in this License. Similarly, ODB components licensed -under this License are not affected by the terms and conditions found -in other licenses. If you are using several ODB components that are -licensed under different licenses, you must comply with the terms and -conditions of each such license. - -No rights are granted to the Software except as expressly set forth -herein. Nothing other than this License grants Licensee permission to -use, copy, distribute or modify the Software or any work derived from -the Software. Licensee may not use, copy, distribute or modify the -Software or any work derived from the Software except as expressly -provided under this License. If Licensee does not accept the terms and -conditions of this License, Licensee shall not use, copy, distribute -or modify the Software. - -In consideration for Licensee's forbearance of commercial use of the -Software, except as expressly provided in Section 2.1, Code Synthesis -grants Licensee non-exclusive, royalty-free and without fees rights -as expressly provided herein. - -1. DEFINITIONS. - -A "commercial database" is a database product that has associated -fees and/or royalties payable for production and/or commercial use -of the database product. Commercial databases include, but are not -limited to, Oracle, Microsoft SQL Server, and IBM DB/2. - -A "free edition of a commercial database" is a special, limited edition -of a commercial database, often called express edition, that does not -require fees and/or royalties for production and/or commercial use. -Free editions of commercial databases include, but are not limited to, -Oracle Express, Microsoft SQL Server Express, and IBM DB/2 Express-C. - -The "Software" is one of the ODB runtime libraries for one of the -commercial databases, including, but not limited to, demo programs, -associated media and printed materials, and any included "on-line" -documentation. - -A "work derived from the Software" is any derivative work as defined -in the copyright law of the nation or state where rights to the work -derived from the Software are exercisable; that is to say, a program -which is linked with or otherwise incorporates the ODB runtime library -or a translation, improvement, enhancement, extension or other -modification of the Software which has sufficient originality to -qualify in such a nation or state as a copyrightable work is a work -derived from the Software. - -To "use" means to execute (i.e. run) the Software. - -To "copy" means to create one or more copies of the Software. - -To "distribute" means to broadcast, publish, transfer, post, upload, -download or otherwise disseminate in any medium to any third party. - -To "modify" means to create a work derived from the Software. - -To "evaluate" means to use the Software for a reasonable period for -the purpose of determining its suitability for a particular application -as well as to conduct exploratory development or proof-of-concept -prototyping. - -A "commercial use" is: - -(1) the use of the Software or any work derived from the Software in -connection with, for or in aid of the generation of revenue, such as -in the conduct of Licensee's daily business operations; or - -(2) any copying, distribution or modification of the Software or any -work derived from the Software to any party where payment or other -consideration is made in connection with such copying, distribution or -modification, whether directly (as in payment for a copy of the -Software) or indirectly (including but not limited to payment for some -good or service related to the Software, or payment for some product -or service that includes a copy of the Software "without charge"). -However, the following actions which involve payment do not in and -of themselves constitute a commercial use: - -(a) posting the Software on a public access information storage and -retrieval service for which a fee is received for retrieving -information (such as an on-line service), provided that the fee is not -content-dependent. Such fees which are not content dependent include, -but are not limited to, fees which are based solely on the storage -capacity required to store the information, and fees which are based -solely on the time required to transfer the information from/to the -public access information storage and retrieval service; and - -(b) distributing the Software on a CD-ROM, provided that the Software -is reproduced entirely and verbatim on such CD-ROM, and provided further -that all information on such CD-ROM may be distributed in a manner which -does not constitute a commercial use. - -2. GRANT OF LICENSE. - -2.1. LICENSE TO USE. -Licensee may use the Software provided that such use does not constitute -a commercial use. - -Licensee may also use the Software commercially with a free edition of a -commercial database, if such an edition is available. If Licensee -distributes works derived from the Software and such works may be used -commercially by third parties, Licensee must cause such commercial use -to be limited to a free edition of a commercial database. - -2.2. LICENSE TO EVALUATE. -Licensee may evaluation the Software for commercial use. - -2.3. LICENSE TO COPY AND DISTRIBUTE. -Licensee may copy and distribute literal (i.e., verbatim) copies of the -Software as Licensee receives it throughout the world, in any medium, -provided that Licensee distributes an unmodified, easily-readable copy -of this License with the Software, and provided further that such -distribution does not constitute a commercial use. - -2.4. LICENSE TO CREATE WORKS DERIVED FROM THE SOFTWARE. -Licensee may create works derived from the Software, provided that any -such work derived from the Software carries prominent notices stating -both the manner in which Licensee has created a work derived from the -Software (for example, notices stating that the work derived from the -Software is linked with or otherwise incorporates the ODB runtime -library, or notices stating that the work derived from the Software -is an enhancement to the Software which Licensee has created) and the -date any such work derived from the Software was created. - -2.5. LICENSE TO COPY AND DISTRIBUTE WORKS DERIVED FROM THE SOFTWARE. -Licensee may copy and distribute works derived from the Software -throughout the world, provided that Licensee distributes an -unmodified, easily-readable copy of this License with such works -derived from the Software, and provided further that such distribution -does not constitute a commercial use. Licensee must cause any work -derived from the Software that Licensee distributes to be licensed as -a whole and at no charge to all third parties under the terms of this -License or another free/open source license that does not restrict any -rights of any third party that would have been granted should such work -have been licensed under this License. - -Any work derived from the Software must be accompanied by the complete -corresponding machine-readable source code of such work derived from -the Software, delivered on a medium customarily used for software -interchange. The source code for the work derived from the Software -means the preferred form of the work derived from the Software for -making modifications to it. For an executable work derived from the -Software, complete source code means all of the source code for all -modules of the work derived from the Software, all associated -interface definition files and all scripts used to control compilation -and installation of all or any part of the work derived from the -Software. However, the source code delivered need not include anything -that is normally distributed, in either source code or binary (object- -code) form, with major components (including but not limited to -compilers, linkers, and kernels) of the operating system on which the -executable work derived from the Software runs, unless that component -itself accompanies the executable code of the work derived from the -Software. - -Furthermore, if the executable code or object code of the work derived -from the Software may be copied from a designated place, and if the -source code of the work derived from the Software may be copied from -the same place, then the work derived from the Software shall be -construed as accompanied by the complete corresponding machine-readable -source code of such work derived from the Software, even though third -parties are not compelled to copy the source code along with the -executable code or object code. - -If the work derived from the Software normally reads commands -interactively when run, Licensee must cause the work derived from the -Software, at each time it commences operation, to print or display an -announcement including either a notice consisting of the verbatim -warranty and liability provisions of this License, or a notice that -Licensee, and not Code Synthesis provides a warranty. - -Licensee may not impose any further restrictions on the exercise of -the rights granted herein by any recipient of any work derived from -the Software. - -3. RESTRICTIONS. - -Licensee acknowledges that the Software is protected by copyright laws -and international copyright treaties, as well as other intellectual -property laws and treaties. The Software is licensed, not sold. All -title and copyrights in and to the Software are owned exclusively by -Code Synthesis. - -Licensee may not sublicense, assign or transfer this License, the -Software or any work derived from the Software except as permitted by -this License. - -Licensee is expressly prohibited from using, copying, distributing, -studying the source code, or otherwise examining the Software for -the purpose of reverse engineering or duplicating its functionality -(unless enforcement of this restrictions is prohibited by applicable -law). - -4. LIMITED WARRANTY. - -4.1 NO WARRANTIES. -CODE SYNTHESIS EXPRESSLY DISCLAIMS ANY WARRANTY FOR THE SOFTWARE. THE -SOFTWARE IS PROVIDED TO LICENSEE "AS IS," WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE USE, -QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH LICENSEE. SHOULD THE -SOFTWARE PROVE DEFECTIVE, LICENSEE ASSUMES THE COST OF ALL NECESSARY -SERVICING, REPAIR OR CORRECTION. - -4.2. NO LIABILITY FOR DAMAGES. -IN NO EVENT WILL CODE SYNTHESIS, OR ANY OTHER PARTY WHO MAY COPY, -DISTRIBUTE OR MODIFY THE SOFTWARE AS PERMITTED HEREIN, BE LIABLE FOR -ANY GENERAL, DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL -DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF -BUSINESS PROFITS, BUSINESS INTERRUPTION, INACCURATE INFORMATION, LOSS -OF INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR -INABILITY TO USE THE SOFTWARE, EVEN IF CODE SYNTHESIS OR SUCH OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -5. TERMINATION. - -Any violation or any attempt to violate any of the terms and conditions -of this License will automatically terminate Licensee's rights under -this License. Licensee further agrees upon such termination to cease -any and all using, copying, distributing and modifying of the Software -and any work derived from the Software, and further to destroy any and -all of Licensee's copies of the Software and any work derived from the -Software. - -However, parties who have received copies of the Software or copies of -any work derived from the Software, or rights, from Licensee under this -License will not have their licenses terminated so long as such parties -remain in full compliance with this License. - -6. LICENSE SCOPE AND MODIFICATION. - -This License sets forth the entire agreement between Licensee and Code -Synthesis and supersedes all prior agreements and understandings between -the parties relating to the subject matter hereof. None of the terms of -this License may be waived or modified except as expressly agreed in -writing by both Licensee and Code Synthesis. - -7. SEVERABILITY. - -Should any provision of this License be declared void or unenforceable, -the validity of the remaining provisions shall not be affected thereby. +../NCUEL
\ No newline at end of file diff --git a/libodb-oracle/PACKAGE-README.md b/libodb-oracle/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-oracle/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-oracle/README b/libodb-oracle/README deleted file mode 100644 index 3e51928..0000000 --- a/libodb-oracle/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the Oracle ODB runtime library. Every application -that includes code generated for the Oracle database will need to link -to this library. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-oracle/README.md b/libodb-oracle/README.md new file mode 100644 index 0000000..e60dd74 --- /dev/null +++ b/libodb-oracle/README.md @@ -0,0 +1,15 @@ +# libodb-oracle - Oracle ODB runtime library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the Oracle ODB runtime library. Applications that +include code generated for the Oracle database will need to link this library. + +This runtime library in turn depends on OCI, Oracle client library. diff --git a/libodb-oracle/buildfile b/libodb-oracle/buildfile index db1aceb..1f4ff19 100644 --- a/libodb-oracle/buildfile +++ b/libodb-oracle/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : ODB NCUEL; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{NCUEL LICENSE} manifest +./: {*/ -build/}\ + doc{README.md PACKAGE-README.md NEWS} \ + legal{NCUEL LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-oracle/manifest b/libodb-oracle/manifest index 3192a63..bb9e6bf 100644 --- a/libodb-oracle/manifest +++ b/libodb-oracle/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-oracle -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: Oracle ODB runtime library license: other: ODB NCUEL ; Non-Commercial Use and Evaluation License. license: other: proprietary ; Not free/open source. topics: C++, ORM, Oracle, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -15,14 +16,11 @@ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com requires: c++11 requires: oci ; Oracle Call Interface library. - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- depends: libodb == $ -depends: * cli ^1.2.0- ? ($config.libodb_oracle.develop) +depends: * cli ^1.2.0 ? ($config.libodb_oracle.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=oracle @@ -42,7 +40,7 @@ builds: none ; Requires proprietary software. # Instead of the default configuration (see odb-{tests,examples} for # background). # -custom-builds: latest ; Requires proprietary software. +custom-builds: default ; Requires proprietary software. custom-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. @@ -63,11 +61,17 @@ custom-build-config: config.odb_examples.oracle.port=$getenv(DATABASE_PORT) config.odb_examples.oracle.service=$getenv(DATABASE_SERVICE) }+ odb-examples + +# Configure odb-{tests,examples} packages' dependency libodb as system on the +# bpkg.test-separate-installed.configure.build step, since it is already +# installed as a dependency of libodb-oracle. +# +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # Instead of the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires proprietary software. +custom-multi-builds: default ; Requires proprietary software. custom-multi-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. @@ -82,13 +86,15 @@ custom-multi-build-config: config.odb_tests.oracle.port=$getenv(DATABASE_PORT) config.odb_tests.oracle.service=$getenv(DATABASE_SERVICE) }+ odb-tests + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # The {boost,qt5,qt6}-custom configurations replace the # {boost,qt5,qt6}-default configurations (see odb-{tests,examples} for # background). # -boost-custom-builds: latest ; Requires proprietary software. +boost-custom-builds: default ; Requires proprietary software. boost-custom-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. @@ -114,9 +120,11 @@ boost-custom-build-config: config.odb_examples.oracle.port=$getenv(DATABASE_PORT) config.odb_examples.oracle.service=$getenv(DATABASE_SERVICE) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt5-custom-builds: latest ; Requires proprietary software. +qt5-custom-builds: default ; Requires proprietary software. qt5-custom-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. @@ -142,9 +150,11 @@ qt5-custom-build-config: config.odb_examples.oracle.port=$getenv(DATABASE_PORT) config.odb_examples.oracle.service=$getenv(DATABASE_SERVICE) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt6-custom-builds: latest ; Requires proprietary software. +qt6-custom-builds: default ; Requires proprietary software. qt6-custom-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. @@ -170,6 +180,8 @@ qt6-custom-build-config: config.odb_examples.oracle.port=$getenv(DATABASE_PORT) config.odb_examples.oracle.service=$getenv(DATABASE_SERVICE) }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ custom-build-bot: @@ -190,24 +202,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -226,24 +220,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -262,24 +238,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -298,24 +256,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -333,21 +273,3 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv 9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ - -qt6-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ diff --git a/libodb-oracle/odb/oracle/buildfile b/libodb-oracle/odb/oracle/buildfile index 8f6716a..c9fe4f1 100644 --- a/libodb-oracle/odb/oracle/buildfile +++ b/libodb-oracle/odb/oracle/buildfile @@ -119,7 +119,6 @@ if $develop diff $d/options.ixx $path($>[1]) >- && \ diff $d/options.cxx $path($>[2]) >- exit - end cp $path($>[0]) $d/options.hxx cp $path($>[1]) $d/options.ixx diff --git a/libodb-oracle/odb/oracle/database.cxx b/libodb-oracle/odb/oracle/database.cxx index 3b720be..c840ab3 100644 --- a/libodb-oracle/odb/oracle/database.cxx +++ b/libodb-oracle/odb/oracle/database.cxx @@ -326,7 +326,7 @@ namespace odb value_traits<unsigned long long, id_big_int>::set_value ( svi.version, version, rsize[0], rind[0] == -1); svi.migration = migration != 0; - assert (st.fetch () == select_statement::no_data); + assert (st.fetch () == select_statement::no_data); // NDEBUG-ok. break; } case select_statement::no_data: diff --git a/libodb-oracle/odb/oracle/query.cxx b/libodb-oracle/odb/oracle/query.cxx index 890e1db..397955e 100644 --- a/libodb-oracle/odb/oracle/query.cxx +++ b/libodb-oracle/odb/oracle/query.cxx @@ -195,7 +195,7 @@ namespace odb void query_base:: optimize () { - // Remove a single TRUE literal or one that is followe by one of + // Remove a single TRUE literal or one that is followed by one of // the other clauses. This avoids useless WHERE clauses like // // WHERE TRUE GROUP BY foo diff --git a/libodb-oracle/odb/oracle/version.hxx.in b/libodb-oracle/odb/oracle/version.hxx.in index c13ce47..e4e5724 100644 --- a/libodb-oracle/odb/oracle/version.hxx.in +++ b/libodb-oracle/odb/oracle/version.hxx.in @@ -56,6 +56,6 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // 2.2.0.a1 02019901 // 3.0.0.b2 02999952 // -#define LIBODB_ORACLE_VERSION 2049976 +#define LIBODB_ORACLE_VERSION 2059951 #endif // LIBODB_ORACLE_VERSION diff --git a/libodb-oracle/tests/build/bootstrap.build b/libodb-oracle/tests/build/bootstrap.build index 895126c..8802c76 100644 --- a/libodb-oracle/tests/build/bootstrap.build +++ b/libodb-oracle/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb-pgsql/GPLv2 b/libodb-pgsql/GPLv2 index 3912109..08e5586 100644..120000 --- a/libodb-pgsql/GPLv2 +++ b/libodb-pgsql/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/libodb-pgsql/INSTALL b/libodb-pgsql/INSTALL deleted file mode 100644 index 32df42c..0000000 --- a/libodb-pgsql/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-pgsql - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-pgsql/LICENSE b/libodb-pgsql/LICENSE index d96b938..bed2288 100644 --- a/libodb-pgsql/LICENSE +++ b/libodb-pgsql/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -16,5 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 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 St, Fifth Floor, Boston, MA 02110-1301 USA +version 2 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com.
\ No newline at end of file diff --git a/libodb-pgsql/PACKAGE-README.md b/libodb-pgsql/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-pgsql/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-pgsql/README b/libodb-pgsql/README deleted file mode 100644 index c4c3e28..0000000 --- a/libodb-pgsql/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the PostgreSQL ODB runtime library. Every -application that includes code generated for the PostgreSQL database -will need to link to this library. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-pgsql/README.md b/libodb-pgsql/README.md new file mode 100644 index 0000000..61f9498 --- /dev/null +++ b/libodb-pgsql/README.md @@ -0,0 +1,16 @@ +# libodb-pgsql - PostgreSQL ODB runtime library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the PostgreSQL ODB runtime library. Applications that +include code generated for the PostgreSQL database will need to link this +library. + +This runtime library in turn depends on `libpq`, PostgreSQL client library. diff --git a/libodb-pgsql/build/root.build b/libodb-pgsql/build/root.build index 329cc45..c7f7759 100644 --- a/libodb-pgsql/build/root.build +++ b/libodb-pgsql/build/root.build @@ -3,6 +3,12 @@ config [bool] config.libodb_pgsql.develop ?= false +# Enable the dependency on the psql package to, for example, ease its bundling +# into the binary distribution package (see the bindist-windows-* package +# build configurations hack for the use case). +# +config [bool] config.libodb_pgsql.psql ?= false + cxx.std = latest using cxx diff --git a/libodb-pgsql/buildfile b/libodb-pgsql/buildfile index a04e206..631a236 100644 --- a/libodb-pgsql/buildfile +++ b/libodb-pgsql/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : GNU GPL v2; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{GPLv2 LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv2 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-pgsql/manifest b/libodb-pgsql/manifest index 1a9a865..3c59441 100644 --- a/libodb-pgsql/manifest +++ b/libodb-pgsql/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-pgsql -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: PostgreSQL ODB runtime library license: GPL-2.0-only license: other: proprietary ; Not free/open source. topics: C++, ORM, PostgreSQL, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -14,15 +15,13 @@ src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com requires: c++11 - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- depends: libpq >= 7.4.0 +depends: psql >= 7.4.0 ? ($config.libodb_pgsql.psql) depends: libodb == $ -depends: * cli ^1.2.0- ? ($config.libodb_pgsql.develop) +depends: * cli ^1.2.0 ? ($config.libodb_pgsql.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=pgsql @@ -51,6 +50,14 @@ default-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +# Configure odb-{tests,examples} packages' dependencies libodb and libpq as +# system on the bpkg.test-separate-installed.configure.build step, since they +# are already installed as dependencies of libodb-pqsql. +# +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ # Only build this package configuration where it can be tested via odb-tests @@ -72,12 +79,16 @@ multi-build-config: config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ # Complements the default configuration (see odb-{tests,examples} for # background). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: default ; Requires default config with GCC as host compiler. custom-builds: -wasm custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. @@ -96,11 +107,15 @@ custom-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ # Complements the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires latest config with GCC as host compiler. +custom-multi-builds: default ; Requires default config with GCC as host compiler. custom-multi-builds: -wasm custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. @@ -114,6 +129,10 @@ custom-multi-build-config: config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ # Only build the {boost,qt5,qt6}-default package configurations where they can @@ -146,6 +165,10 @@ boost-default-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ qt5-default-builds: default @@ -174,6 +197,10 @@ qt5-default-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ qt6-default-builds: default @@ -202,13 +229,17 @@ qt6-default-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ # The {boost,qt5,qt6}-custom configurations complement the # {boost,qt5,qt6}-default configurations (see odb-{tests,examples} for # background). # -boost-custom-builds: latest ; Requires latest config with GCC as host compiler. +boost-custom-builds: default ; Requires default config with GCC as host compiler. boost-custom-builds: -wasm boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. @@ -232,9 +263,13 @@ boost-custom-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ -qt5-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt5-custom-builds: default ; Requires default config with GCC as host compiler. qt5-custom-builds: -wasm qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. @@ -258,9 +293,13 @@ qt5-custom-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ -qt6-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt6-custom-builds: default ; Requires default config with GCC as host compiler. qt6-custom-builds: -wasm qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. @@ -284,6 +323,10 @@ qt6-custom-build-config: config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) }+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } \ custom-build-bot: @@ -304,24 +347,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -340,24 +365,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -376,25 +383,25 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: +qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ -qt5-custom-build-bot: +qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -412,25 +419,170 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: +# Binary distribution packages. Overall notes: +# +# - Build as C++11 for maximum compatibility (this is a C++11 codebase). + +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: \ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- ++bpkg.bindist.debian: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +?sys:libpq +?sys:psql + +{ + config.odb_tests.pgsql.user=$getenv(DATABASE_USER) + config.odb_tests.pgsql.database=$getenv(DATABASE_NAME) + config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) + config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.pgsql.user=$getenv(DATABASE_USER) + config.odb_examples.pgsql.database=$getenv(DATABASE_NAME) + config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) + config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt6-custom-build-bot: +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: +\ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +?sys:libpq +?sys:psql + +{ + config.odb_tests.pgsql.user=$getenv(DATABASE_USER) + config.odb_tests.pgsql.database=$getenv(DATABASE_NAME) + config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) + config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.pgsql.user=$getenv(DATABASE_USER) + config.odb_examples.pgsql.database=$getenv(DATABASE_NAME) + config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) + config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + +# Windows binary distribution archives (release and debug). +# +# - Bundle the dependencies (libpq, etc) with --recursive=full, so that if the +# user needs to link any of these libraries directly, they can use their +# bundled versions, compatible with libodb-pgsql. +# +# - Also bundle the database client program so that the user can use it, if +# they need to. Only for release. +# +# - Don't bundle libodb since it is packaged separately. +# +# - For Debug we only produce the shared library (if we wanted to also do +# static, then would need to use /Z7), adding the `D` suffix to the library +# name. +# +bindist-windows-release-builds: bindist +bindist-windows-release-build-include: windows*-msvc** +bindist-windows-release-build-exclude: ** +#bindist-windows-release-build-bot: -- see below. +bindist-windows-release-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=full +bpkg.bindist.archive:--recursive=?libodb=separate + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +b.create:config.cc.coptions="/W2 /O2" +b.create:config.cxx.std=c++11 + +{ config.libodb_pgsql.psql=true }+ libodb-pgsql + +{ + config.odb_tests.pgsql.user=$getenv(DATABASE_USER) + config.odb_tests.pgsql.database=$getenv(DATABASE_NAME) + config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) + config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.pgsql.user=$getenv(DATABASE_USER) + config.odb_examples.pgsql.database=$getenv(DATABASE_NAME) + config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) + config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } +\ + +bindist-windows-debug-builds: bindist +bindist-windows-debug-build-include: windows*-msvc** +bindist-windows-debug-build-exclude: ** +#bindist-windows-debug-build-bot: -- see below. +bindist-windows-debug-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=full +bpkg.bindist.archive:--recursive=?libodb=separate + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +bpkg.bindist.archive:--archive-build-meta=+debug +bpkg.create:config.bin.lib=shared +bpkg.create:config.bin.lib.suffix=D +b.create:config.cc.coptions="/W2 /Zi /MDd" +b.create:config.cc.loptions="/DEBUG:FULL" +b.test-installed.create:config.cc.coptions="/W2 /MDd" +b.test-installed.create:config.import.libodb_pgsql.odb_pgsql.lib=odb-pgsqlD +bpkg.test-separate-installed.create:config.cc.coptions="/W2 /MDd" +bpkg.test-separate-installed.create:config.import.libodb_pgsql.odb_pgsql.lib=odb-pgsqlD +bpkg.test-separate-installed.create:config.import.libodb.odb.lib=odbD +bpkg.test-separate-installed.create:config.import.libpq.pq.lib=pqD +b.create:config.cxx.std=c++11 + +{ + config.odb_tests.pgsql.user=$getenv(DATABASE_USER) + config.odb_tests.pgsql.database=$getenv(DATABASE_NAME) + config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) + config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-tests + +{ + config.odb_examples.pgsql.user=$getenv(DATABASE_USER) + config.odb_examples.pgsql.database=$getenv(DATABASE_NAME) + config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) + config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-examples + +{ + --config-uuid=00000000-0000-0000-0000-000000000005 +}+ { ?sys:libodb/* ?sys:libpq/* } +\ + +bindist-windows-release-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -448,20 +600,20 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt6-custom-build-bot: +bindist-windows-debug-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ diff --git a/libodb-pgsql/odb/pgsql/buildfile b/libodb-pgsql/odb/pgsql/buildfile index 57d38f0..9979d12 100644 --- a/libodb-pgsql/odb/pgsql/buildfile +++ b/libodb-pgsql/odb/pgsql/buildfile @@ -40,6 +40,11 @@ lib{odb-pgsql}: liba{odb-pgsql}: cxx.export.poptions += -DLIBODB_PGSQL_STATIC libs{odb-pgsql}: cxx.export.poptions += -DLIBODB_PGSQL_SHARED +# Required for pipelining support on Windows. +# +if ($cxx.target.class == 'windows') + cxx.libs += ($cxx.target.system == 'mingw32' ? -lws2_32 : ws2_32.lib) + # For pre-releases use the complete version to make sure they cannot be used # in place of another pre-release or the final version. See the version module # for details on the version.* variable values. @@ -113,7 +118,6 @@ if $develop diff $d/options.ixx $path($>[1]) >- && \ diff $d/options.cxx $path($>[2]) >- exit - end cp $path($>[0]) $d/options.hxx cp $path($>[1]) $d/options.ixx diff --git a/libodb-pgsql/odb/pgsql/database.cxx b/libodb-pgsql/odb/pgsql/database.cxx index 09bf6f0..303ec13 100644 --- a/libodb-pgsql/odb/pgsql/database.cxx +++ b/libodb-pgsql/odb/pgsql/database.cxx @@ -353,7 +353,7 @@ namespace odb { case select_statement::success: { - assert (st.fetch () == select_statement::no_data); + assert (st.fetch () == select_statement::no_data); // NDEBUG-ok. break; } case select_statement::no_data: @@ -393,7 +393,7 @@ namespace odb { value_traits<unsigned long long, id_bigint>::set_value ( svi.version, version, rnull[0]); - assert (st.fetch () == select_statement::no_data); + assert (st.fetch () == select_statement::no_data); // NDEBUG-ok. break; } case select_statement::no_data: diff --git a/libodb-pgsql/odb/pgsql/details/endian-traits.cxx b/libodb-pgsql/odb/pgsql/details/endian-traits.cxx deleted file mode 100644 index 77fdc95..0000000 --- a/libodb-pgsql/odb/pgsql/details/endian-traits.cxx +++ /dev/null @@ -1,30 +0,0 @@ -// file : odb/pgsql/details/endian-traits.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include <odb/pgsql/details/endian-traits.hxx> - -namespace odb -{ - namespace pgsql - { - namespace details - { - namespace - { - endian_traits::endian - infer_host_endian () - { - short s (1); - char* c (reinterpret_cast<char*> (&s)); - - return *c == 0 ? - endian_traits::big : - endian_traits::little; - } - } - - const endian_traits::endian endian_traits::host_endian ( - infer_host_endian ()); - } - } -} diff --git a/libodb-pgsql/odb/pgsql/details/endian-traits.hxx b/libodb-pgsql/odb/pgsql/details/endian-traits.hxx index 532a4a3..81db665 100644 --- a/libodb-pgsql/odb/pgsql/details/endian-traits.hxx +++ b/libodb-pgsql/odb/pgsql/details/endian-traits.hxx @@ -9,6 +9,67 @@ #include <odb/pgsql/details/export.hxx> +// Note: the following byte order macro definitions are copied from the +// BYTE_ORDER.h header file of the libbuild2-autoconf package. + +/* Include the endianness header based on platform. + * + * Each of these headers should define BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN, + * AND PDP_ENDIAN but this can be affected by macros like _ANSI_SOURCE, + * _POSIX_C_SOURCE, _XOPEN_SOURCE and _NETBSD_SOURCE, depending on the + * platform (in which case most of them define underscored versions only). + */ +#if defined(__GLIBC__) || defined(__OpenBSD__) +# include <endian.h> +#elif defined(__FreeBSD__) || defined(__NetBSD__) +# include <sys/endian.h> +#elif defined(__APPLE__) +# include <machine/endian.h> +#elif !defined(_WIN32) +# include <sys/param.h> +#endif + +/* Try various system- and compiler-specific byte order macro names if the + * endianness headers did not define BYTE_ORDER. + */ +#if !defined(BYTE_ORDER) +# if defined(__linux__) +# if defined(__BYTE_ORDER) +# define BYTE_ORDER __BYTE_ORDER +# define BIG_ENDIAN __BIG_ENDIAN +# define LITTLE_ENDIAN __LITTLE_ENDIAN +# endif +# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +# if defined(_BYTE_ORDER) +# define BYTE_ORDER _BYTE_ORDER +# define BIG_ENDIAN _BIG_ENDIAN +# define LITTLE_ENDIAN _LITTLE_ENDIAN +# endif +# elif defined(__APPLE__) +# if defined(__DARWIN_BYTE_ORDER) +# define BYTE_ORDER __DARWIN_BYTE_ORDER +# define BIG_ENDIAN __DARWIN_BIG_ENDIAN +# define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +# endif +# elif defined(_WIN32) +# define BIG_ENDIAN 4321 +# define LITTLE_ENDIAN 1234 +# define BYTE_ORDER LITTLE_ENDIAN +# elif defined(__BYTE_ORDER__) && \ + defined(__ORDER_BIG_ENDIAN__) && \ + defined(__ORDER_LITTLE_ENDIAN__) + /* GCC, Clang (and others, potentially). + */ +# define BYTE_ORDER __BYTE_ORDER__ +# define BIG_ENDIAN __ORDER_BIG_ENDIAN__ +# define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ +# endif +#endif + +#ifndef BYTE_ORDER +# error no byte order macros defined +#endif + namespace odb { // @@ Revise this. @@ -124,28 +185,26 @@ namespace odb class LIBODB_PGSQL_EXPORT endian_traits { public: - enum endian - { - big, - little - }; - - public: - static const endian host_endian; - - public: template <typename T> static T hton (T x) { - return host_endian == big ? x : swap_endian<T>::swap (x); +#if BYTE_ORDER == BIG_ENDIAN + return x; +#else + return swap_endian<T>::swap (x); +#endif } template <typename T> static T ntoh (T x) { - return host_endian == big ? x : swap_endian<T>::swap (x); +#if BYTE_ORDER == BIG_ENDIAN + return x; +#else + return swap_endian<T>::swap (x); +#endif } }; } diff --git a/libodb-pgsql/odb/pgsql/pgsql-oid.hxx b/libodb-pgsql/odb/pgsql/pgsql-oid.hxx index e2ef1af..8db6068 100644 --- a/libodb-pgsql/odb/pgsql/pgsql-oid.hxx +++ b/libodb-pgsql/odb/pgsql/pgsql-oid.hxx @@ -37,6 +37,8 @@ namespace odb bit_oid = 1560, varbit_oid = 1562, + void_oid = 2278, + uuid_oid = 2950 }; } diff --git a/libodb-pgsql/odb/pgsql/query.cxx b/libodb-pgsql/odb/pgsql/query.cxx index b096c97..687829c 100644 --- a/libodb-pgsql/odb/pgsql/query.cxx +++ b/libodb-pgsql/odb/pgsql/query.cxx @@ -272,7 +272,9 @@ namespace odb s.compare (0, (n = 6), "HAVING") == 0 || s.compare (0, (n = 6), "having") == 0 || s.compare (0, (n = 4), "WITH") == 0 || - s.compare (0, (n = 4), "with") == 0) + s.compare (0, (n = 4), "with") == 0 || + s.compare (0, (n = 4), "CALL") == 0 || + s.compare (0, (n = 4), "call") == 0) { // It either has to be an exact match, or there should be // a whitespace following the keyword. @@ -281,13 +283,25 @@ namespace odb return true; } + // Note that the '/*CALL*/' prefix is normally used as a hint for the + // ODB compiler for the SELECT statements in the view definitions that + // are used for the stored function calls. Since the ODB compiler + // removes this prefix from these statements, this check is actually not + // necessary for them. We, however, still recognize this prefix at + // runtime in case the user specify it on the query call site rather + // than in the view definition. Also note that we don't remove the + // prefix here since PostgreSQL allows comments in SQL statements. + // + if (s.compare (0, (n = 8), "/*CALL*/") == 0) + return true; + return false; } void query_base:: optimize () { - // Remove a single TRUE literal or one that is followe by one of + // Remove a single TRUE literal or one that is followed by one of // the other clauses. This avoids useless WHERE clauses like // // WHERE TRUE GROUP BY foo diff --git a/libodb-pgsql/odb/pgsql/query.hxx b/libodb-pgsql/odb/pgsql/query.hxx index 42182d6..051e5d0 100644 --- a/libodb-pgsql/odb/pgsql/query.hxx +++ b/libodb-pgsql/odb/pgsql/query.hxx @@ -192,8 +192,10 @@ namespace odb append (table, column); } + // Don't use the 'explicit' specifier to support stored procedure and + // function parameters. + // template <typename T> - explicit query_base (val_bind<T> v) : binding_ (0, 0), native_binding_ (0, 0, 0, 0) { @@ -201,7 +203,6 @@ namespace odb } template <typename T, database_type_id ID> - explicit query_base (val_bind_typed<T, ID> v) : binding_ (0, 0), native_binding_ (0, 0, 0, 0) { @@ -209,7 +210,6 @@ namespace odb } template <typename T> - explicit query_base (ref_bind<T> r) : binding_ (0, 0), native_binding_ (0, 0, 0, 0) { @@ -217,7 +217,6 @@ namespace odb } template <typename T, database_type_id ID> - explicit query_base (ref_bind_typed<T, ID> r) : binding_ (0, 0), native_binding_ (0, 0, 0, 0) { diff --git a/libodb-pgsql/odb/pgsql/statement.cxx b/libodb-pgsql/odb/pgsql/statement.cxx index 03d58cd..af70f76 100644 --- a/libodb-pgsql/odb/pgsql/statement.cxx +++ b/libodb-pgsql/odb/pgsql/statement.cxx @@ -9,6 +9,8 @@ # ifndef _WIN32 # include <errno.h> # include <sys/select.h> +# else +# include <winsock2.h> # endif #endif @@ -558,17 +560,27 @@ namespace odb } } - // Make sure that the number of columns in the result returned by - // the database matches the number that we expect. A common cause - // of this assertion is a native view with a number of data members - // not matching the number of columns in the SELECT-list. + // Make sure that the number of columns in the result returned by the + // database matches the number that we expect. A common cause of this + // assertion is a native view with a number of data members not matching + // the number of columns in the SELECT-list. // - assert (col == col_count); + // The only legitimate case for such a mismatch is the native view which + // calls the void-returning function and which has no members in the + // associated structure. Such a function, unless it is returns SETOF, + // produces a single row with a single column containing the NULL value + // (see odb-tests/pgsql/stored-proc/ test for details). + // + assert (col == col_count || + (bs.count == 0 && + col_count == 1 && + row == 0 && + PQftype (result, 0) == void_oid)); return r; } -#if defined(LIBPQ_HAS_PIPELINING) && !defined(_WIN32) +#if defined(LIBPQ_HAS_PIPELINING) // Note that this function always marks the connection as failed. // @@ -650,10 +662,16 @@ namespace odb FD_ZERO (&rds); FD_SET (sock, &rds); +#ifndef _WIN32 if (select (sock + 1, &rds, write ? &wds : 0, 0, 0) != -1) break; if (errno != EINTR) +#else + if (select (sock + 1, &rds, write ? &wds : 0, 0, 0) != SOCKET_ERROR) + break; + else +#endif { if (throw_) translate_connection_error (conn); @@ -1241,7 +1259,7 @@ namespace odb return true; } -#if defined(LIBPQ_HAS_PIPELINING) && !defined(_WIN32) +#if defined(LIBPQ_HAS_PIPELINING) struct insert_data { @@ -1380,7 +1398,7 @@ namespace odb return affected_row_count (h); } -#if defined(LIBPQ_HAS_PIPELINING) && !defined(_WIN32) +#if defined(LIBPQ_HAS_PIPELINING) static bool process_update_result (size_t i, PGresult* r, bool gr, void* data) @@ -1506,7 +1524,7 @@ namespace odb return affected_row_count (h); } -#if defined(LIBPQ_HAS_PIPELINING) && !defined(_WIN32) +#if defined(LIBPQ_HAS_PIPELINING) static bool process_delete_result (size_t i, PGresult* r, bool gr, void* data) diff --git a/libodb-pgsql/odb/pgsql/version.hxx.in b/libodb-pgsql/odb/pgsql/version.hxx.in index db8b152..7dda036 100644 --- a/libodb-pgsql/odb/pgsql/version.hxx.in +++ b/libodb-pgsql/odb/pgsql/version.hxx.in @@ -56,6 +56,6 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // 2.2.0.a1 02019901 // 3.0.0.b2 02999952 // -#define LIBODB_PGSQL_VERSION 2049976 +#define LIBODB_PGSQL_VERSION 2059951 #endif // LIBODB_PGSQL_VERSION diff --git a/libodb-pgsql/odb/pgsql/view-statements.hxx b/libodb-pgsql/odb/pgsql/view-statements.hxx index 970e610..e774497 100644 --- a/libodb-pgsql/odb/pgsql/view-statements.hxx +++ b/libodb-pgsql/odb/pgsql/view-statements.hxx @@ -75,8 +75,12 @@ namespace odb image_type image_; std::size_t image_version_; binding image_binding_; - bind image_bind_[view_traits::column_count]; - bool image_truncated_[view_traits::column_count]; + bind image_bind_[view_traits::column_count != 0 + ? view_traits::column_count + : 1]; + bool image_truncated_[view_traits::column_count != 0 + ? view_traits::column_count + : 1]; }; } } diff --git a/libodb-pgsql/tests/build/bootstrap.build b/libodb-pgsql/tests/build/bootstrap.build index 6ee38db..dce9c4c 100644 --- a/libodb-pgsql/tests/build/bootstrap.build +++ b/libodb-pgsql/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb-qt/GPLv2 b/libodb-qt/GPLv2 index 3912109..08e5586 100644..120000 --- a/libodb-qt/GPLv2 +++ b/libodb-qt/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/libodb-qt/INSTALL b/libodb-qt/INSTALL deleted file mode 100644 index 5c67dce..0000000 --- a/libodb-qt/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-boost - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-qt/LICENSE b/libodb-qt/LICENSE index d96b938..bed2288 100644 --- a/libodb-qt/LICENSE +++ b/libodb-qt/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -16,5 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 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 St, Fifth Floor, Boston, MA 02110-1301 USA +version 2 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com.
\ No newline at end of file diff --git a/libodb-qt/PACKAGE-README.md b/libodb-qt/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-qt/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-qt/README b/libodb-qt/README deleted file mode 100644 index cf85909..0000000 --- a/libodb-qt/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the Qt profile library. The Qt profile provides -support for persisting Qt smart pointers, containers, and value types -with the ODB system. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-qt/README.md b/libodb-qt/README.md new file mode 100644 index 0000000..9b29248 --- /dev/null +++ b/libodb-qt/README.md @@ -0,0 +1,14 @@ +# libodb-qt - Qt ODB profile library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the Qt ODB profile library. The Qt profile provides +support for persisting Qt smart pointers, containers, and value types. Note +that both Qt5 and Qt6 are supported. diff --git a/libodb-qt/buildfile b/libodb-qt/buildfile index 8a0d6d9..631a236 100644 --- a/libodb-qt/buildfile +++ b/libodb-qt/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : GNU GPL v2; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv2 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-qt/manifest b/libodb-qt/manifest index b848077..4b396d3 100644 --- a/libodb-qt/manifest +++ b/libodb-qt/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-qt -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: Qt ODB profile library license: GPL-2.0-only license: other: proprietary ; Not free/open source. topics: C++, ORM, Qt, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -15,10 +16,121 @@ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com builds: all requires: c++11 +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. +depends: libodb == $ + +# Binary distribution packages. Overall notes: # -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +# - Build as C++11 for maximum compatibility (this is a C++11 codebase). -depends: libodb == $ +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: +\ ++bpkg.bindist.debian: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +\ + +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: +\ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +\ + +# Windows binary distribution archives (release and debug). +# +# - Don't bundle libodb dependency, assuming that the archive will normally be +# extracted into the directory with the database-specific runtime libraries +# and, thus, containing libodb. +# +# - Build using the same custom bot which is used to build libodb. +# +# - For Debug we only produce the shared library (if we wanted to also do +# static, then would need to use /Z7), adding the `D` suffix to the library +# name. +# +bindist-windows-release-builds: bindist +bindist-windows-release-build-include: windows*-msvc** +bindist-windows-release-build-exclude: ** +#bindist-windows-release-build-bot: -- see below. +bindist-windows-release-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +b.create:config.cc.coptions="/W2 /O2" +b.create:config.cxx.std=c++11 +\ + +bindist-windows-debug-builds: bindist +bindist-windows-debug-build-include: windows*-msvc** +bindist-windows-debug-build-exclude: ** +#bindist-windows-debug-build-bot: -- see below. +bindist-windows-debug-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +bpkg.bindist.archive:--archive-build-meta=+debug +bpkg.create:config.bin.lib=shared +bpkg.create:config.bin.lib.suffix=D +b.create:config.cc.coptions="/W2 /Zi /MDd" +b.create:config.cc.loptions="/DEBUG:FULL" +b.test-installed.create:config.cc.coptions="/W2 /MDd" +b.test-installed.create:config.import.libodb_qt.odb_qt.lib=odb-qtD +b.create:config.cxx.std=c++11 +\ + +bindist-windows-release-build-bot: +\ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== +-----END PUBLIC KEY----- +\ + +bindist-windows-debug-build-bot: +\ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== +-----END PUBLIC KEY----- +\ diff --git a/libodb-qt/odb/qt/containers/list.hxx b/libodb-qt/odb/qt/containers/list.hxx index 90ad660..18fbd92 100644 --- a/libodb-qt/odb/qt/containers/list.hxx +++ b/libodb-qt/odb/qt/containers/list.hxx @@ -38,6 +38,14 @@ public: typedef QList<T> base_list_type; typedef typename base_list_type::iterator base_iterator_type; + typedef typename base_list_type::size_type size_type; + typedef T value_type; + typedef value_type *pointer; + typedef const value_type *const_pointer; + typedef value_type &reference; + typedef const value_type &const_reference; + typedef typename base_list_type::difference_type difference_type; + QOdbList() {} QOdbList(const QOdbList &x): vector_base (x), l_ (x.l_) {} // ~QOdbList(); @@ -67,7 +75,7 @@ public: bool operator==(const QList<T> &x) const {return l_ == x;} bool operator!=(const QList<T> &x) const {return l_ != x;} - int size() const {return l_.size ();} + size_type size() const {return l_.size ();} void detach() {l_.detach ();} #if QT_VERSION < 0x060000 @@ -82,31 +90,32 @@ public: bool isEmpty() const {return l_.isEmpty ();} void clear(); - const T &at(int i) const {return l_.at (i);} - const T &operator[](int i) const {return l_[i];} - //T &operator[](int i); - T &modify (int i); + const T &at(size_type i) const {return l_.at (i);} + const T &operator[](size_type i) const {return l_[i];} + //T &operator[](size_type i); + T &modify (size_type i); - void reserve(int size); + void reserve(size_type size); void append(const T &t); void append(const QList<T> &t); // Implicit conversion. void prepend(const T &t); - void insert(int i, const T &t); - void replace(int i, const T &t); - void removeAt(int i); - int removeAll(const T &t); + void insert(size_type i, const T &t); + void replace(size_type i, const T &t); + void removeAt(size_type i); + size_type removeAll(const T &t); bool removeOne(const T &t); - T takeAt(int i); + T takeAt(size_type i); T takeFirst(); T takeLast(); - void move(int from, int to); - void swap(int i, int j); + void move(size_type from, size_type to); + void swap(size_type i, size_type j); - int indexOf(const T &t, int from = 0) const {return l_.indexOf (t, from);} - int lastIndexOf(const T &t, int from = -1) const + size_type indexOf(const T &t, size_type from = 0) const + {return l_.indexOf (t, from);} + size_type lastIndexOf(const T &t, size_type from = -1) const {return l_.lastIndexOf (t, from);} bool contains(const T &t) const {return l_.contains (t);} - int count(const T &t) const {return l_.count (t);} + size_type count(const T &t) const {return l_.count (t);} typedef QOdbListIteratorImpl<QOdbList> iterator; typedef typename base_list_type::const_iterator const_iterator; @@ -137,8 +146,8 @@ public: typedef iterator Iterator; typedef const_iterator ConstIterator; - int count() const {return l_.count ();} - int length() const {return l_.length ();} + size_type count() const {return l_.count ();} + size_type length() const {return l_.length ();} //T& first(); T& modifyFirst(); const T& first() const {return l_.first ();} @@ -149,10 +158,11 @@ public: void removeLast(); bool startsWith(const T &t) const {return l_.startsWith (t);} bool endsWith(const T &t) const {return l_.endsWith (t);} - QList<T> mid(int pos, int length = -1) const {return l_.mid (pos, length);} + QList<T> mid(size_type pos, size_type length = -1) const + {return l_.mid (pos, length);} - T value(int i) const {return l_.value (i);} - T value(int i, const T &defValue) const {return l_.value (i, defValue);} + T value(size_type i) const {return l_.value (i);} + T value(size_type i, const T &defValue) const {return l_.value (i, defValue);} // stl compatibility void push_back(const T &t) {append(t);} @@ -167,14 +177,6 @@ public: void pop_back() {removeLast();} bool empty() const {return l_.empty ();} - typedef int size_type; - typedef T value_type; - typedef value_type *pointer; - typedef const value_type *const_pointer; - typedef value_type &reference; - typedef const value_type &const_reference; - typedef typename base_list_type::difference_type difference_type; - // comfort // Implicit conversion. QOdbList &operator+=(const QList<T> &l) {append (l); return *this;} @@ -264,12 +266,12 @@ public: QOdbListIteratorImpl operator-- (int) {return QOdbListIteratorImpl (l_, i_--);} - QOdbListIteratorImpl operator+ (int n) const + QOdbListIteratorImpl operator+ (size_type n) const {return QOdbListIteratorImpl (l_, i_ + n);} - QOdbListIteratorImpl& operator+= (int n) {i_ += n; return *this;} - QOdbListIteratorImpl operator- (int n) const + QOdbListIteratorImpl& operator+= (size_type n) {i_ += n; return *this;} + QOdbListIteratorImpl operator- (size_type n) const {return QOdbListIteratorImpl (l_, i_ - n);} - QOdbListIteratorImpl& operator-= (int n) {i_ -= n; return *this;} + QOdbListIteratorImpl& operator-= (size_type n) {i_ -= n; return *this;} private: list_type* l_; diff --git a/libodb-qt/odb/qt/containers/list.ixx b/libodb-qt/odb/qt/containers/list.ixx index 53106e3..8137de8 100644 --- a/libodb-qt/odb/qt/containers/list.ixx +++ b/libodb-qt/odb/qt/containers/list.ixx @@ -68,7 +68,7 @@ clear() template <typename T> inline T& QOdbList<T>:: -modify (int i) +modify (size_type i) { T& r (l_[i]); if (_tracking ()) @@ -78,7 +78,7 @@ modify (int i) template <typename T> inline void QOdbList<T>:: -reserve (int n) +reserve (size_type n) { l_.reserve (n); if (_tracking ()) @@ -114,7 +114,7 @@ prepend (const T& x) template <typename T> inline void QOdbList<T>:: -insert (int i, const T& x) +insert (size_type i, const T& x) { l_.insert (i, x); if (_tracking ()) @@ -123,7 +123,7 @@ insert (int i, const T& x) template <typename T> inline void QOdbList<T>:: -replace (int i, const T& x) +replace (size_type i, const T& x) { l_.insert (i, x); if (_tracking ()) @@ -132,7 +132,7 @@ replace (int i, const T& x) template <typename T> inline void QOdbList<T>:: -removeAt (int i) +removeAt (size_type i) { l_.removeAt (i); if (_tracking ()) @@ -140,14 +140,14 @@ removeAt (int i) } template <typename T> -inline int QOdbList<T>:: +inline typename QOdbList<T>::size_type QOdbList<T>:: removeAll (const T& x) { // We have to re-implement this one ourselves since we need to // know the indexes of the removed elements. // - int r (0); - for (int i (l_.indexOf (x)); i != -1; i = l_.indexOf (x, i)) + size_type r (0); + for (size_type i (l_.indexOf (x)); i != -1; i = l_.indexOf (x, i)) { removeAt (i); r++; @@ -162,7 +162,7 @@ removeOne (const T& x) // We have to re-implement this one ourselves since we need to // know the index of the removed element. // - int i (l_.indexOf (x)); + size_type i (l_.indexOf (x)); if (i != -1) removeAt (i); return i != -1; @@ -170,7 +170,7 @@ removeOne (const T& x) template <typename T> inline T QOdbList<T>:: -takeAt (int i) +takeAt (size_type i) { if (_tracking ()) impl_.erase (static_cast<std::size_t> (i)); @@ -197,7 +197,7 @@ takeLast () template <typename T> inline void QOdbList<T>:: -move (int from, int to) +move (size_type from, size_type to) { l_.move (from, to); if (_tracking ()) @@ -209,7 +209,7 @@ move (int from, int to) template <typename T> inline void QOdbList<T>:: -swap (int i, int j) +swap (size_type i, size_type j) { l_.swapItemsAt (i, j); if (_tracking ()) diff --git a/libodb-qt/odb/qt/version.hxx.in b/libodb-qt/odb/qt/version.hxx.in index b95bec3..f941d8d 100644 --- a/libodb-qt/odb/qt/version.hxx.in +++ b/libodb-qt/odb/qt/version.hxx.in @@ -61,14 +61,14 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // // NOTE: also hardcoded in *.options. // -#define ODB_QT_VERSION 2047600 -#define ODB_QT_VERSION_STR "2.5.0-b.26" +#define ODB_QT_VERSION 2055100 +#define ODB_QT_VERSION_STR "2.6.0-b.1" // libodb-qt version: odb interface version plus the bugfix version. Note // that LIBODB_QT_VERSION is always greater or equal to ODB_QT_VERSION // since if the Qt interface virsion is incremented then the bugfix version // must be incremented as well. // -#define LIBODB_QT_VERSION 2049976 +#define LIBODB_QT_VERSION 2059951 #endif // LIBODB_QT_VERSION diff --git a/libodb-qt/odb/qt/version.options b/libodb-qt/odb/qt/version.options index 0fef537..f670dc7 100644 --- a/libodb-qt/odb/qt/version.options +++ b/libodb-qt/odb/qt/version.options @@ -11,6 +11,6 @@ # --hxx-prologue '#include <odb/qt/version.hxx>' ---hxx-prologue '#if ODB_QT_VERSION != 2047600 // 2.5.0-b.26' +--hxx-prologue '#if ODB_QT_VERSION != 2055100 // 2.6.0-b.1' --hxx-prologue '# error ODB and C++ compilers see different libodb-qt interface versions' --hxx-prologue '#endif' diff --git a/libodb-qt/tests/build/bootstrap.build b/libodb-qt/tests/build/bootstrap.build index 6ee38db..dce9c4c 100644 --- a/libodb-qt/tests/build/bootstrap.build +++ b/libodb-qt/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb-sqlite/GPLv2 b/libodb-sqlite/GPLv2 index 3912109..08e5586 100644..120000 --- a/libodb-sqlite/GPLv2 +++ b/libodb-sqlite/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/libodb-sqlite/INSTALL b/libodb-sqlite/INSTALL deleted file mode 100644 index 3eb4c33..0000000 --- a/libodb-sqlite/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb-sqlite - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb-sqlite/LICENSE b/libodb-sqlite/LICENSE index d96b938..bed2288 100644 --- a/libodb-sqlite/LICENSE +++ b/libodb-sqlite/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -16,5 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 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 St, Fifth Floor, Boston, MA 02110-1301 USA +version 2 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com.
\ No newline at end of file diff --git a/libodb-sqlite/PACKAGE-README.md b/libodb-sqlite/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb-sqlite/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb-sqlite/README b/libodb-sqlite/README deleted file mode 100644 index ffd4049..0000000 --- a/libodb-sqlite/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the SQLite ODB runtime library. Every application -that includes code generated for the SQLite database will need to link -to this library. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb-sqlite/README.md b/libodb-sqlite/README.md new file mode 100644 index 0000000..e4e5e71 --- /dev/null +++ b/libodb-sqlite/README.md @@ -0,0 +1,23 @@ +# libodb-sqlite - SQLite ODB runtime library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the SQLite ODB runtime library. Applications that +include code generated for the SQLite database will need to link this library. + +This runtime library in turn depends on `libsqlite3`, SQLite client library. + +If you plan to access an SQLite database from multiple threads, then you will +need SQLite version `3.5.0` or later built with the unlock notify feature +(`SQLITE_ENABLE_UNLOCK_NOTIFY`) enabled. + +If you plant to use SQLite incremental BLOB/TEXT I/O support, then you will +need SQLite version `3.4.0` or later built with the column metadata functions +(`SQLITE_ENABLE_COLUMN_METADATA`) enabled. diff --git a/libodb-sqlite/build/root.build b/libodb-sqlite/build/root.build index a1975db..e3f455a 100644 --- a/libodb-sqlite/build/root.build +++ b/libodb-sqlite/build/root.build @@ -3,6 +3,12 @@ config [bool] config.libodb_sqlite.develop ?= false +# Enable the dependency on the sqlite3 package to, for example, ease its +# bundling into the binary distribution package (see the bindist-windows-* +# package build configurations hack for the use case). +# +config [bool] config.libodb_sqlite.sqlite3 ?= false + cxx.std = latest using cxx diff --git a/libodb-sqlite/buildfile b/libodb-sqlite/buildfile index a04e206..631a236 100644 --- a/libodb-sqlite/buildfile +++ b/libodb-sqlite/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : GNU GPL v2; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{GPLv2 LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv2 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb-sqlite/manifest b/libodb-sqlite/manifest index f47879e..4f0136f 100644 --- a/libodb-sqlite/manifest +++ b/libodb-sqlite/manifest @@ -1,12 +1,13 @@ : 1 name: libodb-sqlite -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: SQLite ODB runtime library license: GPL-2.0-only license: other: proprietary ; Not free/open source. topics: C++, ORM, SQLite, SQL -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -14,15 +15,13 @@ src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com requires: c++11 - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- depends: libsqlite3 ^3.6.18 +depends: sqlite3 ^3.6.18 ? ($config.libodb_sqlite.sqlite3) depends: libodb == $ -depends: * cli ^1.2.0- ? ($config.libodb_sqlite.develop) +depends: * cli ^1.2.0 ? ($config.libodb_sqlite.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=sqlite @@ -32,6 +31,15 @@ examples: odb-examples == $ \ builds: all +# Configure odb-{tests,examples} packages' dependency libodb as system on the +# bpkg.test-separate-installed.configure.build step, since it is already +# installed as a dependency of libodb-sqlite. +# +default-build-config: +\ +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + # Only build this package configuration where it can be tested via odb-tests # package (see its manifest for details). # @@ -40,21 +48,35 @@ multi-builds: -( +windows -gcc ) ; Requires MinGW GCC. multi-builds: &gcc ; Requires GCC with plugin support enabled. multi-builds: &gcc-5+ ; Requires GCC 5 or later. multi-builds: -static ; Implementation uses plugins and requires -fPIC. -multi-build-config: { config.odb_tests.multi_database=true }+ odb-tests +multi-build-config: +\ +{ config.odb_tests.multi_database=true }+ odb-tests + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ # Complements the default configuration (see odb-{tests,examples} for # background). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: default ; Requires default config with GCC as host compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. +custom-build-config: +\ +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ # Complements the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires latest config with GCC as host compiler. +custom-multi-builds: default ; Requires default config with GCC as host compiler. custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. -custom-multi-build-config: { config.odb_tests.multi_database=true }+ odb-tests +custom-multi-build-config: +\ +{ config.odb_tests.multi_database=true }+ odb-tests + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ # Only build the {boost,qt5,qt6}-default package configurations where they can # be tested via odb-{tests,examples} packages (see their manifest for @@ -70,6 +92,8 @@ boost-default-build-config: \ { config.odb_tests.boost=true }+ odb-tests { config.odb_examples.boost=true }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ qt5-default-builds: default @@ -82,6 +106,8 @@ qt5-default-build-config: \ { config.odb_tests.qt=5 }+ odb-tests { config.odb_examples.qt=5 }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ qt6-default-builds: default @@ -94,13 +120,15 @@ qt6-default-build-config: \ { config.odb_tests.qt=6 }+ odb-tests { config.odb_examples.qt=6 }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ # The {boost,qt5,qt6}-custom configurations complement the # {boost,qt5,qt6}-default configurations (see odb-{tests,examples} for # background). # -boost-custom-builds: latest ; Requires latest config with GCC as host compiler. +boost-custom-builds: default ; Requires default config with GCC as host compiler. boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. #boost-custom-build-bot: -- see below. @@ -108,9 +136,11 @@ boost-custom-build-config: \ { config.odb_tests.boost=true }+ odb-tests { config.odb_examples.boost=true }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt5-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt5-custom-builds: default ; Requires default config with GCC as host compiler. qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. #qt5-custom-build-bot: -- see below. @@ -118,9 +148,11 @@ qt5-custom-build-config: \ { config.odb_tests.qt=5 }+ odb-tests { config.odb_examples.qt=5 }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt6-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt6-custom-builds: default ; Requires default config with GCC as host compiler. qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. #qt6-custom-build-bot: -- see below. @@ -128,6 +160,8 @@ qt6-custom-build-config: \ { config.odb_tests.qt=6 }+ odb-tests { config.odb_examples.qt=6 }+ odb-examples + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ custom-build-bot: @@ -148,24 +182,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -184,24 +200,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -220,25 +218,25 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: +qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ -qt5-custom-build-bot: +qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -256,25 +254,107 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: +# Binary distribution packages. Overall notes: +# +# - Build as C++11 for maximum compatibility (this is a C++11 codebase). + +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: +\ ++bpkg.bindist.debian: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +?sys:libsqlite3 + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- + +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: +\ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 +?sys:libsqlite3 + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* \ -qt6-custom-build-bot: +# Windows binary distribution archives (release and debug). +# +# - Bundle the dependencies (libsqlite3) with --recursive=full, so that if the +# user needs to link any of these libraries directly, they can use their +# bundled versions, compatible with libodb-sqlite. +# +# - Also bundle the database client program so that the user can use it, if +# they need to. Only for release. +# +# - Don't bundle libodb since it is packaged separately. +# +# - For Debug we only produce the shared library (if we wanted to also do +# static, then would need to use /Z7), adding the `D` suffix to the library +# name. +# +bindist-windows-release-builds: bindist +bindist-windows-release-build-include: windows*-msvc** +bindist-windows-release-build-exclude: ** +#bindist-windows-release-build-bot: -- see below. +bindist-windows-release-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=full +bpkg.bindist.archive:--recursive=?libodb=separate + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +b.create:config.cc.coptions="/W2 /O2" +b.create:config.cxx.std=c++11 + +{ config.libodb_sqlite.sqlite3=true }+ libodb-sqlite + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + +bindist-windows-debug-builds: bindist +bindist-windows-debug-build-include: windows*-msvc** +bindist-windows-debug-build-exclude: ** +#bindist-windows-debug-build-bot: -- see below. +bindist-windows-debug-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=full +bpkg.bindist.archive:--recursive=?libodb=separate + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +bpkg.bindist.archive:--archive-build-meta=+debug +bpkg.create:config.bin.lib=shared +bpkg.create:config.bin.lib.suffix=D +b.create:config.cc.coptions="/W2 /Zi /MDd" +b.create:config.cc.loptions="/DEBUG:FULL" +b.test-installed.create:config.cc.coptions="/W2 /MDd" +b.test-installed.create:config.import.libodb_sqlite.odb_sqlite.lib=odb-sqliteD +bpkg.test-separate-installed.create:config.cc.coptions="/W2 /MDd" +bpkg.test-separate-installed.create:config.import.libodb_sqlite.odb_sqlite.lib=odb-sqliteD +bpkg.test-separate-installed.create:config.import.libodb.odb.lib=odbD +b.create:config.cxx.std=c++11 + +{ --config-uuid=00000000-0000-0000-0000-000000000005 }+ ?sys:libodb/* +\ + +bindist-windows-release-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -292,20 +372,20 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt6-custom-build-bot: +bindist-windows-debug-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ diff --git a/libodb-sqlite/odb/sqlite/buildfile b/libodb-sqlite/odb/sqlite/buildfile index 69d2425..afd286e 100644 --- a/libodb-sqlite/odb/sqlite/buildfile +++ b/libodb-sqlite/odb/sqlite/buildfile @@ -113,7 +113,6 @@ if $develop diff $d/options.ixx $path($>[1]) >- && \ diff $d/options.cxx $path($>[2]) >- exit - end cp $path($>[0]) $d/options.hxx cp $path($>[1]) $d/options.ixx diff --git a/libodb-sqlite/odb/sqlite/database.cxx b/libodb-sqlite/odb/sqlite/database.cxx index a7cf098..90d383f 100644 --- a/libodb-sqlite/odb/sqlite/database.cxx +++ b/libodb-sqlite/odb/sqlite/database.cxx @@ -272,7 +272,7 @@ namespace odb case select_statement::success: { svi.migration = migration != 0; - assert (st.fetch () == select_statement::no_data); + assert (st.fetch () == select_statement::no_data); // NDEBUG-ok. break; } case select_statement::no_data: diff --git a/libodb-sqlite/odb/sqlite/database.hxx b/libodb-sqlite/odb/sqlite/database.hxx index e1e62cc..341e563 100644 --- a/libodb-sqlite/odb/sqlite/database.hxx +++ b/libodb-sqlite/odb/sqlite/database.hxx @@ -84,9 +84,9 @@ namespace odb details::transfer_ptr<connection_factory> ()); // Attach to the specified connection a database with the specified name - // as the specified schema. Good understanding of SQLite ATTACH/DETACH - // DATABASE statements semantics and ODB connection management is - // strongly recommended when using this mechanism. + // as the specified schema. Good understanding of the SQLite + // ATTACH/DETACH DATABASE statements semantics and ODB connection + // management is strongly recommended when using this mechanism. // // The resulting database instance is referred to as an "attached // database" and the connection it returns as an "attached connection" @@ -128,7 +128,7 @@ namespace odb // you want just SQLITE_OPEN_READWRITE, then you will need to verify its // existence manually prior to calling this constructor. // - // Note that attaching/detaching databases withing a transaction is only + // Note that attaching/detaching databases within a transaction is only // supported since SQLite 3.21.0. // database (const connection_ptr&, diff --git a/libodb-sqlite/odb/sqlite/query.cxx b/libodb-sqlite/odb/sqlite/query.cxx index 98eb1cd..34d6d65 100644 --- a/libodb-sqlite/odb/sqlite/query.cxx +++ b/libodb-sqlite/odb/sqlite/query.cxx @@ -226,7 +226,7 @@ namespace odb void query_base:: optimize () { - // Remove a single TRUE literal or one that is followe by one of + // Remove a single TRUE literal or one that is followed by one of // the other clauses. This avoids useless WHERE clauses like // // WHERE TRUE GROUP BY foo diff --git a/libodb-sqlite/odb/sqlite/version.hxx.in b/libodb-sqlite/odb/sqlite/version.hxx.in index c100d57..4fbc39f 100644 --- a/libodb-sqlite/odb/sqlite/version.hxx.in +++ b/libodb-sqlite/odb/sqlite/version.hxx.in @@ -56,6 +56,6 @@ $libodb.check(LIBODB_VERSION_FULL, LIBODB_SNAPSHOT)$ // 2.2.0.a1 02019901 // 3.0.0.b2 02999952 // -#define LIBODB_SQLITE_VERSION 2049976 +#define LIBODB_SQLITE_VERSION 2059951 #endif // LIBODB_SQLITE_VERSION diff --git a/libodb-sqlite/tests/build/bootstrap.build b/libodb-sqlite/tests/build/bootstrap.build index 6ee38db..dce9c4c 100644 --- a/libodb-sqlite/tests/build/bootstrap.build +++ b/libodb-sqlite/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/libodb/GPLv2 b/libodb/GPLv2 index 3912109..08e5586 100644..120000 --- a/libodb/GPLv2 +++ b/libodb/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/libodb/INSTALL b/libodb/INSTALL deleted file mode 100644 index 46b79ad..0000000 --- a/libodb/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build libodb - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/libodb/LICENSE b/libodb/LICENSE index d96b938..223a362 100644 --- a/libodb/LICENSE +++ b/libodb/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -16,5 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 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 St, Fifth Floor, Boston, MA 02110-1301 USA +version 2 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com. diff --git a/libodb/PACKAGE-README.md b/libodb/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/libodb/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/libodb/README b/libodb/README deleted file mode 100644 index 902e20b..0000000 --- a/libodb/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the common ODB runtime library. Every application -that includes code generated by the ODB compiler will need to link to -this library. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/libodb/README.md b/libodb/README.md new file mode 100644 index 0000000..0de3ab7 --- /dev/null +++ b/libodb/README.md @@ -0,0 +1,13 @@ +# libodb - common ODB runtime library + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the common ODB runtime library. Applications that +include code generated by the ODB compiler will need to link this library. diff --git a/libodb/buildfile b/libodb/buildfile index a04e206..631a236 100644 --- a/libodb/buildfile +++ b/libodb/buildfile @@ -1,9 +1,11 @@ # file : buildfile # license : GNU GPL v2; see accompanying LICENSE file -./: {*/ -build/} doc{INSTALL NEWS README} legal{GPLv2 LICENSE} manifest +./: {*/ -build/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv2 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# Don't install tests. # -tests/: install = false -doc{INSTALL}@./: install = false +tests/: install = false diff --git a/libodb/manifest b/libodb/manifest index 6052338..bc21dfd 100644 --- a/libodb/manifest +++ b/libodb/manifest @@ -1,12 +1,13 @@ : 1 name: libodb -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb summary: Common ODB runtime library license: GPL-2.0-only license: other: proprietary ; Not free/open source. topics: C++, ORM, SQL, object persistence, relational database -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml @@ -14,11 +15,8 @@ src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com requires: c++11 - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- tests: odb-tests == $ ? ($config.odb_tests.libodb_test) examples: odb-examples == $ ? ($config.odb_examples.libodb_example) @@ -70,7 +68,7 @@ multi-build-config: # Complements the default configuration (see odb-{tests,examples} for # background). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: default ; Requires default config with GCC as host compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. custom-build-config: @@ -88,7 +86,7 @@ custom-build-config: # Complements the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires latest config with GCC as host compiler. +custom-multi-builds: default ; Requires default config with GCC as host compiler. custom-multi-builds: -wasm ; Not supported by libodb-{mysql,pgsql}. custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. custom-multi-build-auxiliary-mysql: *-mysql_* @@ -114,7 +112,7 @@ custom-multi-build-config: # Complements the multi configuration (see libodb-oracle for background). # -custom-multi-oracle-builds: latest ; Requires proprietary software. +custom-multi-oracle-builds: default ; Requires proprietary software. custom-multi-oracle-builds: -wasm ; Not supported by libodb-{mysql,pgsql,oracle}. custom-multi-oracle-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. custom-multi-oracle-builds: -static ; Implementation uses plugins and requires -fPIC. @@ -148,7 +146,7 @@ custom-multi-oracle-build-config: # Complements the multi configuration (see libodb-mssql for background). # -custom-multi-mssql-builds: latest ; Requires proprietary software. +custom-multi-mssql-builds: default ; Requires proprietary software. custom-multi-mssql-builds: -wasm ; Not supported by libodb-{mysql,pgsql,mssql}. custom-multi-mssql-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. custom-multi-mssql-builds: -static ; Implementation uses plugins and requires -fPIC. @@ -199,24 +197,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -235,25 +215,25 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: +custom-multi-oracle-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ -custom-multi-oracle-build-bot: +custom-multi-mssql-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -271,25 +251,121 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-oracle-build-bot: +# Binary distribution packages. Overall notes: +# +# - Build as C++11 for maximum compatibility (this is a C++11 codebase). + +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: \ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- ++bpkg.bindist.debian: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 + +{ + config.odb_tests.libodb_test=true + config.odb_tests.database=sqlite +}+ odb-tests + +{ + config.odb_examples.libodb_example=true + config.odb_examples.database=sqlite +}+ odb-examples \ -custom-multi-mssql-build-bot: +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: +\ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +b.create:config.cxx.std=c++11 + +{ + config.odb_tests.libodb_test=true + config.odb_tests.database=sqlite +}+ odb-tests + +{ + config.odb_examples.libodb_example=true + config.odb_examples.database=sqlite +}+ odb-examples +\ + +# Windows binary distribution archives (release and debug). +# +# - For Debug we only produce the shared library (if we wanted to also do +# static, then would need to use /Z7), adding the `D` suffix to the library +# name. +# +bindist-windows-release-builds: bindist +bindist-windows-release-build-include: windows*-msvc** +bindist-windows-release-build-exclude: ** +#bindist-windows-release-build-bot: -- see below. +bindist-windows-release-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +b.create:config.cc.coptions="/W2 /O2" +b.create:config.cxx.std=c++11 + +{ + config.odb_tests.libodb_test=true + config.odb_tests.database=sqlite +}+ odb-tests + +{ + config.odb_examples.libodb_example=true + config.odb_examples.database=sqlite +}+ odb-examples +\ + +bindist-windows-debug-builds: bindist +bindist-windows-debug-build-include: windows*-msvc** +bindist-windows-debug-build-exclude: ** +#bindist-windows-debug-build-bot: -- see below. +bindist-windows-debug-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +bpkg.bindist.archive:--archive-build-meta=+debug +bpkg.create:config.bin.lib=shared +bpkg.create:config.bin.lib.suffix=D +b.create:config.cc.coptions="/W2 /Zi /MDd" +b.create:config.cc.loptions="/DEBUG:FULL" +b.test-installed.create:config.cc.coptions="/W2 /MDd" +b.test-installed.create:config.import.libodb.odb.lib=odbD +bpkg.test-separate-installed.create:config.cc.coptions="/W2 /MDd" +bpkg.test-separate-installed.create:config.import.libodb.odb.lib=odbD +b.create:config.cxx.std=c++11 + +{ + config.odb_tests.libodb_test=true + config.odb_tests.database=sqlite +}+ odb-tests + +{ + config.odb_examples.libodb_example=true + config.odb_examples.database=sqlite +}+ odb-examples +\ + +bindist-windows-release-build-bot: \ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M @@ -307,20 +383,20 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-mssql-build-bot: +bindist-windows-debug-build-bot: \ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuF4YmJmPHY52Q6N+YO0M +lt/fCovdezleb2tVplyTnvbyAiPdmYCIIjVrsqUn3y46PdFtWEiSdsrCcncoxi6H +8KelOB/oQ9pNTyEvwGKEH5ZIU7noLZYdXEfoNdvdL/pbY/7uLBZOSekfdQShZtbe +uOZCM2Mhg2DD76TP/VAwaXuDCnEvxxU/yneUl5ZaBo62AWNrYJuSGAliCOpVpl6X +X1kbHOvnCx7c9e3LxgaVivPaeZRKYg0OaFt96SBYEZzNPvjA8pMuKuj/vatHaCQ3 +NO9+r3TJ+4dQd7qN6Ju3zUJq9J/ndSh4lPvUalvvhdykecefhcyHwRZOG4xyFMFE +nJM4sM+aZu6WoKATIKtk7On70inVr0sZJXwJ4Lt4oqaK2VthcSTby3wf2Yv4p5hL +zNo31cCPmBRYzABcIc6ADYvexVK4uCwaim8xs7RK5Ug2Gv6vUWoRNZW8grIgDwUY +5pZ4Zk3hW4ii2vehTaVrrmdW6XipIsT+ayiVX7eWuHHNxAeCojXVjOJu9B0ExMlD +5tHZCs+SNdV5MceexecbptB7fZtRebP120yjLiSnZ5FpaQ1stusr0hSg+VQaX4np +f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv +9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ diff --git a/libodb/odb/nested-container.hxx b/libodb/odb/nested-container.hxx index d7e4ec1..b911525 100644 --- a/libodb/odb/nested-container.hxx +++ b/libodb/odb/nested-container.hxx @@ -23,6 +23,8 @@ namespace odb // vector<vector<V>>, as map<nested_key, V> where nested_key is a composite // key consisting of the outer and inner container indexes. // + // See container-nested in odb-examples for some examples. + // // Note that with this approach the empty trailing entries of the outer // container will not be added on load. It is assumed that the user handles // that on their own, for example, by pre-loading the outer container entry @@ -95,10 +97,9 @@ namespace odb } #include <map> -#include <cstddef> // size_t #include <utility> // move(), declval() #include <cassert> -#include <type_traits> // remove_reference +#include <type_traits> // remove_reference, enable_if, is_same namespace odb { @@ -114,18 +115,19 @@ namespace odb struct nested3_type: std::remove_reference<decltype (std::declval<C> ()[0][0][0])> {}; - // 1-level nesting. + // 1-level nesting of std::vector-like containers. // - template <typename OC> // For example, OC = vector<vector<V>>. - std::map<nested_key<typename nested1_type<OC>::type>, - typename nested2_type<OC>::type> + template <typename OC, // For example, OC = vector<vector<V>>. + typename K = nested_key<typename nested1_type<OC>::type>> + typename std::enable_if<std::is_same<typename OC::value_type, + typename nested1_type<OC>::type>::value, + std::map<K, typename nested2_type<OC>::type>>::type nested_get (const OC& oc) { using namespace std; using IC = typename nested1_type<OC>::type; using V = typename nested2_type<OC>::type; - using K = nested_key<IC>; map<K, V> r; for (size_t o (0); o != oc.size (); ++o) @@ -137,47 +139,167 @@ namespace odb return r; } - template <typename K, typename V, typename OC> - void + template <typename OC, typename K, typename V> + typename std::enable_if< + std::is_same<typename OC::value_type, + typename nested1_type<OC>::type>::value>::type nested_set (OC& oc, std::map<K, V>&& r) { using namespace std; + // Cleanup the nested containers before (re-)loading. + // + // Note that the entries of the outer container may potentially be value + // types derived from a container type. This value type may potentially + // override the container's clear() function (its signature is quite + // common). Thus, to clean up the nested containers let's use their + // erase(iterator,iterator) function, which is unlikely to be overridden + // by the value type. + // + for (auto& c: oc) + c.erase (c.begin (), c.end ()); + + for (auto& p: r) + { + size_t o (p.first.outer); + V& v (p.second); + + if (o >= oc.size ()) + oc.resize (o + 1); + + assert (p.first.inner == oc[o].size ()); + + oc[o].push_back (move (v)); + } + } + + // 1-level nesting in std::vector-like containers of value types which + // contain std::vector-like containers. + // + template <typename OC, // For example, OC = vector<T1> (class T1{ IC m; }). + typename IC, // For example, IC = vector<T2>. + typename K = nested_key<IC>> + typename std::enable_if<std::is_same<typename OC::value_type, + typename nested1_type<OC>::type>::value, + std::map<K, typename nested1_type<IC>::type>>::type + nested_get (const OC& oc, IC OC::value_type::* m) + { + using namespace std; + + using V = typename nested1_type<IC>::type; + + map<K, V> r; + for (size_t o (0); o != oc.size (); ++o) + { + const IC& ic (oc[o].*m); + for (size_t i (0); i != ic.size (); ++i) + r.emplace (K (o, i), ic[i]); + } + return r; + } + + template <typename OC, typename IC, typename K, typename V> + typename std::enable_if< + std::is_same<typename OC::value_type, + typename nested1_type<OC>::type>::value>::type + nested_set (OC& oc, IC OC::value_type::* m, std::map<K, V>&& r) + { + using namespace std; + + for (auto& o: oc) + { + auto& c (o.*m); + c.erase (c.begin (), c.end ()); + } + for (auto& p: r) { size_t o (p.first.outer); - size_t i (p.first.inner); V& v (p.second); if (o >= oc.size ()) oc.resize (o + 1); - assert (i == oc[o].size ()); + IC& ic (oc[o].*m); + + assert (p.first.inner == ic.size ()); + + ic.push_back (move (v)); + } + } + + // 1-level nesting in std::map-like containers of std::vector-like + // containers. + // + template <typename OC, // For example, OC = map<K,vector<V>>. + typename K = nested_key<typename OC::mapped_type, + typename OC::key_type>> + typename std::enable_if< + std::is_same<typename OC::mapped_type, + typename OC::value_type::second_type>::value, + std::map<K, typename nested1_type<typename OC::mapped_type>::type>>::type + nested_get (const OC& oc) + { + using namespace std; + + using IC = typename OC::mapped_type; + using V = typename nested1_type<IC>::type; + + map<K, V> r; + for (const auto& p: oc) + { + const IC& ic (p.second); + for (size_t i (0); i != ic.size (); ++i) + r.emplace (K (p.first, i), ic[i]); + } + return r; + } + + template <typename OC, typename K, typename V> + typename std::enable_if< + std::is_same<typename OC::mapped_type, + typename OC::value_type::second_type>::value>::type + nested_set (OC& oc, std::map<K, V>&& r) + { + using namespace std; + + for (auto& p: oc) + { + auto& c (p.second); + c.erase (c.begin (), c.end ()); + } + + for (auto& p: r) + { + const auto& o (p.first.outer); + V& v (p.second); + + assert (p.first.inner == oc[o].size ()); oc[o].push_back (move (v)); } } - // 2-level nesting. + // 2-level nesting of std::vector-like containers. // - template <typename OC> // For example, OC = vector<vector<vector<V>>>. - std::map<nested2_key<typename nested1_type<OC>::type>, - typename nested3_type<OC>::type> + template <typename OC, // For example, OC = vector<vector<vector<V>>>. + typename K = nested2_key<typename nested1_type<OC>::type>> + std::map<K, typename nested3_type<OC>::type> nested2_get (const OC& oc) { using namespace std; using MC = typename nested1_type<OC>::type; + using IC = typename nested2_type<OC>::type; using V = typename nested3_type<OC>::type; - using K = nested2_key<MC>; map<K, V> r; for (size_t o (0); o != oc.size (); ++o) { - const auto& mc (oc[o]); + const MC& mc (oc[o]); for (size_t m (0); m != mc.size (); ++m) { - const auto& ic (mc[m]); + const IC& ic (mc[m]); for (size_t i (0); i != ic.size (); ++i) r.emplace (K (o, m, i), ic[i]); } @@ -185,17 +307,22 @@ namespace odb return r; } - template <typename K, typename V, typename OC> + template <typename OC, typename K, typename V> void nested2_set (OC& oc, std::map<K, V>&& r) { using namespace std; + for (auto& o: oc) + { + for (auto m: o) + m.erase (m.begin (), m.end ()); + } + for (auto& p: r) { size_t o (p.first.outer); size_t m (p.first.middle); - size_t i (p.first.inner); V& v (p.second); if (o >= oc.size ()) @@ -206,7 +333,7 @@ namespace odb if (m >= mc.size ()) mc.resize (m + 1); - assert (i == mc[m].size ()); + assert (p.first.inner == mc[m].size ()); mc[m].push_back (move (v)); } diff --git a/libodb/odb/vector.ixx b/libodb/odb/vector.ixx index 230b187..8b7bd77 100644 --- a/libodb/odb/vector.ixx +++ b/libodb/odb/vector.ixx @@ -233,8 +233,10 @@ namespace odb inline void vector<T, A LIBODB_VECTOR_ARG_USE>:: insert (iterator p, I f, I l) { - size_type i, n; - if (_tracking ()) + const bool t (_tracking ()); + + size_type i (0), n (0); // Suppress GCC -Wmaybe-uninitialized. + if (t) { i = static_cast<size_type> (p.base () - v_.begin ()); n = v_.size (); @@ -242,7 +244,7 @@ namespace odb v_.insert (p.base (), f, l); - if (_tracking ()) + if (t) impl_.insert (i, v_.size () - n); } diff --git a/libodb/odb/version.hxx.in b/libodb/odb/version.hxx.in index 178c8cc..6143dac 100644 --- a/libodb/odb/version.hxx.in +++ b/libodb/odb/version.hxx.in @@ -55,11 +55,11 @@ // ODB interface version: minor, major, and alpha/beta versions. // -#define ODB_VERSION 20476 -#define ODB_VERSION_STR "2.5-b.26" +#define ODB_VERSION 20551 +#define ODB_VERSION_STR "2.6-b.1" // libodb version: interface version plus the bugfix version. // -#define LIBODB_VERSION 2049976 +#define LIBODB_VERSION 2059951 #endif // LIBODB_VERSION diff --git a/libodb/tests/build/bootstrap.build b/libodb/tests/build/bootstrap.build index 6ee38db..dce9c4c 100644 --- a/libodb/tests/build/bootstrap.build +++ b/libodb/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test diff --git a/odb-examples/LICENSE b/odb-examples/LICENSE index d96b938..8f83dae 100644 --- a/odb-examples/LICENSE +++ b/odb-examples/LICENSE @@ -1,20 +1,5 @@ -Copyright (c) 2009-2024 Code Synthesis. +Not copyrighted - public domain. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 as -published by the Free Software Foundation. - -For more information on ODB licensing as well as for answers to -some of the common licensing questions, visit the ODB License -page: - -http://www.codesynthesis.com/products/odb/license.xhtml - -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 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 St, Fifth Floor, Boston, MA 02110-1301 USA +You should have received a copy of the UNLICENSE document along with +this program with the terms and conditions; if not, contact Code Synthesis +at info@codesynthesis.com. diff --git a/odb-examples/NEWS b/odb-examples/NEWS deleted file mode 120000 index 0fae0f8..0000000 --- a/odb-examples/NEWS +++ /dev/null @@ -1 +0,0 @@ -../NEWS
\ No newline at end of file diff --git a/odb-examples/README.md b/odb-examples/README.md index 45b24c1..d633a8e 100644 --- a/odb-examples/README.md +++ b/odb-examples/README.md @@ -1,10 +1,18 @@ -# odb-examples - ODB compiler usage examples +# odb-examples - ODB usage examples -This package contains examples of using `odb`, object-relational mapping (ORM) -compiler for C++. The following list gives an overview of the available -examples. See the `README` file accompanying each example for more -information. See `odb-tests/README.md` for instructions on setting up various -databases to run these examples. +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains examples of using ODB with the following list giving an +overview of the available examples. See the `README` file accompanying each +example for more information. See `odb-tests/README.md` for instructions on +setting up various databases to run these examples. Note also that most of the examples use the --table-prefix ODB compiler option to assign a unique prefix to tables created by each example. This diff --git a/odb-examples/UNLICENSE b/odb-examples/UNLICENSE new file mode 120000 index 0000000..b948d67 --- /dev/null +++ b/odb-examples/UNLICENSE @@ -0,0 +1 @@ +../UNLICENSE
\ No newline at end of file diff --git a/odb-examples/access/buildfile b/odb-examples/access/buildfile index 5001f97..c973b5b 100644 --- a/odb-examples/access/buildfile +++ b/odb-examples/access/buildfile @@ -1,5 +1,5 @@ # file : access/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/access/driver.cxx b/odb-examples/access/driver.cxx index b477d6f..2b63442 100644 --- a/odb-examples/access/driver.cxx +++ b/odb-examples/access/driver.cxx @@ -33,7 +33,7 @@ main (int argc, char* argv[]) } { - typedef odb::result<person> result; + using result = odb::result<person>; transaction t (db->begin ()); result r (db->query<person> ()); diff --git a/odb-examples/access/testscript b/odb-examples/access/testscript index 33a0392..7f2fa26 100644 --- a/odb-examples/access/testscript +++ b/odb-examples/access/testscript @@ -1,12 +1,11 @@ # file : access/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/boost/buildfile b/odb-examples/boost/buildfile index 9f563c3..32d5d8b 100644 --- a/odb-examples/boost/buildfile +++ b/odb-examples/boost/buildfile @@ -1,5 +1,5 @@ # file : boost/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import meta_libs = libodb%lib{odb} import meta_libs += libodb-boost%lib{odb-boost} diff --git a/odb-examples/boost/driver.cxx b/odb-examples/boost/driver.cxx index 8456fa6..badaeb9 100644 --- a/odb-examples/boost/driver.cxx +++ b/odb-examples/boost/driver.cxx @@ -133,8 +133,8 @@ main (int argc, char* argv[]) t.commit (); } - typedef odb::query<employee> query; - typedef odb::result<employee> result; + using query = odb::query<employee>; + using result = odb::result<employee>; // Search for Complex Systems Inc employees that were born before // April 1978. diff --git a/odb-examples/boost/employee.hxx b/odb-examples/boost/employee.hxx index 8d6173a..571f514 100644 --- a/odb-examples/boost/employee.hxx +++ b/odb-examples/boost/employee.hxx @@ -33,8 +33,8 @@ using boost::gregorian::date; class employer; class employee; -typedef boost::unordered_set<std::string> emails; -typedef std::vector<lazy_weak_ptr<employee> > employees; +using emails = boost::unordered_set<std::string>; +using employees = std::vector<lazy_weak_ptr<employee>>; #pragma db object class employer @@ -53,7 +53,7 @@ public: // Employees of this employer. // - typedef ::employees employees_type; + using employees_type = ::employees; const employees_type& employees () const @@ -83,7 +83,7 @@ private: class employee { public: - typedef ::employer employer_type; + using employer_type = ::employer; employee (const std::string& first, const std::string& last, @@ -146,7 +146,7 @@ public: // Emails. // - typedef ::emails emails_type; + using emails_type = ::emails; const emails_type& emails () const diff --git a/odb-examples/boost/testscript b/odb-examples/boost/testscript index 408fec4..9fb5698 100644 --- a/odb-examples/boost/testscript +++ b/odb-examples/boost/testscript @@ -1,12 +1,11 @@ # file : boost/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/build/bootstrap.build b/odb-examples/build/bootstrap.build index 0425a89..12dfedc 100644 --- a/odb-examples/build/bootstrap.build +++ b/odb-examples/build/bootstrap.build @@ -1,5 +1,5 @@ # file : build/bootstrap.build -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain project = odb-examples diff --git a/odb-examples/build/root.build b/odb-examples/build/root.build index 80810c7..4bd6088 100644 --- a/odb-examples/build/root.build +++ b/odb-examples/build/root.build @@ -1,5 +1,5 @@ # file : build/root.build -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain cxx.std = latest diff --git a/odb-examples/buildfile b/odb-examples/buildfile index fe04187..8a5a52a 100644 --- a/odb-examples/buildfile +++ b/odb-examples/buildfile @@ -1,7 +1,7 @@ # file : buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain -./: {*/ -build/ -boost/ -qt/} doc{README.md} legal{GPLv2 LICENSE} manifest +./: {*/ -build/ -boost/ -qt/} doc{README.md} legal{UNLICENSE LICENSE} manifest ./: boost/: include = $boost ./: qt/: include = $qt diff --git a/odb-examples/c++11/buildfile b/odb-examples/c++11/buildfile index e921434..8788275 100644 --- a/odb-examples/c++11/buildfile +++ b/odb-examples/c++11/buildfile @@ -1,5 +1,5 @@ # file : c++11/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/c++11/driver.cxx b/odb-examples/c++11/driver.cxx index 68793b1..d722882 100644 --- a/odb-examples/c++11/driver.cxx +++ b/odb-examples/c++11/driver.cxx @@ -176,8 +176,8 @@ main (int argc, char* argv[]) // Search for Complex Systems Inc employees with the John first name. // { - typedef odb::query<employee> query; - typedef odb::result<employee> result; + using query = odb::query<employee>; + using result = odb::result<employee>; session s; transaction t (db->begin ()); diff --git a/odb-examples/c++11/employee.hxx b/odb-examples/c++11/employee.hxx index a921e31..94bc4ba 100644 --- a/odb-examples/c++11/employee.hxx +++ b/odb-examples/c++11/employee.hxx @@ -34,7 +34,7 @@ public: // Employees of this employer. // - typedef std::vector<odb::lazy_weak_ptr<employee>> employees_type; + using employees_type = std::vector<odb::lazy_weak_ptr<employee>>; const employees_type& employees () const @@ -64,7 +64,7 @@ private: class employee { public: - typedef ::employer employer_type; + using employer_type = ::employer; employee (const std::string& first, const std::string& last, @@ -89,7 +89,7 @@ public: // Emails. // - typedef std::unordered_set<std::string> emails_type; + using emails_type = std::unordered_set<std::string>; const emails_type& emails () const @@ -123,7 +123,7 @@ private: employee () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; @@ -153,7 +153,7 @@ public: // Members of this fund. // - typedef std::vector<odb::lazy_shared_ptr<employee>> members_type; + using members_type = std::vector<odb::lazy_shared_ptr<employee>>; const members_type& members () const diff --git a/odb-examples/c++11/testscript b/odb-examples/c++11/testscript index cb942f6..27634a3 100644 --- a/odb-examples/c++11/testscript +++ b/odb-examples/c++11/testscript @@ -1,12 +1,11 @@ # file : cxx11/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/composite/buildfile b/odb-examples/composite/buildfile index 7d21db6..5ba999f 100644 --- a/odb-examples/composite/buildfile +++ b/odb-examples/composite/buildfile @@ -1,5 +1,5 @@ # file : composite/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/composite/driver.cxx b/odb-examples/composite/driver.cxx index 5cac553..6e7c2b1 100644 --- a/odb-examples/composite/driver.cxx +++ b/odb-examples/composite/driver.cxx @@ -83,7 +83,7 @@ main (int argc, char* argv[]) // Query the database for a person object. // { - typedef odb::query<person> query; + using query = odb::query<person>; transaction t (db->begin ()); diff --git a/odb-examples/composite/person.hxx b/odb-examples/composite/person.hxx index f0626e5..ed1423c 100644 --- a/odb-examples/composite/person.hxx +++ b/odb-examples/composite/person.hxx @@ -39,7 +39,7 @@ private: std::string last_; }; -typedef std::vector<basic_name> basic_names; +using basic_names = std::vector<basic_name>; #pragma db value @@ -126,7 +126,7 @@ private: // instantiation. Here we use std::pair to store person's phone // numbers, in the order of preference. // -typedef std::pair<std::string, std::string> phone_numbers; +using phone_numbers = std::pair<std::string, std::string>; #pragma db value(phone_numbers) // We can also use a composite value type as an object id. @@ -191,7 +191,7 @@ public: // Name. // - typedef ::name name_type; + using name_type = ::name; const name_type& name () const diff --git a/odb-examples/composite/testscript b/odb-examples/composite/testscript index d66ce0f..24e5422 100644 --- a/odb-examples/composite/testscript +++ b/odb-examples/composite/testscript @@ -1,12 +1,11 @@ # file : composite/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/container-nested/README b/odb-examples/container-nested/README new file mode 100644 index 0000000..91ac97f --- /dev/null +++ b/odb-examples/container-nested/README @@ -0,0 +1,64 @@ +This example shows how to use nested containers as data members in persistent +objects. + +The example consists of the following files: + +person.hxx + Header file defining the 'person' persistent class. It contains a number of + data members of various nested container types. The nested container support + is provided by the includes <odb/nested-container.hxx> header. + +person-odb.hxx +person-odb.ixx +person-odb.cxx +person.sql + The first three files contain the database support code and the last file + contains the database schema for the person.hxx header. + + These files are generated by the ODB compiler from person.hxx using the + following command line: + + odb --std c++11 -d <database> --generate-schema person.hxx + + Where <database> stands for the database system we are using, for example, + 'pgsql'. + +database.hxx + Contains the create_database() function which instantiates the concrete + database class corresponding to the database system we are using. + +driver.cxx + Driver for the example. It includes the person.hxx and person-odb.hxx + headers to gain access to the persistent classes and their database support + code. It also includes database.hxx for the create_database() function + declaration. + + In main() the driver first calls create_database() to obtain the database + instance. It then persists a 'person' object, loads it back, and prints the + contents of its members. Finally, the driver modifies the object by adding, + removing, and updating elements in its container members, stores the changes + in the database, then re-loads and prints the object to verify that the + changes have been made persistent. + +To compile and link the example manually from the command line we can use the +following commands (using PostgreSQL as an example; replace 'c++' with your +C++ compiler name): + +c++ -c person-odb.cxx +c++ -DDATABASE_PGSQL -c driver.cxx +c++ -o driver driver.o person-odb.o -lodb-pgsql -lodb + +To run the example we may first need to create the database schema (for some +database systems, such as SQLite, the schema is embedded into the generated +code which makes this step unnecessary). Using PostgreSQL as an example, this +can be achieved with the following command: + +psql --username=odb_test --dbname=odb_test -f person.sql + +Here we use 'odb_test' as the database login and also 'odb_test' as the +database name. + +Once the database schema is ready, we can run the example (using PostgreSQL as +the database): + +./driver --user odb_test --database odb_test diff --git a/odb-examples/container-nested/buildfile b/odb-examples/container-nested/buildfile new file mode 100644 index 0000000..e732c81 --- /dev/null +++ b/odb-examples/container-nested/buildfile @@ -0,0 +1,44 @@ +# file : container-nested/buildfile +# license : not copyrighted - public domain + +import libodb = libodb%lib{odb} + +import libs = libodb-$database%lib{odb-$database} + +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript + +# The metadata library target which we use to extract the poptions variable +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. +# +libue{person-meta}: $libodb + +exe{driver}: libue{person-meta} $libs + +<{hxx ixx cxx}{person-odb}>: hxx{person} libue{person-meta} $odb +{{ + pops = $cxx.lib_poptions($<[1]) + depdb hash $pops + + depdb dyndep --dyn-target --target-what 'generated schema' --format lines \ + -- echo ($sqlite ? '' : "$out_base/person.sql") + + $odb --std c++11 \ + --database $database \ + --generate-schema \ + --output-dir $out_base \ + --table-prefix cn_ \ + "-I$src_base" $pops \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" "-I$src_base" -DDATABASE_$ucase($database) + +# Testscript's run-time prerequisites. +# +# @@ BUILD2: Eventually we should be able to mark it as test.input once +# this is supported for testscript tests. +# +exe{driver}: ../alias{database-client}: include = adhoc + +testscript@./: schema = person diff --git a/odb-examples/container-nested/database.hxx b/odb-examples/container-nested/database.hxx new file mode 100644 index 0000000..035f417 --- /dev/null +++ b/odb-examples/container-nested/database.hxx @@ -0,0 +1,95 @@ +// file : container-nested/database.hxx +// copyright : not copyrighted - public domain + +// +// Create concrete database instance based on the DATABASE_* macros. +// + +#ifndef DATABASE_HXX +#define DATABASE_HXX + +#include <string> +#include <memory> // std::unique_ptr +#include <cstdlib> // std::exit +#include <iostream> + +#include <odb/database.hxx> + +#if defined(DATABASE_MYSQL) +# include <odb/mysql/database.hxx> +#elif defined(DATABASE_SQLITE) +# include <odb/connection.hxx> +# include <odb/transaction.hxx> +# include <odb/schema-catalog.hxx> +# include <odb/sqlite/database.hxx> +#elif defined(DATABASE_PGSQL) +# include <odb/pgsql/database.hxx> +#elif defined(DATABASE_ORACLE) +# include <odb/oracle/database.hxx> +#elif defined(DATABASE_MSSQL) +# include <odb/mssql/database.hxx> +#else +# error unknown database; did you forget to define the DATABASE_* macros? +#endif + +inline std::unique_ptr<odb::database> +create_database (int& argc, char* argv[]) +{ + using namespace std; + using namespace odb::core; + + if (argc > 1 && argv[1] == string ("--help")) + { + cout << "Usage: " << argv[0] << " [options]" << endl + << "Options:" << endl; + +#if defined(DATABASE_MYSQL) + odb::mysql::database::print_usage (cout); +#elif defined(DATABASE_SQLITE) + odb::sqlite::database::print_usage (cout); +#elif defined(DATABASE_PGSQL) + odb::pgsql::database::print_usage (cout); +#elif defined(DATABASE_ORACLE) + odb::oracle::database::print_usage (cout); +#elif defined(DATABASE_MSSQL) + odb::mssql::database::print_usage (cout); +#endif + + exit (0); + } + +#if defined(DATABASE_MYSQL) + unique_ptr<database> db (new odb::mysql::database (argc, argv)); +#elif defined(DATABASE_SQLITE) + unique_ptr<database> db ( + new odb::sqlite::database ( + argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); + + // Create the database schema. Due to bugs in SQLite foreign key + // support for DDL statements, we need to temporarily disable + // foreign keys. + // + { + connection_ptr c (db->connection ()); + + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + + c->execute ("PRAGMA foreign_keys=ON"); + } +#elif defined(DATABASE_PGSQL) + unique_ptr<database> db (new odb::pgsql::database (argc, argv)); +#elif defined(DATABASE_ORACLE) + unique_ptr<database> db (new odb::oracle::database (argc, argv)); +#elif defined(DATABASE_MSSQL) + unique_ptr<database> db ( + new odb::mssql::database (argc, argv, false, "TrustServerCertificate=yes")); +#endif + + return db; +} + +#endif // DATABASE_HXX diff --git a/odb-examples/container-nested/driver.cxx b/odb-examples/container-nested/driver.cxx new file mode 100644 index 0000000..48a90d1 --- /dev/null +++ b/odb-examples/container-nested/driver.cxx @@ -0,0 +1,177 @@ +// file : container-nested/driver.cxx +// copyright : not copyrighted - public domain + +#include <memory> // std::unique_ptr +#include <iostream> + +#include <odb/database.hxx> +#include <odb/transaction.hxx> + +#include "database.hxx" // create_database + +#include "person.hxx" +#include "person-odb.hxx" + +using namespace std; +using namespace odb::core; + +void +print (const person& p) +{ + cout << p.first () << " " << p.last () << endl; + + // Print trips. + // + for (trips::const_iterator i (p.trips ().begin ()); + i != p.trips ().end (); ++i) + { + cout << " trip:"; + + for (trip::const_iterator j (i->begin ()); j != i->end (); ++j) + { + if (j != i->begin ()) + cout << ','; + + cout << ' ' << j->name << ": " << j->days; + } + + cout << endl; + } + + // Print emergency contacts. + // + for (emergency_contacts::const_iterator i (p.emergency_contacts ().begin ()); + i != p.emergency_contacts ().end (); ++i) + { + cout << " emergency contact: " << i->first_name << ' ' << i->last_name; + + for (phone_numbers::const_iterator j (i->numbers.begin ()); + j != i->numbers.end (); ++j) + { + if (j != i->numbers.begin ()) + cout << ','; + + cout << ' ' << *j; + } + + cout << endl; + } + + // Print age weights. + // + for (age_weights_map::const_iterator i (p.age_weights ().begin ()); + i != p.age_weights ().end (); ++i) + { + cout << " age weights: " << i->first << ":"; + + for (weights::const_iterator j (i->second.begin ()); + j != i->second.end (); ++j) + { + if (j != i->second.begin ()) + cout << ','; + + cout << ' ' << *j; + } + + cout << endl; + } +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr<database> db (create_database (argc, argv)); + + unsigned long long id; + + // Create a persistent person object. + // + { + person joe ("Joe", "Dirt"); + + joe.trips ().push_back (trip {country_stay {"Colombia", 1}, + country_stay {"Peru", 2}}); + + joe.trips ().push_back (trip {country_stay {"France", 3}, + country_stay {"Italy", 4}}); + + joe.emergency_contacts ().push_back ({ + emergency_contact { + "Jane", "Doe", phone_numbers {"335-53-81", "198-23-32"}}}); + + joe.emergency_contacts ().push_back ({ + emergency_contact { + "John", "Smith", phone_numbers {"137-43-06"}}}); + + joe.age_weights ()[40] = weights {70, 75}; + joe.age_weights ()[50] = weights {75, 80}; + + transaction t (db->begin ()); + id = db->persist (joe); + t.commit (); + } + + // Load the object and print what we've got. Then change some information + // and update it in the database. + // + { + transaction t1 (db->begin ()); + unique_ptr<person> j (db->load<person> (id)); + t1.commit (); + + print (*j); + + // Add another trip. + // + j->trips ().push_back (trip {country_stay {"China", 6}, + country_stay {"Japan", 7}}); + + // Update an existing trip. + // + j->trips ()[1][1].days = 5; + + // Add another emergency contact. + // + j->emergency_contacts ().push_back ({ + emergency_contact { + "Jack", "Johnson", phone_numbers {"258-23-00", "712-80-39"}}}); + + // Update an existing emergency contact. + // + j->emergency_contacts ()[0].numbers[1] = "198-23-33"; + + // Add another age weights. + // + j->age_weights ()[60] = weights {80, 75}; + + // Update an existing age weight. + // + j->age_weights ()[50][1] = 79; + + // Erase existing age weights. + // + j->age_weights ().erase (40); + + transaction t2 (db->begin ()); + db->update (*j); + t2.commit (); + } + + // Load and print the updated object. + // + { + transaction t (db->begin ()); + unique_ptr<person> j (db->load<person> (id)); + t.commit (); + + print (*j); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-examples/container-nested/person.hxx b/odb-examples/container-nested/person.hxx new file mode 100644 index 0000000..036b4c3 --- /dev/null +++ b/odb-examples/container-nested/person.hxx @@ -0,0 +1,198 @@ +// file : container-nested/person.hxx +// copyright : not copyrighted - public domain + +#ifndef PERSON_HXX +#define PERSON_HXX + +#include <map> +#include <vector> +#include <string> +#include <utility> // std::move() +#include <cassert> + +#include <odb/core.hxx> + +#include <odb/nested-container.hxx> // Nested containers support. + + +// vector<vector<struct{...}>> +// +#pragma db value +struct country_stay +{ + std::string name; + unsigned short days; +}; + +using trip = std::vector<country_stay>; +using trips = std::vector<trip>; + + +// vector<struct{vector<value>}> +// +using phone_numbers = std::vector<std::string>; + +#pragma db value +struct emergency_contact +{ + std::string first_name; + std::string last_name; + + #pragma db transient // Note: replaced with virtual below. + phone_numbers numbers; +}; + +using emergency_contacts = std::vector<emergency_contact>; + + +// map<key, vector<value>> +// +using weights = std::vector<float>; +using age_weights_map = std::map<unsigned short, weights>; + + +#pragma db object +class person +{ +public: + person (const std::string& first, const std::string& last) + : first_ (first), last_ (last) + { + } + + const std::string& + first () const + { + return first_; + } + + const std::string& + last () const + { + return last_; + } + + // Trips. + // + using trips_type = ::trips; + + const trips_type& + trips () const + { + return trips_; + } + + trips_type& + trips () + { + return trips_; + } + + // Emergency contacts. + // + using emergency_contacts_type = ::emergency_contacts; + + const emergency_contacts_type& + emergency_contacts () const + { + return emergency_contacts_; + } + + emergency_contacts_type& + emergency_contacts () + { + return emergency_contacts_; + } + + // Age weights. + // + const age_weights_map& + age_weights () const + { + return age_weights_; + } + + age_weights_map& + age_weights () + { + return age_weights_; + } + +private: + friend class odb::access; + + person () {} + + #pragma db id auto + unsigned long long id_; + + std::string first_; + std::string last_; + + // trips + // + // Note: commented out parts allow additional column name customizations. + // + #pragma db transient + trips_type trips_; + + using _trip_key = odb::nested_key<trip>; + using _trips_type = std::map<_trip_key, country_stay>; + + #pragma db value(_trip_key) + //#pragma db member(_trip_key::outer) column("trip_index") + //#pragma db member(_trip_key::inner) column("index") + + #pragma db member(trips) \ + virtual(_trips_type) \ + get(odb::nested_get (this.trips_)) \ + set(odb::nested_set (this.trips_, std::move (?))) \ + //id_column("person") key_column("") value_column("country_stay_") + + + // emergency_contacts + // + // Note: commented out parts allow additional column name customizations. + // + emergency_contacts_type emergency_contacts_; + + using _phone_numbers_key = odb::nested_key<phone_numbers>; + using _phone_numbers_type = std::map<_phone_numbers_key, std::string>; + + #pragma db value(_phone_numbers_key) + //#pragma db member(_phone_numbers_key::outer) column("contact_index") + //#pragma db member(_phone_numbers_key::inner) column("index") + + #pragma db member(emergency_contact_phone_numbers) \ + virtual(_phone_numbers_type) \ + after(emergency_contacts_) \ + get(odb::nested_get (this.emergency_contacts_, \ + &emergency_contact::numbers)) \ + set(odb::nested_set (this.emergency_contacts_, \ + &emergency_contact::numbers, \ + std::move (?))) \ + //id_column("person") key_column("") value_column("phone_number") + + + // age_weights + // + // Note: commented out parts allow additional column name customizations. + // + #pragma db transient + age_weights_map age_weights_; + + using _weights_key = odb::nested_key<weights, unsigned short>; + using _age_weights_type = std::map<_weights_key, float>; + + #pragma db value(_weights_key) + //#pragma db member(_weights_key::outer) column("age") + //#pragma db member(_weights_key::inner) column("index") + + #pragma db member(age_weights) \ + virtual(_age_weights_type) \ + get(odb::nested_get (this.age_weights_)) \ + set(odb::nested_set (this.age_weights_, std::move (?))) \ + //id_column("person") key_column("") value_column("weight") +}; + +#endif // PERSON_HXX diff --git a/odb-examples/container-nested/testscript b/odb-examples/container-nested/testscript new file mode 100644 index 0000000..3361003 --- /dev/null +++ b/odb-examples/container-nested/testscript @@ -0,0 +1,12 @@ +# file : container-nested/testscript +# license : not copyrighted - public domain + +.include ../database-options.testscript +.include ../$(database).testscript + ++if! $sqlite + $create_schema + +: basics +: +$* >| diff --git a/odb-examples/container/buildfile b/odb-examples/container/buildfile index a045a3b..ff3d7aa 100644 --- a/odb-examples/container/buildfile +++ b/odb-examples/container/buildfile @@ -1,5 +1,5 @@ # file : container/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/container/driver.cxx b/odb-examples/container/driver.cxx index b3d50c6..04d6dbb 100644 --- a/odb-examples/container/driver.cxx +++ b/odb-examples/container/driver.cxx @@ -52,7 +52,7 @@ main (int argc, char* argv[]) { unique_ptr<database> db (create_database (argc, argv)); - unsigned long id; + unsigned long long id; // Create a persistent person object. // @@ -84,7 +84,7 @@ main (int argc, char* argv[]) print (*j); - // Ann another nickname. + // Add another nickname. // j->nicknames ().push_back ("Cleaner"); diff --git a/odb-examples/container/person.hxx b/odb-examples/container/person.hxx index 31b90a5..f00c4ab 100644 --- a/odb-examples/container/person.hxx +++ b/odb-examples/container/person.hxx @@ -11,9 +11,9 @@ #include <odb/core.hxx> -typedef std::vector<std::string> names; -typedef std::set<std::string> emails; -typedef std::map<unsigned short, float> age_weight_map; +using names = std::vector<std::string>; +using emails = std::set<std::string>; +using age_weight_map = std::map<unsigned short, float>; #pragma db object class person @@ -52,7 +52,7 @@ public: // Emails. // - typedef ::emails emails_type; + using emails_type = ::emails; const emails_type& emails () const @@ -86,7 +86,7 @@ private: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/container/testscript b/odb-examples/container/testscript index 3068677..11cbe80 100644 --- a/odb-examples/container/testscript +++ b/odb-examples/container/testscript @@ -1,12 +1,11 @@ # file : container/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/database-options.testscript b/odb-examples/database-options.testscript index db93b45..2f312ac 100644 --- a/odb-examples/database-options.testscript +++ b/odb-examples/database-options.testscript @@ -1,5 +1,5 @@ # file : database-options.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # For the enabled databases create the example driver option lists (*_options) # for subsequent use in the examples. Also create the database-specific client @@ -7,142 +7,161 @@ # be used as a base for the data manipulation commands. # +if $mysql - mysql_options = --user $config.odb_examples.mysql.user \ - --database $config.odb_examples.mysql.database - - mysql_client_options = --user $config.odb_examples.mysql.user \ - --database $config.odb_examples.mysql.database - - if $defined(config.odb_examples.mysql.passwd) - mysql_options += --password $config.odb_examples.mysql.passwd - mysql_client_options += --password=$config.odb_examples.mysql.passwd - end - - if $defined(config.odb_examples.mysql.host) - mysql_options += --host $config.odb_examples.mysql.host - mysql_client_options += --host $config.odb_examples.mysql.host - end - - if $defined(config.odb_examples.mysql.port) - mysql_options += --port $config.odb_examples.mysql.port - mysql_client_options += --port $config.odb_examples.mysql.port - end - - if $defined(config.odb_examples.mysql.socket) - mysql_options += --socket $config.odb_examples.mysql.socket - mysql_client_options += --socket $config.odb_examples.mysql.socket - end - - mysql_client_cmd = $path($mysql_client) $mysql_client_options -end +{ + mysql_options = --user $config.odb_examples.mysql.user \ + --database $config.odb_examples.mysql.database + + mysql_client_options = --user $config.odb_examples.mysql.user \ + --database $config.odb_examples.mysql.database + + if $defined(config.odb_examples.mysql.passwd) + { + mysql_options += --password $config.odb_examples.mysql.passwd + mysql_client_options += --password=$config.odb_examples.mysql.passwd + } + + if $defined(config.odb_examples.mysql.host) + { + mysql_options += --host $config.odb_examples.mysql.host + mysql_client_options += --host $config.odb_examples.mysql.host + } + + if $defined(config.odb_examples.mysql.port) + { + mysql_options += --port $config.odb_examples.mysql.port + mysql_client_options += --port $config.odb_examples.mysql.port + } + + if $defined(config.odb_examples.mysql.socket) + { + mysql_options += --socket $config.odb_examples.mysql.socket + mysql_client_options += --socket $config.odb_examples.mysql.socket + } + + mysql_client_cmd = $path($mysql_client) $mysql_client_options +} +if $sqlite +{ sqlite_options = --database odb-test.db # Note that we currently don't manipulate the data using the sqlite3 # utility. Thus, we don't create the sqlite client option list and command # line. # -end +} +if $pgsql - pgsql_options = --user $config.odb_examples.pgsql.user \ - --database $config.odb_examples.pgsql.database +{ + pgsql_options = --user $config.odb_examples.pgsql.user \ + --database $config.odb_examples.pgsql.database - pgsql_client_options = --quiet \ - --set ON_ERROR_STOP=1 \ - --username $config.odb_examples.pgsql.user \ - --dbname $config.odb_examples.pgsql.database + pgsql_client_options = --quiet \ + --set ON_ERROR_STOP=1 \ + --username $config.odb_examples.pgsql.user \ + --dbname $config.odb_examples.pgsql.database if $defined(config.odb_examples.pgsql.host) + { pgsql_options += --host $config.odb_examples.pgsql.host pgsql_client_options += --host $config.odb_examples.pgsql.host - end + } if $defined(config.odb_examples.pgsql.port) + { pgsql_options += --port $config.odb_examples.pgsql.port pgsql_client_options += --port $config.odb_examples.pgsql.port - end + } pgsql_client_cmd = $path($pgsql_client) $pgsql_client_options export PGOPTIONS=--client-min-messages=warning -end +} +if $oracle - oracle_options = --user $config.odb_examples.oracle.user - - oracle_client_options = -L -S - oracle_logon = $config.odb_examples.oracle.user - - if $defined(config.odb_examples.oracle.passwd) - oracle_options += --password $config.odb_examples.oracle.passwd - oracle_logon = "$oracle_logon/$config.odb_examples.oracle.passwd" - end - - if ($defined(config.odb_examples.oracle.host) || \ - $defined(config.odb_examples.oracle.port)) - if $defined(config.odb_examples.oracle.host) - oracle_options += --host $config.odb_examples.oracle.host - oracle_logon = "$oracle_logon@//$config.odb_examples.oracle.host" - else - oracle_logon = "$oracle_logon@//localhost" - end - - if $defined(config.odb_examples.oracle.port) - oracle_options += --port $config.odb_examples.oracle.port - oracle_logon = "$oracle_logon:$config.odb_examples.oracle.port" - end - - if $defined(config.odb_examples.oracle.service) - oracle_options += --service $config.odb_examples.oracle.service - oracle_logon = "$oracle_logon/$config.odb_examples.oracle.service" - end - elif $defined(config.odb_examples.oracle.service) - oracle_options += --service $config.odb_examples.oracle.service - oracle_logon = "$oracle_logon@$config.odb_examples.oracle.service" - end - - oracle_client_cmd = $path($oracle_client) $oracle_client_options $oracle_logon -end +{ + oracle_options = --user $config.odb_examples.oracle.user + + oracle_client_options = -L -S + oracle_logon = $config.odb_examples.oracle.user + + if $defined(config.odb_examples.oracle.passwd) + { + oracle_options += --password $config.odb_examples.oracle.passwd + oracle_logon = "$oracle_logon/$config.odb_examples.oracle.passwd" + } + + if ($defined(config.odb_examples.oracle.host) || \ + $defined(config.odb_examples.oracle.port)) + { + if $defined(config.odb_examples.oracle.host) + { + oracle_options += --host $config.odb_examples.oracle.host + oracle_logon = "$oracle_logon@//$config.odb_examples.oracle.host" + } + else + oracle_logon = "$oracle_logon@//localhost" + + if $defined(config.odb_examples.oracle.port) + { + oracle_options += --port $config.odb_examples.oracle.port + oracle_logon = "$oracle_logon:$config.odb_examples.oracle.port" + } + + if $defined(config.odb_examples.oracle.service) + { + oracle_options += --service $config.odb_examples.oracle.service + oracle_logon = "$oracle_logon/$config.odb_examples.oracle.service" + } + } + elif $defined(config.odb_examples.oracle.service) + { + oracle_options += --service $config.odb_examples.oracle.service + oracle_logon = "$oracle_logon@$config.odb_examples.oracle.service" + } + + oracle_client_cmd = $path($oracle_client) $oracle_client_options $oracle_logon +} +if $mssql - mssql_options = --user $config.odb_examples.mssql.user \ - --database $config.odb_examples.mssql.database - - mssql_client_options = -C -x -r 1 -b \ - -U $config.odb_examples.mssql.user \ - -d $config.odb_examples.mssql.database - - if $defined(config.odb_examples.mssql.passwd) - mssql_options += --password $config.odb_examples.mssql.passwd - mssql_client_options += -P $config.odb_examples.mssql.passwd - end - - if ($defined(config.odb_examples.mssql.host) || \ - $defined(config.odb_examples.mssql.port)) - mssql_server = \ - "tcp:($defined(config.odb_examples.mssql.host) ? $config.odb_examples.mssql.host : localhost)" - - if $defined(config.odb_examples.mssql.port) +{ + mssql_options = --user $config.odb_examples.mssql.user \ + --database $config.odb_examples.mssql.database + + mssql_client_options = -C -x -r 1 -b \ + -U $config.odb_examples.mssql.user \ + -d $config.odb_examples.mssql.database + + if $defined(config.odb_examples.mssql.passwd) + { + mssql_options += --password $config.odb_examples.mssql.passwd + mssql_client_options += -P $config.odb_examples.mssql.passwd + } + + if ($defined(config.odb_examples.mssql.host) || \ + $defined(config.odb_examples.mssql.port)) + { + mssql_server = \ + "tcp:($defined(config.odb_examples.mssql.host) ? $config.odb_examples.mssql.host : localhost)" + + if $defined(config.odb_examples.mssql.port) mssql_server = "$mssql_server,$config.odb_examples.mssql.port" - end - elif $defined(config.odb_examples.mssql.server) - mssql_server = $config.odb_examples.mssql.server - else - mssql_server = [null] - end - - if ($mssql_server != [null]) - mssql_options += --server $mssql_server - mssql_client_options += -S $mssql_server - end - - if ($defined(config.odb_examples.mssql.driver) && \ - $config.odb_examples.mssql.driver != [null] && \ - $config.odb_examples.mssql.driver != '') - mssql_options += --driver $config.odb_examples.mssql.driver - end - - mssql_client_cmd = $path($mssql_client) $mssql_client_options -end + } + elif $defined(config.odb_examples.mssql.server) + mssql_server = $config.odb_examples.mssql.server + else + mssql_server = [null] + + if ($mssql_server != [null]) + { + mssql_options += --server $mssql_server + mssql_client_options += -S $mssql_server + } + + if ($defined(config.odb_examples.mssql.driver) && \ + $config.odb_examples.mssql.driver != [null] && \ + $config.odb_examples.mssql.driver != '') + mssql_options += --driver $config.odb_examples.mssql.driver + + mssql_client_cmd = $path($mssql_client) $mssql_client_options +} diff --git a/odb-examples/hello/buildfile b/odb-examples/hello/buildfile index e6ad903..e17e7cf 100644 --- a/odb-examples/hello/buildfile +++ b/odb-examples/hello/buildfile @@ -1,5 +1,5 @@ # file : hello/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/hello/driver.cxx b/odb-examples/hello/driver.cxx index 175ced1..54a44a8 100644 --- a/odb-examples/hello/driver.cxx +++ b/odb-examples/hello/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) { unique_ptr<database> db (create_database (argc, argv)); - unsigned long john_id, joe_id; + unsigned long long john_id, joe_id; // Create a few persistent person objects. // @@ -42,8 +42,8 @@ main (int argc, char* argv[]) t.commit (); } - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; // Say hello to those over 30. // diff --git a/odb-examples/hello/person.hxx b/odb-examples/hello/person.hxx index 81a9321..a901ac2 100644 --- a/odb-examples/hello/person.hxx +++ b/odb-examples/hello/person.hxx @@ -50,7 +50,7 @@ private: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/hello/testscript b/odb-examples/hello/testscript index 2d72ba5..4eb3827 100644 --- a/odb-examples/hello/testscript +++ b/odb-examples/hello/testscript @@ -1,12 +1,11 @@ # file : hello/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/inheritance/polymorphism/buildfile b/odb-examples/inheritance/polymorphism/buildfile index eaf21c9..6f46558 100644 --- a/odb-examples/inheritance/polymorphism/buildfile +++ b/odb-examples/inheritance/polymorphism/buildfile @@ -1,5 +1,5 @@ # file : inheritance/polymorphism/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/inheritance/polymorphism/driver.cxx b/odb-examples/inheritance/polymorphism/driver.cxx index 8d24e81..4c133c1 100644 --- a/odb-examples/inheritance/polymorphism/driver.cxx +++ b/odb-examples/inheritance/polymorphism/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) { unique_ptr<database> db (create_database (argc, argv)); - unsigned long id1, id2; + unsigned long long id1, id2; // Add a few employee and contractor objects to the database. // @@ -64,8 +64,8 @@ main (int argc, char* argv[]) // Query all the person objects that have Doe as the last name. // { - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; transaction t (db->begin ()); diff --git a/odb-examples/inheritance/polymorphism/employee.hxx b/odb-examples/inheritance/polymorphism/employee.hxx index efb2c1c..bd47c82 100644 --- a/odb-examples/inheritance/polymorphism/employee.hxx +++ b/odb-examples/inheritance/polymorphism/employee.hxx @@ -40,7 +40,7 @@ protected: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/inheritance/polymorphism/testscript b/odb-examples/inheritance/polymorphism/testscript index 5c7bdcd..7d7a591 100644 --- a/odb-examples/inheritance/polymorphism/testscript +++ b/odb-examples/inheritance/polymorphism/testscript @@ -1,12 +1,11 @@ # file : inheritance/polymorphism/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../../database-options.testscript .include ../../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/inheritance/reuse/buildfile b/odb-examples/inheritance/reuse/buildfile index 7190d39..cf02289 100644 --- a/odb-examples/inheritance/reuse/buildfile +++ b/odb-examples/inheritance/reuse/buildfile @@ -1,5 +1,5 @@ # file : inheritance/reuse/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/inheritance/reuse/driver.cxx b/odb-examples/inheritance/reuse/driver.cxx index b56a368..1815dd0 100644 --- a/odb-examples/inheritance/reuse/driver.cxx +++ b/odb-examples/inheritance/reuse/driver.cxx @@ -57,8 +57,8 @@ main (int argc, char* argv[]) // Query for temporary employees that have John as the first name. // { - typedef odb::query<temporary_employee> query; - typedef odb::result<temporary_employee> result; + using query = odb::query<temporary_employee>; + using result = odb::result<temporary_employee>; transaction t (db->begin ()); diff --git a/odb-examples/inheritance/reuse/employee.hxx b/odb-examples/inheritance/reuse/employee.hxx index 7de3989..3092c95 100644 --- a/odb-examples/inheritance/reuse/employee.hxx +++ b/odb-examples/inheritance/reuse/employee.hxx @@ -52,7 +52,7 @@ public: { } - unsigned long + unsigned long long number () const { return id_; @@ -64,7 +64,7 @@ protected: private: #pragma db id auto - unsigned long id_; + unsigned long long id_; }; // Concrete permanent_employee class. Note that it doesn't define any diff --git a/odb-examples/inheritance/reuse/testscript b/odb-examples/inheritance/reuse/testscript index 9b24b63..3e511c6 100644 --- a/odb-examples/inheritance/reuse/testscript +++ b/odb-examples/inheritance/reuse/testscript @@ -1,12 +1,11 @@ # file : inheritance/reuse/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../../database-options.testscript .include ../../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/inverse/buildfile b/odb-examples/inverse/buildfile index a113004..e7b56d7 100644 --- a/odb-examples/inverse/buildfile +++ b/odb-examples/inverse/buildfile @@ -1,5 +1,5 @@ # file : inverse/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/inverse/driver.cxx b/odb-examples/inverse/driver.cxx index be9b946..2fce36f 100644 --- a/odb-examples/inverse/driver.cxx +++ b/odb-examples/inverse/driver.cxx @@ -173,8 +173,8 @@ main (int argc, char* argv[]) // Find all Software Engineers. // { - typedef odb::query<position> query; - typedef odb::result<position> result; + using query = odb::query<position>; + using result = odb::result<position>; session s; transaction t (db->begin ()); @@ -199,7 +199,7 @@ main (int argc, char* argv[]) // a Software Engineer on Complex Software. // { - typedef odb::query<employee> query; + using query = odb::query<employee>; session s; transaction t (db->begin ()); @@ -233,8 +233,8 @@ main (int argc, char* argv[]) // of the pointed-to objects in the queries. // { - typedef odb::query<employee> query; - typedef odb::result<employee> result; + using query = odb::query<employee>; + using result = odb::result<employee>; session s; transaction t (db->begin ()); diff --git a/odb-examples/inverse/employee.hxx b/odb-examples/inverse/employee.hxx index 89451a7..78d1a6a 100644 --- a/odb-examples/inverse/employee.hxx +++ b/odb-examples/inverse/employee.hxx @@ -30,8 +30,8 @@ class position; class project; class employee; -typedef std::vector<odb::lazy_shared_ptr<project>> projects; -typedef std::vector<odb::lazy_weak_ptr<employee>> employees; +using projects = std::vector<odb::lazy_shared_ptr<project>>; +using employees = std::vector<odb::lazy_weak_ptr<employee>>; #pragma db object class employer @@ -50,7 +50,7 @@ public: // Employees of this employer. // - typedef ::employees employees_type; + using employees_type = ::employees; const employees_type& employees () const @@ -93,7 +93,7 @@ public: // Employee that fills this position. NULL if the position is vacant. // - typedef ::employee employee_type; + using employee_type = ::employee; const odb::lazy_weak_ptr<employee_type>& employee () const @@ -113,7 +113,7 @@ private: position () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string title_; @@ -138,7 +138,7 @@ public: // Employees working on this project. // - typedef ::employees employees_type; + using employees_type = ::employees; const employees_type& employees () const @@ -168,8 +168,8 @@ private: class employee { public: - typedef ::employer employer_type; - typedef ::position position_type; + using employer_type = ::employer; + using position_type = ::position; employee (const std::string& first, const std::string& last, @@ -225,7 +225,7 @@ public: // Projects. // - typedef ::projects projects_type; + using projects_type = ::projects; const projects_type& projects () const @@ -245,7 +245,7 @@ private: employee () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/inverse/testscript b/odb-examples/inverse/testscript index 04a89a4..497dd86 100644 --- a/odb-examples/inverse/testscript +++ b/odb-examples/inverse/testscript @@ -1,12 +1,11 @@ # file : inverse/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/manifest b/odb-examples/manifest index 6e3d70a..6c82699 100644 --- a/odb-examples/manifest +++ b/odb-examples/manifest @@ -1,21 +1,18 @@ : 1 name: odb-examples -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb type: examples language: c++ summary: ODB compiler usage examples -license: GPL-2.0-only +license: Unlicense description-file: README.md url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com ; Mailing list - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- depends: * odb == $ @@ -64,7 +61,7 @@ builds: -static ; Implementation uses plugins and requires -fPIC. # And they allow CI'ing odb-examples by itself (thus we specify the bot keys # both in libodb* and here). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: default ; Requires default config with GCC as host compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. @@ -73,35 +70,23 @@ custom-multi-builds: none ; Multiple databases cannot be configured. custom-multi-oracle-builds: none ; Multiple databases cannot be configured. custom-multi-mssql-builds: none ; Multiple databases cannot be configured. -# @@ TMP -# -#boost-custom-builds: latest ; Requires proprietary software. -#boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. -##boost-custom-build-bot: -- see below. -boost-custom-builds: latest ; Requires latest config with GCC as host compiler. +boost-custom-builds: default ; Requires default config with GCC as host compiler. boost-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. +#boost-custom-build-bot: -- see below. -# @@ TMP -# -#qt5-custom-builds: latest ; Requires proprietary software. -#qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. -##qt5-custom-build-bot: -- see below. -qt5-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt5-custom-builds: default ; Requires default config with GCC as host compiler. qt5-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. +#qt5-custom-build-bot: -- see below. -# @@ TMP -# -#qt6-custom-builds: latest ; Requires proprietary software. -#qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. -##qt6-custom-build-bot: -- see below. -qt6-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt6-custom-builds: default ; Requires default config with GCC as host compiler. qt6-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. +#qt6-custom-build-bot: -- see below. custom-build-bot: \ @@ -121,24 +106,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -157,24 +124,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -193,24 +142,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -228,21 +159,3 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv 9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ - -qt6-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ diff --git a/odb-examples/mapping/buildfile b/odb-examples/mapping/buildfile index 77d7b1a..2684561 100644 --- a/odb-examples/mapping/buildfile +++ b/odb-examples/mapping/buildfile @@ -1,5 +1,5 @@ # file : mapping/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/mapping/driver.cxx b/odb-examples/mapping/driver.cxx index 5e9d067..c1e6646 100644 --- a/odb-examples/mapping/driver.cxx +++ b/odb-examples/mapping/driver.cxx @@ -41,8 +41,8 @@ main (int argc, char* argv[]) // Query for a person using data members of our custom-mapped types. // { - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; transaction t (db->begin ()); diff --git a/odb-examples/mapping/person.hxx b/odb-examples/mapping/person.hxx index c1a43b9..41f2fe5 100644 --- a/odb-examples/mapping/person.hxx +++ b/odb-examples/mapping/person.hxx @@ -95,7 +95,7 @@ private: person (): born_ (0, 0, 0) {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/mapping/testscript b/odb-examples/mapping/testscript index f9bac50..7161fcf 100644 --- a/odb-examples/mapping/testscript +++ b/odb-examples/mapping/testscript @@ -1,12 +1,11 @@ # file : mapping/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/mapping/traits-mssql.hxx b/odb-examples/mapping/traits-mssql.hxx index 3713f82..98fc687 100644 --- a/odb-examples/mapping/traits-mssql.hxx +++ b/odb-examples/mapping/traits-mssql.hxx @@ -24,9 +24,9 @@ namespace odb class value_traits<bool, id_string> { public: - typedef bool value_type; - typedef bool query_type; - typedef char* image_type; + using value_type = bool; + using query_type = bool; + using image_type = char*; static void set_value (bool& v, @@ -57,9 +57,9 @@ namespace odb class value_traits< ::date, id_date> { public: - typedef ::date value_type; - typedef ::date query_type; - typedef mssql::date image_type; + using value_type = ::date; + using query_type = ::date; + using image_type = mssql::date; static void set_value (value_type& v, const image_type& i, bool is_null) diff --git a/odb-examples/mapping/traits-mysql.hxx b/odb-examples/mapping/traits-mysql.hxx index a15d1c9..d79e0be 100644 --- a/odb-examples/mapping/traits-mysql.hxx +++ b/odb-examples/mapping/traits-mysql.hxx @@ -23,9 +23,9 @@ namespace odb class value_traits<bool, id_string> { public: - typedef bool value_type; - typedef bool query_type; - typedef details::buffer image_type; + using value_type = bool; + using query_type = bool; + using image_type = details::buffer; static void set_value (bool& v, @@ -56,9 +56,9 @@ namespace odb class value_traits<date, id_date> { public: - typedef date value_type; - typedef date query_type; - typedef MYSQL_TIME image_type; + using value_type = date; + using query_type = date; + using image_type = MYSQL_TIME; static void set_value (date& v, const MYSQL_TIME& i, bool is_null) diff --git a/odb-examples/mapping/traits-oracle.hxx b/odb-examples/mapping/traits-oracle.hxx index a5683c6..1898379 100644 --- a/odb-examples/mapping/traits-oracle.hxx +++ b/odb-examples/mapping/traits-oracle.hxx @@ -25,9 +25,9 @@ namespace odb class value_traits<bool, id_string> { public: - typedef bool value_type; - typedef bool query_type; - typedef char* image_type; + using value_type = bool; + using query_type = bool; + using image_type = char*; static void set_value (bool& v, @@ -58,9 +58,9 @@ namespace odb class value_traits<date, id_date> { public: - typedef date value_type; - typedef date query_type; - typedef char* image_type; + using value_type = date; + using query_type = date; + using image_type = char*; static void set_value (date& v, const char* b, bool is_null) diff --git a/odb-examples/mapping/traits-pgsql.hxx b/odb-examples/mapping/traits-pgsql.hxx index aeefa52..820ea91 100644 --- a/odb-examples/mapping/traits-pgsql.hxx +++ b/odb-examples/mapping/traits-pgsql.hxx @@ -25,9 +25,9 @@ namespace odb class value_traits<bool, id_string> { public: - typedef bool value_type; - typedef bool query_type; - typedef details::buffer image_type; + using value_type = bool; + using query_type = bool; + using image_type = details::buffer; static void set_value (bool& v, @@ -61,9 +61,9 @@ namespace odb class value_traits<date, id_date> { public: - typedef date value_type; - typedef date query_type; - typedef int image_type; + using value_type = date; + using query_type = date; + using image_type = int; // The difference between the PostgreSQL epoch and the Unix epoch // in seconds. diff --git a/odb-examples/mapping/traits-sqlite.hxx b/odb-examples/mapping/traits-sqlite.hxx index cd7afc3..ffd91f8 100644 --- a/odb-examples/mapping/traits-sqlite.hxx +++ b/odb-examples/mapping/traits-sqlite.hxx @@ -24,9 +24,9 @@ namespace odb class value_traits<bool, id_text> { public: - typedef bool value_type; - typedef bool query_type; - typedef details::buffer image_type; + using value_type = bool; + using query_type = bool; + using image_type = details::buffer; static void set_value (bool& v, @@ -61,9 +61,9 @@ namespace odb class value_traits<date, id_text> { public: - typedef date value_type; - typedef date query_type; - typedef details::buffer image_type; + using value_type = date; + using query_type = date; + using image_type = details::buffer; static void set_value (date& v, diff --git a/odb-examples/mssql-schema.testscript b/odb-examples/mssql-schema.testscript index 5f56536..aa467d3 100644 --- a/odb-examples/mssql-schema.testscript +++ b/odb-examples/mssql-schema.testscript @@ -1,5 +1,5 @@ # file : mssql-schema.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the Microsoft SQL Server database schema creation canned command base. # diff --git a/odb-examples/mssql.testscript b/odb-examples/mssql.testscript index 671cb7a..bab6a8a 100644 --- a/odb-examples/mssql.testscript +++ b/odb-examples/mssql.testscript @@ -1,5 +1,5 @@ # file : mssql.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the Microsoft SQL Server database schema creation canned command and # setup the example driver command line for the subsequent examples. diff --git a/odb-examples/mysql-schema.testscript b/odb-examples/mysql-schema.testscript index dfa7852..539194d 100644 --- a/odb-examples/mysql-schema.testscript +++ b/odb-examples/mysql-schema.testscript @@ -1,5 +1,5 @@ # file : mysql-schema.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the MySQL database schema creation canned command base. # diff --git a/odb-examples/mysql.testscript b/odb-examples/mysql.testscript index 3ee78ea..7063a38 100644 --- a/odb-examples/mysql.testscript +++ b/odb-examples/mysql.testscript @@ -1,5 +1,5 @@ # file : mysql.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the MySQL database schema creation canned command and setup the # example driver command line for the subsequent examples. diff --git a/odb-examples/optimistic/buildfile b/odb-examples/optimistic/buildfile index 576fff6..a7dffa2 100644 --- a/odb-examples/optimistic/buildfile +++ b/odb-examples/optimistic/buildfile @@ -1,5 +1,5 @@ # file : optimistic/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/optimistic/driver.cxx b/odb-examples/optimistic/driver.cxx index 968648c..ec7f1d2 100644 --- a/odb-examples/optimistic/driver.cxx +++ b/odb-examples/optimistic/driver.cxx @@ -26,7 +26,7 @@ main (int argc, char* argv[]) // // At this point the initial version (1) is assigned. // - unsigned long id; + unsigned long long id; { person p ("John", "Doe", 21); diff --git a/odb-examples/optimistic/person.hxx b/odb-examples/optimistic/person.hxx index 5b7177f..a3f3f0f 100644 --- a/odb-examples/optimistic/person.hxx +++ b/odb-examples/optimistic/person.hxx @@ -44,7 +44,7 @@ public: age_ = age; } - unsigned long + unsigned long long version () const { return version_; @@ -54,10 +54,10 @@ private: friend class odb::access; #pragma db id auto - unsigned long id_; + unsigned long long id_; #pragma db version - unsigned long version_; + unsigned long long version_; std::string first_; std::string last_; diff --git a/odb-examples/optimistic/testscript b/odb-examples/optimistic/testscript index 0db3221..bd41f58 100644 --- a/odb-examples/optimistic/testscript +++ b/odb-examples/optimistic/testscript @@ -1,12 +1,11 @@ # file : optimistic/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/oracle-schema.testscript b/odb-examples/oracle-schema.testscript index 29a95f1..323b415 100644 --- a/odb-examples/oracle-schema.testscript +++ b/odb-examples/oracle-schema.testscript @@ -1,5 +1,5 @@ # file : oracle-schema.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the Oracle database schema creation canned command base. # diff --git a/odb-examples/oracle.testscript b/odb-examples/oracle.testscript index f8ee224..428c598 100644 --- a/odb-examples/oracle.testscript +++ b/odb-examples/oracle.testscript @@ -1,5 +1,5 @@ # file : oracle.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the Oracle database schema creation canned command and setup the # example driver command line for the subsequent examples. diff --git a/odb-examples/pgsql-schema.testscript b/odb-examples/pgsql-schema.testscript index 8659bcd..0c3f835 100644 --- a/odb-examples/pgsql-schema.testscript +++ b/odb-examples/pgsql-schema.testscript @@ -1,5 +1,5 @@ # file : pgsql-schema.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the PostgreSQL database schema creation canned command base. # diff --git a/odb-examples/pgsql.testscript b/odb-examples/pgsql.testscript index 3ae9219..fd85d37 100644 --- a/odb-examples/pgsql.testscript +++ b/odb-examples/pgsql.testscript @@ -1,5 +1,5 @@ # file : pgsql.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Create the PostgreSQL database schema creation canned command and setup the # example driver command line for the subsequent tests. diff --git a/odb-examples/pimpl/buildfile b/odb-examples/pimpl/buildfile index 3191c3a..117f180 100644 --- a/odb-examples/pimpl/buildfile +++ b/odb-examples/pimpl/buildfile @@ -1,5 +1,5 @@ # file : pimpl/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/pimpl/driver.cxx b/odb-examples/pimpl/driver.cxx index 50fb62a..8e5786c 100644 --- a/odb-examples/pimpl/driver.cxx +++ b/odb-examples/pimpl/driver.cxx @@ -33,7 +33,7 @@ main (int argc, char* argv[]) } { - typedef odb::result<person> result; + using result = odb::result<person>; transaction t (db->begin ()); result r (db->query<person> ()); diff --git a/odb-examples/pimpl/testscript b/odb-examples/pimpl/testscript index d4cbfd4..e4e4185 100644 --- a/odb-examples/pimpl/testscript +++ b/odb-examples/pimpl/testscript @@ -1,12 +1,11 @@ # file : pimpl/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/prepared/buildfile b/odb-examples/prepared/buildfile index c167735..aed63ff 100644 --- a/odb-examples/prepared/buildfile +++ b/odb-examples/prepared/buildfile @@ -1,5 +1,5 @@ # file : prepared/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/prepared/driver.cxx b/odb-examples/prepared/driver.cxx index 73b3993..1e2b5e8 100644 --- a/odb-examples/prepared/driver.cxx +++ b/odb-examples/prepared/driver.cxx @@ -27,7 +27,7 @@ struct params static void query_factory (const char* name, connection& c) { - typedef odb::query<person> query; + using query = odb::query<person>; unique_ptr<params> p (new params); query q (query::age > query::_ref (p->age) && @@ -72,9 +72,9 @@ main (int argc, char* argv[]) t.commit (); } - typedef odb::query<person> query; - typedef odb::prepared_query<person> prep_query; - typedef odb::result<person> result; + using query = odb::query<person>; + using prep_query = odb::prepared_query<person>; + using result = odb::result<person>; // Example of an uncached prepared query in the same transaction. // @@ -205,8 +205,8 @@ main (int argc, char* argv[]) // following example. // { - typedef odb::query<person_count> query; - typedef odb::prepared_query<person_count> prep_query; + using query = odb::query<person_count>; + using prep_query = odb::prepared_query<person_count>; transaction t (db->begin ()); diff --git a/odb-examples/prepared/person.hxx b/odb-examples/prepared/person.hxx index dc8e6fe..e9a4617 100644 --- a/odb-examples/prepared/person.hxx +++ b/odb-examples/prepared/person.hxx @@ -44,7 +44,7 @@ private: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/prepared/testscript b/odb-examples/prepared/testscript index af2d0c0..f0569b0 100644 --- a/odb-examples/prepared/testscript +++ b/odb-examples/prepared/testscript @@ -1,12 +1,11 @@ # file : prepared/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/qt/buildfile b/odb-examples/qt/buildfile index 49085ec..1018437 100644 --- a/odb-examples/qt/buildfile +++ b/odb-examples/qt/buildfile @@ -1,5 +1,5 @@ # file : qt/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain if ($build.meta_operation != 'dist') { diff --git a/odb-examples/qt/driver.cxx b/odb-examples/qt/driver.cxx index 97f7fe4..0d0b96f 100644 --- a/odb-examples/qt/driver.cxx +++ b/odb-examples/qt/driver.cxx @@ -155,8 +155,8 @@ main (int argc, char* argv[]) // April 1978. // { - typedef odb::query<Employee> query; - typedef odb::result<Employee> result; + using query = odb::query<Employee>; + using result = odb::result<Employee>; session s; transaction t (db->begin ()); diff --git a/odb-examples/qt/employee.hxx b/odb-examples/qt/employee.hxx index 82bbcfb..ab38b14 100644 --- a/odb-examples/qt/employee.hxx +++ b/odb-examples/qt/employee.hxx @@ -20,8 +20,8 @@ // class Employee; -typedef QSet<QString> Emails; -typedef QList<QLazyWeakPointer<Employee> > Employees; +using Emails = QSet<QString>; +using Employees = QList<QLazyWeakPointer<Employee>>; #pragma db object class Employer diff --git a/odb-examples/qt/testscript b/odb-examples/qt/testscript index d2b08a1..3dc8c37 100644 --- a/odb-examples/qt/testscript +++ b/odb-examples/qt/testscript @@ -1,12 +1,11 @@ # file : qt/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/query/buildfile b/odb-examples/query/buildfile index 7dcd0e2..4bce947 100644 --- a/odb-examples/query/buildfile +++ b/odb-examples/query/buildfile @@ -1,5 +1,5 @@ # file : query/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/query/driver.cxx b/odb-examples/query/driver.cxx index 67f872b..5911cac 100644 --- a/odb-examples/query/driver.cxx +++ b/odb-examples/query/driver.cxx @@ -18,8 +18,8 @@ using namespace std; using odb::database; using odb::transaction; -typedef odb::query<person> query; -typedef odb::result<person> result; +using query = odb::query<person>; +using result = odb::result<person>; static void print (person& p) @@ -49,7 +49,7 @@ main (int argc, char* argv[]) unique_ptr<database> db (create_database (argc, argv)); { - typedef vector<person> people; + using people = vector<person>; people p; diff --git a/odb-examples/query/person.hxx b/odb-examples/query/person.hxx index 59e0721..45400b9 100644 --- a/odb-examples/query/person.hxx +++ b/odb-examples/query/person.hxx @@ -58,7 +58,7 @@ private: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; odb::nullable<std::string> middle_; diff --git a/odb-examples/query/testscript b/odb-examples/query/testscript index b644c55..dbd8b15 100644 --- a/odb-examples/query/testscript +++ b/odb-examples/query/testscript @@ -1,12 +1,11 @@ # file : query/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/relationship/buildfile b/odb-examples/relationship/buildfile index 2b4ffed..ff4ed32 100644 --- a/odb-examples/relationship/buildfile +++ b/odb-examples/relationship/buildfile @@ -1,5 +1,5 @@ # file : relationship/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/relationship/driver.cxx b/odb-examples/relationship/driver.cxx index 1f74824..0465482 100644 --- a/odb-examples/relationship/driver.cxx +++ b/odb-examples/relationship/driver.cxx @@ -100,8 +100,8 @@ main (int argc, char* argv[]) } } - typedef odb::query<employee> query; - typedef odb::result<employee> result; + using query = odb::query<employee>; + using result = odb::result<employee>; // Load employees with "Doe" as the last name and print what we've got. // We use a session in this and subsequent transactions to make sure diff --git a/odb-examples/relationship/employee.hxx b/odb-examples/relationship/employee.hxx index 4133c05..bfb2523 100644 --- a/odb-examples/relationship/employee.hxx +++ b/odb-examples/relationship/employee.hxx @@ -26,7 +26,7 @@ class employer; class project; class employee; -typedef std::vector<std::shared_ptr<project>> projects; +using projects = std::vector<std::shared_ptr<project>>; #pragma db object class employer @@ -80,7 +80,7 @@ private: class employee { public: - typedef ::employer employer_type; + using employer_type = ::employer; employee (const std::string& first, const std::string& last, @@ -119,7 +119,7 @@ public: // Projects. // - typedef ::projects projects_type; + using projects_type = ::projects; const projects_type& projects () const @@ -139,7 +139,7 @@ private: employee () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/relationship/testscript b/odb-examples/relationship/testscript index d23eb2d..e340b4e 100644 --- a/odb-examples/relationship/testscript +++ b/odb-examples/relationship/testscript @@ -1,12 +1,11 @@ # file : relationship/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/schema/custom/buildfile b/odb-examples/schema/custom/buildfile index 349da2c..7c2f9d0 100644 --- a/odb-examples/schema/custom/buildfile +++ b/odb-examples/schema/custom/buildfile @@ -1,5 +1,5 @@ # file : schema/custom/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/schema/custom/driver.cxx b/odb-examples/schema/custom/driver.cxx index f9d40e2..6696cb2 100644 --- a/odb-examples/schema/custom/driver.cxx +++ b/odb-examples/schema/custom/driver.cxx @@ -204,8 +204,8 @@ main (int argc, char* argv[]) // Load employees with "Doe" as the last name and print what we've got. // { - typedef odb::query<employee> query; - typedef odb::result<employee> result; + using query = odb::query<employee>; + using result = odb::result<employee>; session s; transaction t (db->begin ()); diff --git a/odb-examples/schema/custom/employee.hxx b/odb-examples/schema/custom/employee.hxx index 200017d..c916dfc 100644 --- a/odb-examples/schema/custom/employee.hxx +++ b/odb-examples/schema/custom/employee.hxx @@ -10,7 +10,7 @@ #include <odb/core.hxx> -typedef std::vector<std::string> degrees; +using degrees = std::vector<std::string>; #pragma db value class name @@ -71,9 +71,9 @@ private: class employee { public: - typedef ::employer employer_type; + using employer_type = ::employer; - employee (unsigned long id, + employee (unsigned long long id, const std::string& first, const std::string& last, std::shared_ptr<employer_type> employer) @@ -83,7 +83,7 @@ public: // Name. // - typedef ::name name_type; + using name_type = ::name; const name_type& name () const @@ -93,7 +93,7 @@ public: // Degrees. // - typedef ::degrees degrees_type; + using degrees_type = ::degrees; const degrees_type& degrees () const @@ -127,7 +127,7 @@ private: employee (): name_ ("", "") {} #pragma db id type("INTEGER") column("ssn") - unsigned long id_; + unsigned long long id_; #pragma db column("") // No column prefix. name_type name_; diff --git a/odb-examples/schema/custom/testscript b/odb-examples/schema/custom/testscript index a482025..6e46a11 100644 --- a/odb-examples/schema/custom/testscript +++ b/odb-examples/schema/custom/testscript @@ -1,5 +1,5 @@ # file : schema/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../../database-options.testscript @@ -7,7 +7,6 @@ test.arguments += $($(database)_options) +if $sqlite test.cleanups += &odb-test.db -end : basics : diff --git a/odb-examples/schema/embedded/buildfile b/odb-examples/schema/embedded/buildfile index 79a45a0..699a71f 100644 --- a/odb-examples/schema/embedded/buildfile +++ b/odb-examples/schema/embedded/buildfile @@ -1,5 +1,5 @@ # file : schema/embedded/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/schema/embedded/driver.cxx b/odb-examples/schema/embedded/driver.cxx index 3aadef0..2c27e97 100644 --- a/odb-examples/schema/embedded/driver.cxx +++ b/odb-examples/schema/embedded/driver.cxx @@ -21,8 +21,8 @@ main (int argc, char* argv[]) { try { - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; unique_ptr<database> db (create_database (argc, argv)); diff --git a/odb-examples/schema/embedded/person.hxx b/odb-examples/schema/embedded/person.hxx index e73ddcf..855c4fa 100644 --- a/odb-examples/schema/embedded/person.hxx +++ b/odb-examples/schema/embedded/person.hxx @@ -49,7 +49,7 @@ private: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/schema/embedded/testscript b/odb-examples/schema/embedded/testscript index 1310f1b..76e426c 100644 --- a/odb-examples/schema/embedded/testscript +++ b/odb-examples/schema/embedded/testscript @@ -1,5 +1,5 @@ # file : schema/embedded/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../../database-options.testscript @@ -7,7 +7,6 @@ test.arguments += $($(database)_options) +if $sqlite test.cleanups += &odb-test.db -end : basics : diff --git a/odb-examples/section/buildfile b/odb-examples/section/buildfile index 104ea30..e7a0257 100644 --- a/odb-examples/section/buildfile +++ b/odb-examples/section/buildfile @@ -1,5 +1,5 @@ # file : section/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/section/driver.cxx b/odb-examples/section/driver.cxx index 900127b..64fd679 100644 --- a/odb-examples/section/driver.cxx +++ b/odb-examples/section/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) { unique_ptr<database> db (create_database (argc, argv)); - unsigned long id; + unsigned long long id; // Create a persistent person object. // diff --git a/odb-examples/section/person.hxx b/odb-examples/section/person.hxx index 996fc19..6c43871 100644 --- a/odb-examples/section/person.hxx +++ b/odb-examples/section/person.hxx @@ -48,7 +48,7 @@ public: // Nicknames. // - typedef odb::vector<std::string> names; + using names = odb::vector<std::string>; const names& nicknames () const @@ -87,7 +87,7 @@ private: person () {} #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; diff --git a/odb-examples/section/testscript b/odb-examples/section/testscript index 81566a1..a4e2f31 100644 --- a/odb-examples/section/testscript +++ b/odb-examples/section/testscript @@ -1,12 +1,11 @@ # file : section/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-examples/sqlite.testscript b/odb-examples/sqlite.testscript index 95b2da8..b10d937 100644 --- a/odb-examples/sqlite.testscript +++ b/odb-examples/sqlite.testscript @@ -1,5 +1,5 @@ # file : sqlite.testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain # Setup the example driver command line for the subsequent SQLite examples. # diff --git a/odb-examples/view/buildfile b/odb-examples/view/buildfile index 51e07ba..6e9f323 100644 --- a/odb-examples/view/buildfile +++ b/odb-examples/view/buildfile @@ -1,5 +1,5 @@ # file : view/buildfile -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain import libodb = libodb%lib{odb} diff --git a/odb-examples/view/driver.cxx b/odb-examples/view/driver.cxx index eed0d4b..9b7fdb6 100644 --- a/odb-examples/view/driver.cxx +++ b/odb-examples/view/driver.cxx @@ -154,8 +154,8 @@ main (int argc, char* argv[]) // view. // { - typedef odb::query<employee_name> query; - typedef odb::result<employee_name> result; + using query = odb::query<employee_name>; + using result = odb::result<employee_name>; transaction t (db->begin ()); @@ -194,8 +194,8 @@ main (int argc, char* argv[]) // Doe last name using the employee_employer view. // { - typedef odb::query<employee_employer> query; - typedef odb::result<employee_employer> result; + using query = odb::query<employee_employer>; + using result = odb::result<employee_employer>; transaction t (db->begin ()); @@ -217,7 +217,7 @@ main (int argc, char* argv[]) // Calculate min/max employee ages for each employer. // { - typedef odb::result<employer_age> result; + using result = odb::result<employer_age>; transaction t (db->begin ()); @@ -227,7 +227,7 @@ main (int argc, char* argv[]) // // This one restricts the calculation to a specific employer: // - // typedef odb::query<employer_age> query; + // using query = odb::query<employer_age>; // // result r (db->query<employer_age> ( // query::employer::name == "Simple Tech Ltd")); @@ -253,8 +253,8 @@ main (int argc, char* argv[]) // and nationality. // { - typedef odb::query<employee_country> query; - typedef odb::result<employee_country> result; + using query = odb::query<employee_country>; + using result = odb::result<employee_country>; transaction t (db->begin ()); @@ -278,8 +278,8 @@ main (int argc, char* argv[]) // The same but using the object loading view. // { - typedef odb::query<employee_country_objects> query; - typedef odb::result<employee_country_objects> result; + using query = odb::query<employee_country_objects>; + using result = odb::result<employee_country_objects>; transaction t (db->begin ()); @@ -315,7 +315,7 @@ main (int argc, char* argv[]) // Get the list of employers that have any employees. // { - typedef odb::result<employer_with_employees> result; + using result = odb::result<employer_with_employees>; shared_ptr<employer> es (new employer (3, "Empty Shell LLC")); @@ -338,7 +338,7 @@ main (int argc, char* argv[]) // Get the list of employees that have accumulated vacation days. // { - typedef odb::result<employee_vacation> result; + using result = odb::result<employee_vacation>; transaction t (db->begin ()); @@ -364,7 +364,7 @@ main (int argc, char* argv[]) // time using the improved employee_vacation2 view. // { - typedef odb::result<employee_vacation2> result; + using result = odb::result<employee_vacation2>; transaction t (db->begin ()); @@ -387,7 +387,7 @@ main (int argc, char* argv[]) // Show the previous employers using the employee_prev_employer view. // { - typedef odb::result<employee_prev_employer> result; + using result = odb::result<employee_prev_employer>; transaction t (db->begin ()); diff --git a/odb-examples/view/employee.hxx b/odb-examples/view/employee.hxx index 5add690..9d31a2e 100644 --- a/odb-examples/view/employee.hxx +++ b/odb-examples/view/employee.hxx @@ -41,7 +41,7 @@ private: class employer { public: - employer (unsigned long id, const std::string& name) + employer (unsigned long long id, const std::string& name) : id_ (id), name_ (name) { } @@ -58,7 +58,7 @@ private: employer () {} #pragma db id - unsigned long id_; + unsigned long long id_; std::string name_; }; @@ -67,7 +67,7 @@ private: class employee { public: - employee (unsigned long id, + employee (unsigned long long id, const std::string& first, const std::string& last, unsigned short age, @@ -131,7 +131,7 @@ private: employee () {} #pragma db id - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; @@ -280,7 +280,7 @@ struct employer_with_employees struct employee_vacation { #pragma db type("INTEGER") - unsigned long id; + unsigned long long id; #pragma db type("INTEGER") unsigned short days; @@ -293,7 +293,7 @@ struct employee_vacation struct employee_vacation1 { #pragma db column("employee_id") type("INTEGER") - unsigned long id; + unsigned long long id; #pragma db column("vacation_days") type("INTEGER") unsigned short days; diff --git a/odb-examples/view/testscript b/odb-examples/view/testscript index d8be673..cf57dc7 100644 --- a/odb-examples/view/testscript +++ b/odb-examples/view/testscript @@ -1,12 +1,11 @@ # file : view/testscript -# license : GNU GPL v2; see accompanying LICENSE file +# license : not copyrighted - public domain .include ../database-options.testscript .include ../$(database).testscript +if! $sqlite $create_schema -end : basics : diff --git a/odb-tests/GPLv2 b/odb-tests/GPLv2 index 3912109..08e5586 100644..120000 --- a/odb-tests/GPLv2 +++ b/odb-tests/GPLv2 @@ -1,340 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU 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. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), 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 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 show them these terms so they know 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. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - 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 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 derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 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 License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -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. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary 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 - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 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 Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing 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 for copying, distributing or modifying -the Program or works based on it. - - 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. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. 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 this 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 -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. 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 - - 11. 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. - - 12. 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 - - 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 the public, 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 2 of the License, 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 St, 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) year 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 is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +../GPLv2
\ No newline at end of file diff --git a/odb-tests/LICENSE b/odb-tests/LICENSE index d96b938..fa23045 100644 --- a/odb-tests/LICENSE +++ b/odb-tests/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as diff --git a/odb-tests/NEWS b/odb-tests/NEWS deleted file mode 120000 index 0fae0f8..0000000 --- a/odb-tests/NEWS +++ /dev/null @@ -1 +0,0 @@ -../NEWS
\ No newline at end of file diff --git a/odb-tests/README.md b/odb-tests/README.md index 5b3662c..0dd2417 100644 --- a/odb-tests/README.md +++ b/odb-tests/README.md @@ -1,7 +1,16 @@ -# odb-tests - tests for ODB compiler +# odb-tests - ODB tests -This package contains tests for `odb`, object-relational mapping (ORM) -compiler for C++. +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains tests for the ODB compiler as well as runtime and +profile libraries. ## Setting up PostgreSQL for running tests diff --git a/odb-tests/boost/common/multi-index/testscript b/odb-tests/boost/common/multi-index/testscript index c86fcaa..50fd7fb 100644 --- a/odb-tests/boost/common/multi-index/testscript +++ b/odb-tests/boost/common/multi-index/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/boost/common/optional/testscript b/odb-tests/boost/common/optional/testscript index b24c252..a3ae6b4 100644 --- a/odb-tests/boost/common/optional/testscript +++ b/odb-tests/boost/common/optional/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/boost/common/smart-ptr/testscript b/odb-tests/boost/common/smart-ptr/testscript index 095e2e9..1945fb2 100644 --- a/odb-tests/boost/common/smart-ptr/testscript +++ b/odb-tests/boost/common/smart-ptr/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/boost/common/unordered/testscript b/odb-tests/boost/common/unordered/testscript index d152545..ef0e40b 100644 --- a/odb-tests/boost/common/unordered/testscript +++ b/odb-tests/boost/common/unordered/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/boost/common/uuid/testscript b/odb-tests/boost/common/uuid/testscript index f9e6e54..70412a5 100644 --- a/odb-tests/boost/common/uuid/testscript +++ b/odb-tests/boost/common/uuid/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/build/root.build b/odb-tests/build/root.build index 5eb8920..88b4182 100644 --- a/odb-tests/build/root.build +++ b/odb-tests/build/root.build @@ -172,8 +172,7 @@ config [string] config.odb_tests.pgsql.port # Note: config.odb_tests.pgsql.bulk_default is reflected from manifest. # config [bool] config.odb_tests.pgsql.bulk_default ?= false -config [bool] config.odb_tests.pgsql.bulk ?= ($cxx.target.class != 'windows' && \ - $config.odb_tests.pgsql.bulk_default) +config [bool] config.odb_tests.pgsql.bulk ?= $config.odb_tests.pgsql.bulk_default pgsql_bulk = $config.odb_tests.pgsql.bulk # Oracle @@ -327,7 +326,6 @@ if! $skeleton if ($db == '') # *-odb.?xx target group? db = ($multi ? 'common' : $databases[0]) - end # If the external SQL schema file will be generated, then add it as a # dynamic target group member. @@ -339,18 +337,19 @@ if! $skeleton # will never appear as standalone option values. # if ($db != 'common' && $regex.find_match($odb_options, '--generate-schema')) + { schema_format = ($db == 'sqlite' ? 'embedded' : 'sql') for o: $odb_options + { if ($o == '--schema-format') schema_format = [null] # Indicate that the schema format comes next. elif ($schema_format == [null]) schema_format = $o - end - end + } + } else schema_format = '' - end ts = ($schema_format == 'sql' \ ? "$directory($hp)/$regex.replace($bn, '(.+)-odb(-.+)?', '\1\2').sql" \ @@ -366,6 +365,7 @@ if! $skeleton std = false for o: $odb_options + { if ($o == '--changelog') changelog = [null] # Indicate that the changelog path comes next. elif ($changelog == [null]) @@ -376,15 +376,15 @@ if! $skeleton suppress_migration = true elif ($o == '--std') std = true - end - end + } if ($changelog != '') + { if ($init_changelog) ts = ($ts == '' ? "$changelog" : "$ts$\n$changelog") - end if ($schema_format == 'sql' && !$suppress_migration) + { n = $base($leaf($path($<[0]))) # Note that it's not easy to deduce the object model migration files @@ -393,11 +393,12 @@ if! $skeleton # variable. # for v: $schema_versions + { ns = "$out_base/$n-$v-pre.sql$\n$out_base/$n-$v-post.sql" ts = ($ts == '' ? "$ns" : "$ts$\n$ns") - end - end - end + } + } + } depdb dyndep --dyn-target --target-what 'generated schema' --format lines \ -- echo "$ts" diff --git a/odb-tests/common/access/testscript b/odb-tests/common/access/testscript index b0933f9..e1d3dcc 100644 --- a/odb-tests/common/access/testscript +++ b/odb-tests/common/access/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/as/testscript b/odb-tests/common/as/testscript index fc1d0d4..dbb36aa 100644 --- a/odb-tests/common/as/testscript +++ b/odb-tests/common/as/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/blob/testscript b/odb-tests/common/blob/testscript index 3b7f962..9e60c57 100644 --- a/odb-tests/common/blob/testscript +++ b/odb-tests/common/blob/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/bulk/testscript b/odb-tests/common/bulk/testscript index 8dcdc85..57306ed 100644 --- a/odb-tests/common/bulk/testscript +++ b/odb-tests/common/bulk/testscript @@ -458,7 +458,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -477,29 +477,28 @@ if ($pgsql && $pgsql_bulk) { .include ../../pgsql.testscript - $create_schema; + $create_schema # Query the PostgreSQL server version and only run the test if it is 7.4 or # above. # $pgsql_client_cmd --tuples-only -c 'SELECT VERSION()' | \ sed -n -e 's/.*PostgreSQL (\d+\.\d+).*/\1/p' | \ - set version [string]; + set version [string] if ("$version" == "") exit "unable to obtain PostgreSQL server version" - end; - sed -n -e 's/(.+)\..+/\1/p' <"$version" | set major_version [uint64]; - sed -n -e 's/.+\.(.+)/\1/p' <"$version" | set minor_version [uint64]; + sed -n -e 's/(.+)\..+/\1/p' <"$version" | set major_version [uint64] + sed -n -e 's/.+\.(.+)/\1/p' <"$version" | set minor_version [uint64] if (($major_version == 7 && minor_version >= 4) || $major_version > 7) + { if $multi $* # Noop. else $* >>>../pgsql-output - end - end + } } : oracle @@ -508,13 +507,12 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema if $multi $* # Noop. else $* >>>../output - end } : mssql @@ -523,11 +521,10 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema if $multi $* # Noop. else $* >>>../output - end } diff --git a/odb-tests/common/callback/testscript b/odb-tests/common/callback/testscript index 30a4336..40e56b0 100644 --- a/odb-tests/common/callback/testscript +++ b/odb-tests/common/callback/testscript @@ -76,7 +76,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -95,7 +95,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -105,7 +105,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -115,6 +115,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/changelog/buildfile b/odb-tests/common/changelog/buildfile index 751b7a7..0193435 100644 --- a/odb-tests/common/changelog/buildfile +++ b/odb-tests/common/changelog/buildfile @@ -24,7 +24,6 @@ file{odb.options}: libue{test-meta} for o: $pops echo $o >+$f - end }} # Testscript's run-time prerequisites. diff --git a/odb-tests/common/changelog/testscript b/odb-tests/common/changelog/testscript index 60eadae..ec6313e 100644 --- a/odb-tests/common/changelog/testscript +++ b/odb-tests/common/changelog/testscript @@ -15,6 +15,7 @@ if $mysql odb_options += --database 'mysql' --changelog-dir $~ for h: $headers + { n = $base($leaf($h)) $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql @@ -24,7 +25,7 @@ if $mysql $* $odb_options -DBVER=2 -DCVER=3 $h diff $src_base/$n-mysql-patch.xml $(n).xml - end + } } : sqlite @@ -34,6 +35,7 @@ if $sqlite odb_options += --database 'sqlite' --changelog-dir $~ for h: $headers + { n = $base($leaf($h)) $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql @@ -43,7 +45,7 @@ if $sqlite $* $odb_options -DBVER=2 -DCVER=3 $h diff $src_base/$n-sqlite-patch.xml $(n).xml - end + } } : pgsql @@ -53,6 +55,7 @@ if $pgsql odb_options += --database 'pgsql' --changelog-dir $~ for h: $headers + { n = $base($leaf($h)) $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql @@ -62,7 +65,7 @@ if $pgsql $* $odb_options -DBVER=2 -DCVER=3 $h diff $src_base/$n-pgsql-patch.xml $(n).xml - end + } } : oracle @@ -72,6 +75,7 @@ if $oracle odb_options += --database 'oracle' --changelog-dir $~ for h: $headers + { n = $base($leaf($h)) $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql @@ -81,7 +85,7 @@ if $oracle $* $odb_options -DBVER=2 -DCVER=3 $h diff $src_base/$n-oracle-patch.xml $(n).xml - end + } } : mssql @@ -91,6 +95,7 @@ if $mssql odb_options += --database 'mssql' --changelog-dir $~ for h: $headers + { n = $base($leaf($h)) $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql @@ -100,5 +105,5 @@ if $mssql $* $odb_options -DBVER=2 -DCVER=3 $h diff $src_base/$n-mssql-patch.xml $(n).xml - end + } } diff --git a/odb-tests/common/circular/single/testscript b/odb-tests/common/circular/single/testscript index 480ef6d..ee3066c 100644 --- a/odb-tests/common/circular/single/testscript +++ b/odb-tests/common/circular/single/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/composite/testscript b/odb-tests/common/composite/testscript index f890985..bda4a3e 100644 --- a/odb-tests/common/composite/testscript +++ b/odb-tests/common/composite/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/const-member/testscript b/odb-tests/common/const-member/testscript index 48a1456..7a9ef55 100644 --- a/odb-tests/common/const-member/testscript +++ b/odb-tests/common/const-member/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/const-object/testscript b/odb-tests/common/const-object/testscript index 928bad0..560dc94 100644 --- a/odb-tests/common/const-object/testscript +++ b/odb-tests/common/const-object/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/container/basics/testscript b/odb-tests/common/container/basics/testscript index 9e6bfb9..470d862 100644 --- a/odb-tests/common/container/basics/testscript +++ b/odb-tests/common/container/basics/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/container/change-tracking/testscript b/odb-tests/common/container/change-tracking/testscript index d690a30..1096cd0 100644 --- a/odb-tests/common/container/change-tracking/testscript +++ b/odb-tests/common/container/change-tracking/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/ctor/testscript b/odb-tests/common/ctor/testscript index 60bf027..c3fef35 100644 --- a/odb-tests/common/ctor/testscript +++ b/odb-tests/common/ctor/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/default/testscript b/odb-tests/common/default/testscript index 47ab5ec..3349de0 100644 --- a/odb-tests/common/default/testscript +++ b/odb-tests/common/default/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/definition/testscript b/odb-tests/common/definition/testscript index 5d59884..bc33b65 100644 --- a/odb-tests/common/definition/testscript +++ b/odb-tests/common/definition/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/enum/testscript b/odb-tests/common/enum/testscript index fbf1a99..1a6d9f9 100644 --- a/odb-tests/common/enum/testscript +++ b/odb-tests/common/enum/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/erase-query/testscript b/odb-tests/common/erase-query/testscript index bdb7fac..3dcfc39 100644 --- a/odb-tests/common/erase-query/testscript +++ b/odb-tests/common/erase-query/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/id/auto/testscript b/odb-tests/common/id/auto/testscript index 641f03d..1cf4a18 100644 --- a/odb-tests/common/id/auto/testscript +++ b/odb-tests/common/id/auto/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/id/composite/testscript b/odb-tests/common/id/composite/testscript index b74abdb..99a272b 100644 --- a/odb-tests/common/id/composite/testscript +++ b/odb-tests/common/id/composite/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/id/nested/testscript b/odb-tests/common/id/nested/testscript index cc8f251..65acfda 100644 --- a/odb-tests/common/id/nested/testscript +++ b/odb-tests/common/id/nested/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/index/testscript b/odb-tests/common/index/testscript index 1355726..0103476 100644 --- a/odb-tests/common/index/testscript +++ b/odb-tests/common/index/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/inheritance/polymorphism/testscript b/odb-tests/common/inheritance/polymorphism/testscript index adde79b..0285f9f 100644 --- a/odb-tests/common/inheritance/polymorphism/testscript +++ b/odb-tests/common/inheritance/polymorphism/testscript @@ -52,7 +52,6 @@ if $mysql for s: $schemas cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd - end; $* ($multi ? 'mysql' : ) $mysql_options } @@ -74,7 +73,6 @@ if $pgsql for s: $schemas $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql - end; $* ($multi ? 'pgsql' : ) $pgsql_options } @@ -87,7 +85,6 @@ if $oracle for s: $schemas $create_schema_cmd "@$out_base/$s"($multi ? '-oracle' : '').sql - end; $* ($multi ? 'oracle' : ) $oracle_options } @@ -100,7 +97,6 @@ if $mssql for s: $schemas $create_schema_cmd -i $out_base/"$s"($multi ? '-mssql' : '').sql - end; $* ($multi ? 'mssql' : ) $mssql_options } diff --git a/odb-tests/common/inheritance/reuse/testscript b/odb-tests/common/inheritance/reuse/testscript index 1bc20ea..575cc84 100644 --- a/odb-tests/common/inheritance/reuse/testscript +++ b/odb-tests/common/inheritance/reuse/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/inheritance/transient/testscript b/odb-tests/common/inheritance/transient/testscript index d15db56..4d205b4 100644 --- a/odb-tests/common/inheritance/transient/testscript +++ b/odb-tests/common/inheritance/transient/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/inverse/testscript b/odb-tests/common/inverse/testscript index f7e9960..48ea83b 100644 --- a/odb-tests/common/inverse/testscript +++ b/odb-tests/common/inverse/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/lazy-ptr/testscript b/odb-tests/common/lazy-ptr/testscript index 023aca6..6c3b6b3 100644 --- a/odb-tests/common/lazy-ptr/testscript +++ b/odb-tests/common/lazy-ptr/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/lifecycle/testscript b/odb-tests/common/lifecycle/testscript index f39297b..7622bd9 100644 --- a/odb-tests/common/lifecycle/testscript +++ b/odb-tests/common/lifecycle/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/no-id/testscript b/odb-tests/common/no-id/testscript index 96b8926..4d6d3b1 100644 --- a/odb-tests/common/no-id/testscript +++ b/odb-tests/common/no-id/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/object/testscript b/odb-tests/common/object/testscript index 45737c1..7d1c967 100644 --- a/odb-tests/common/object/testscript +++ b/odb-tests/common/object/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/optimistic/testscript b/odb-tests/common/optimistic/testscript index b9117c0..dd11713 100644 --- a/odb-tests/common/optimistic/testscript +++ b/odb-tests/common/optimistic/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/prepared/testscript b/odb-tests/common/prepared/testscript index d378a79..975bd54 100644 --- a/odb-tests/common/prepared/testscript +++ b/odb-tests/common/prepared/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/query/array/testscript b/odb-tests/common/query/array/testscript index 37f7158..9d41efb 100644 --- a/odb-tests/common/query/array/testscript +++ b/odb-tests/common/query/array/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/query/basics/testscript b/odb-tests/common/query/basics/testscript index d7dcf21..f8a00cc 100644 --- a/odb-tests/common/query/basics/testscript +++ b/odb-tests/common/query/basics/testscript @@ -126,7 +126,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -145,7 +145,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -155,7 +155,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -165,6 +165,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/query/one/testscript b/odb-tests/common/query/one/testscript index 94ebcde..d33fa38 100644 --- a/odb-tests/common/query/one/testscript +++ b/odb-tests/common/query/one/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/readonly/testscript b/odb-tests/common/readonly/testscript index 491b55b..0708664 100644 --- a/odb-tests/common/readonly/testscript +++ b/odb-tests/common/readonly/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/relationship/basics/testscript b/odb-tests/common/relationship/basics/testscript index 7ed44b4..cf41737 100644 --- a/odb-tests/common/relationship/basics/testscript +++ b/odb-tests/common/relationship/basics/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/relationship/on-delete/testscript b/odb-tests/common/relationship/on-delete/testscript index 5777084..57ce729 100644 --- a/odb-tests/common/relationship/on-delete/testscript +++ b/odb-tests/common/relationship/on-delete/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/relationship/query/testscript b/odb-tests/common/relationship/query/testscript index 41e959b..4b88bb5 100644 --- a/odb-tests/common/relationship/query/testscript +++ b/odb-tests/common/relationship/query/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/schema/namespace/testscript b/odb-tests/common/schema/namespace/testscript index a2edd8d..dd5e59b 100644 --- a/odb-tests/common/schema/namespace/testscript +++ b/odb-tests/common/schema/namespace/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/section/basics/testscript b/odb-tests/common/section/basics/testscript index bf7d1db..edaf812 100644 --- a/odb-tests/common/section/basics/testscript +++ b/odb-tests/common/section/basics/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/section/polymorphism/testscript b/odb-tests/common/section/polymorphism/testscript index 9fd2310..fb1c6e6 100644 --- a/odb-tests/common/section/polymorphism/testscript +++ b/odb-tests/common/section/polymorphism/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/session/cache/testscript b/odb-tests/common/session/cache/testscript index da4e134..112eea0 100644 --- a/odb-tests/common/session/cache/testscript +++ b/odb-tests/common/session/cache/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/session/custom/testscript b/odb-tests/common/session/custom/testscript index c3f3e06..8b98efd 100644 --- a/odb-tests/common/session/custom/testscript +++ b/odb-tests/common/session/custom/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/threads/testscript b/odb-tests/common/threads/testscript index 0d619ab..d5187ee 100644 --- a/odb-tests/common/threads/testscript +++ b/odb-tests/common/threads/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -45,7 +45,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -55,7 +55,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -65,6 +65,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/view/basics/testscript b/odb-tests/common/view/basics/testscript index 7c69c0c..4162af5 100644 --- a/odb-tests/common/view/basics/testscript +++ b/odb-tests/common/view/basics/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/view/olv/test4.hxx b/odb-tests/common/view/olv/test4.hxx index 4d8b804..e168501 100644 --- a/odb-tests/common/view/olv/test4.hxx +++ b/odb-tests/common/view/olv/test4.hxx @@ -117,7 +117,7 @@ namespace test4 view2a () {} view2a (const view2a& v) - : o1 (v.o1), o2 (v.o2) + : o1 (v.o1), o2 (v.o2), o2_null (v.o2_null) { if (v.o2.o1 != 0) { diff --git a/odb-tests/common/view/olv/testscript b/odb-tests/common/view/olv/testscript index 5189f19..9043c24 100644 --- a/odb-tests/common/view/olv/testscript +++ b/odb-tests/common/view/olv/testscript @@ -11,7 +11,6 @@ if $mysql for s: $schemas cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd - end; $* ($multi ? 'mysql' : ) $mysql_options } @@ -33,7 +32,6 @@ if $pgsql for s: $schemas $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql - end; $* ($multi ? 'pgsql' : ) $pgsql_options } @@ -46,7 +44,6 @@ if $oracle for s: $schemas $create_schema_cmd "@$out_base/$s"($multi ? '-oracle' : '').sql - end; $* ($multi ? 'oracle' : ) $oracle_options } @@ -59,7 +56,6 @@ if $mssql for s: $schemas $create_schema_cmd -i $out_base/"$s"($multi ? '-mssql' : '').sql - end; $* ($multi ? 'mssql' : ) $mssql_options } diff --git a/odb-tests/common/virtual/testscript b/odb-tests/common/virtual/testscript index afdb4fb..f1db824 100644 --- a/odb-tests/common/virtual/testscript +++ b/odb-tests/common/virtual/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/common/wrapper/testscript b/odb-tests/common/wrapper/testscript index 31c3a97..d9ca9ff 100644 --- a/odb-tests/common/wrapper/testscript +++ b/odb-tests/common/wrapper/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/database-options.testscript b/odb-tests/database-options.testscript index 68d2c34..f066180 100644 --- a/odb-tests/database-options.testscript +++ b/odb-tests/database-options.testscript @@ -7,145 +7,164 @@ # be used as a base for the data manipulation commands. # +if $mysql - mysql_options = --user $config.odb_tests.mysql.user \ - --database $config.odb_tests.mysql.database - - mysql_client_options = --user $config.odb_tests.mysql.user \ - --database $config.odb_tests.mysql.database - - if $defined(config.odb_tests.mysql.passwd) - mysql_options += --password $config.odb_tests.mysql.passwd - mysql_client_options += --password=$config.odb_tests.mysql.passwd - end - - if $defined(config.odb_tests.mysql.host) - mysql_options += --host $config.odb_tests.mysql.host - mysql_client_options += --host $config.odb_tests.mysql.host - end - - if $defined(config.odb_tests.mysql.port) - mysql_options += --port $config.odb_tests.mysql.port - mysql_client_options += --port $config.odb_tests.mysql.port - end - - if $defined(config.odb_tests.mysql.socket) - mysql_options += --socket $config.odb_tests.mysql.socket - mysql_client_options += --socket $config.odb_tests.mysql.socket - end - - mysql_client_cmd = $path($mysql_client) $mysql_client_options -end +{ + mysql_options = --user $config.odb_tests.mysql.user \ + --database $config.odb_tests.mysql.database + + mysql_client_options = --user $config.odb_tests.mysql.user \ + --database $config.odb_tests.mysql.database + + if $defined(config.odb_tests.mysql.passwd) + { + mysql_options += --password $config.odb_tests.mysql.passwd + mysql_client_options += --password=$config.odb_tests.mysql.passwd + } + + if $defined(config.odb_tests.mysql.host) + { + mysql_options += --host $config.odb_tests.mysql.host + mysql_client_options += --host $config.odb_tests.mysql.host + } + + if $defined(config.odb_tests.mysql.port) + { + mysql_options += --port $config.odb_tests.mysql.port + mysql_client_options += --port $config.odb_tests.mysql.port + } + + if $defined(config.odb_tests.mysql.socket) + { + mysql_options += --socket $config.odb_tests.mysql.socket + mysql_client_options += --socket $config.odb_tests.mysql.socket + } + + mysql_client_cmd = $path($mysql_client) $mysql_client_options +} +if $sqlite +{ sqlite_options = --database odb-test.db # Note that we currently don't manipulate the data using the sqlite3 # utility. Thus, we don't create the sqlite client option list and command # line. # -end +} +if $pgsql - pgsql_options = --user $config.odb_tests.pgsql.user \ - --database $config.odb_tests.pgsql.database +{ + pgsql_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database - pgsql_client_options = --quiet \ - --set ON_ERROR_STOP=1 \ - --username $config.odb_tests.pgsql.user \ - --dbname $config.odb_tests.pgsql.database + pgsql_client_options = --quiet \ + --set ON_ERROR_STOP=1 \ + --username $config.odb_tests.pgsql.user \ + --dbname $config.odb_tests.pgsql.database if $defined(config.odb_tests.pgsql.host) + { pgsql_options += --host $config.odb_tests.pgsql.host pgsql_client_options += --host $config.odb_tests.pgsql.host - end + } if $defined(config.odb_tests.pgsql.port) + { pgsql_options += --port $config.odb_tests.pgsql.port pgsql_client_options += --port $config.odb_tests.pgsql.port - end + } pgsql_client_cmd = $path($pgsql_client) $pgsql_client_options export PGOPTIONS=--client-min-messages=warning -end +} +if $oracle - oracle_options = --user $config.odb_tests.oracle.user - - oracle_client_options = -L -S - oracle_logon = $config.odb_tests.oracle.user - - if $defined(config.odb_tests.oracle.passwd) - oracle_options += --password $config.odb_tests.oracle.passwd - oracle_logon = "$oracle_logon/$config.odb_tests.oracle.passwd" - end - - if ($defined(config.odb_tests.oracle.host) || \ - $defined(config.odb_tests.oracle.port)) - if $defined(config.odb_tests.oracle.host) - oracle_options += --host $config.odb_tests.oracle.host - oracle_logon = "$oracle_logon@//$config.odb_tests.oracle.host" - else - oracle_logon = "$oracle_logon@//localhost" - end - - if $defined(config.odb_tests.oracle.port) - oracle_options += --port $config.odb_tests.oracle.port - oracle_logon = "$oracle_logon:$config.odb_tests.oracle.port" - end - - if $defined(config.odb_tests.oracle.service) - oracle_options += --service $config.odb_tests.oracle.service - oracle_logon = "$oracle_logon/$config.odb_tests.oracle.service" - end - elif $defined(config.odb_tests.oracle.service) - oracle_options += --service $config.odb_tests.oracle.service - oracle_logon = "$oracle_logon@$config.odb_tests.oracle.service" - end - - oracle_client_cmd = $path($oracle_client) $oracle_client_options $oracle_logon -end +{ + oracle_options = --user $config.odb_tests.oracle.user + + oracle_client_options = -L -S + oracle_logon = $config.odb_tests.oracle.user + + if $defined(config.odb_tests.oracle.passwd) + { + oracle_options += --password $config.odb_tests.oracle.passwd + oracle_logon = "$oracle_logon/$config.odb_tests.oracle.passwd" + } + + if ($defined(config.odb_tests.oracle.host) || \ + $defined(config.odb_tests.oracle.port)) + { + if $defined(config.odb_tests.oracle.host) + { + oracle_options += --host $config.odb_tests.oracle.host + oracle_logon = "$oracle_logon@//$config.odb_tests.oracle.host" + } + else + oracle_logon = "$oracle_logon@//localhost" + + if $defined(config.odb_tests.oracle.port) + { + oracle_options += --port $config.odb_tests.oracle.port + oracle_logon = "$oracle_logon:$config.odb_tests.oracle.port" + } + + if $defined(config.odb_tests.oracle.service) + { + oracle_options += --service $config.odb_tests.oracle.service + oracle_logon = "$oracle_logon/$config.odb_tests.oracle.service" + } + } + elif $defined(config.odb_tests.oracle.service) + { + oracle_options += --service $config.odb_tests.oracle.service + oracle_logon = "$oracle_logon@$config.odb_tests.oracle.service" + } + + oracle_client_cmd = $path($oracle_client) $oracle_client_options $oracle_logon +} +if $mssql - mssql_options = --user $config.odb_tests.mssql.user \ - --database $config.odb_tests.mssql.database - - mssql_client_options = -C -x -r 1 -b \ - -U $config.odb_tests.mssql.user \ - -d $config.odb_tests.mssql.database - - if $defined(config.odb_tests.mssql.passwd) - mssql_options += --password $config.odb_tests.mssql.passwd - mssql_client_options += -P $config.odb_tests.mssql.passwd - end - - if ($defined(config.odb_tests.mssql.host) || \ - $defined(config.odb_tests.mssql.port)) - mssql_server = \ - "tcp:($defined(config.odb_tests.mssql.host) ? $config.odb_tests.mssql.host : localhost)" - - if $defined(config.odb_tests.mssql.port) - mssql_server = "$mssql_server,$config.odb_tests.mssql.port" - end - elif $defined(config.odb_tests.mssql.server) - mssql_server = $config.odb_tests.mssql.server - else - mssql_server = [null] - end - - if ($mssql_server != [null]) - mssql_options += --server $mssql_server - mssql_client_options += -S $mssql_server - end - - if ($defined(config.odb_tests.mssql.driver) && \ - $config.odb_tests.mssql.driver != [null] && \ - $config.odb_tests.mssql.driver != '') - mssql_options += --driver $config.odb_tests.mssql.driver - end - - mssql_client_cmd = $path($mssql_client) $mssql_client_options -end +{ + mssql_options = --user $config.odb_tests.mssql.user \ + --database $config.odb_tests.mssql.database + + mssql_client_options = -C -x -r 1 -b \ + -U $config.odb_tests.mssql.user \ + -d $config.odb_tests.mssql.database + + if $defined(config.odb_tests.mssql.passwd) + { + mssql_options += --password $config.odb_tests.mssql.passwd + mssql_client_options += -P $config.odb_tests.mssql.passwd + } + + if ($defined(config.odb_tests.mssql.host) || \ + $defined(config.odb_tests.mssql.port)) + { + mssql_server = \ + "tcp:($defined(config.odb_tests.mssql.host) ? $config.odb_tests.mssql.host : localhost)" + + if $defined(config.odb_tests.mssql.port) + mssql_server = "$mssql_server,$config.odb_tests.mssql.port" + } + elif $defined(config.odb_tests.mssql.server) + mssql_server = $config.odb_tests.mssql.server + else + mssql_server = [null] + + if ($mssql_server != [null]) + { + mssql_options += --server $mssql_server + mssql_client_options += -S $mssql_server + } + + if ($defined(config.odb_tests.mssql.driver) && \ + $config.odb_tests.mssql.driver != [null] && \ + $config.odb_tests.mssql.driver != '') + mssql_options += --driver $config.odb_tests.mssql.driver + + mssql_client_cmd = $path($mssql_client) $mssql_client_options +} # Set the default schema file name, which can be overridden by the subsequent # tests in their own scopes. diff --git a/odb-tests/evolution/add-column/testscript b/odb-tests/evolution/add-column/testscript index 4741109..a3f4a24 100644 --- a/odb-tests/evolution/add-column/testscript +++ b/odb-tests/evolution/add-column/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/add-foreign-key/testscript b/odb-tests/evolution/add-foreign-key/testscript index 9ea393f..21eef5f 100644 --- a/odb-tests/evolution/add-foreign-key/testscript +++ b/odb-tests/evolution/add-foreign-key/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/add-index/testscript b/odb-tests/evolution/add-index/testscript index e71352a..cbbd7cf 100644 --- a/odb-tests/evolution/add-index/testscript +++ b/odb-tests/evolution/add-index/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/add-table/testscript b/odb-tests/evolution/add-table/testscript index fad1225..63cc517 100644 --- a/odb-tests/evolution/add-table/testscript +++ b/odb-tests/evolution/add-table/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/alter-column/testscript b/odb-tests/evolution/alter-column/testscript index ff8f9a6..fa41941 100644 --- a/odb-tests/evolution/alter-column/testscript +++ b/odb-tests/evolution/alter-column/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,8 +46,7 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { diff --git a/odb-tests/evolution/combined/testscript b/odb-tests/evolution/combined/testscript index 118e43b..f8083c0 100644 --- a/odb-tests/evolution/combined/testscript +++ b/odb-tests/evolution/combined/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/data/testscript b/odb-tests/evolution/data/testscript index dddc909..1627858 100644 --- a/odb-tests/evolution/data/testscript +++ b/odb-tests/evolution/data/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/drop-column/testscript b/odb-tests/evolution/drop-column/testscript index bfda778..7e9b7fb 100644 --- a/odb-tests/evolution/drop-column/testscript +++ b/odb-tests/evolution/drop-column/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/drop-foreign-key/testscript b/odb-tests/evolution/drop-foreign-key/testscript index f48e801..a5ff8d2 100644 --- a/odb-tests/evolution/drop-foreign-key/testscript +++ b/odb-tests/evolution/drop-foreign-key/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,8 +46,7 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { diff --git a/odb-tests/evolution/drop-index/testscript b/odb-tests/evolution/drop-index/testscript index 0fb21ba..fd32c6d 100644 --- a/odb-tests/evolution/drop-index/testscript +++ b/odb-tests/evolution/drop-index/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/drop-table/testscript b/odb-tests/evolution/drop-table/testscript index 6263168..e914ce8 100644 --- a/odb-tests/evolution/drop-table/testscript +++ b/odb-tests/evolution/drop-table/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/embedded/testscript b/odb-tests/evolution/embedded/testscript index 3ddf983..08448eb 100644 --- a/odb-tests/evolution/embedded/testscript +++ b/odb-tests/evolution/embedded/testscript @@ -9,13 +9,13 @@ test.arguments += $($(db)_options) : if! $sqlite { - $* 1; - $* 2; + $* 1 + $* 2 $* 3 } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/soft-add/testscript b/odb-tests/evolution/soft-add/testscript index 5c26645..438988e 100644 --- a/odb-tests/evolution/soft-add/testscript +++ b/odb-tests/evolution/soft-add/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/soft-delete/testscript b/odb-tests/evolution/soft-delete/testscript index 63e81e6..07817dc 100644 --- a/odb-tests/evolution/soft-delete/testscript +++ b/odb-tests/evolution/soft-delete/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/evolution/version/testscript b/odb-tests/evolution/version/testscript index 08290ae..aed52e2 100644 --- a/odb-tests/evolution/version/testscript +++ b/odb-tests/evolution/version/testscript @@ -10,25 +10,25 @@ test.arguments += $($(db)_options) : if! $sqlite { - ss =; # Schema modification base file names. + ss = # Schema modification base file names. # Drop everything. # for s: $schemas ss =+ $s - end; # Add base schema. # - ss += test3-002-pre test3-002-post; + ss += test3-002-pre test3-002-post # Add migration. # - ss += test3-003-pre test3-003-post; + ss += test3-003-pre test3-003-post # Run tests. # for s: $ss + { f = $out_base/"$s".sql if $mysql @@ -39,7 +39,6 @@ if! $sqlite $create_schema_cmd "@$f" elif $mssql $create_schema_cmd -i $f - end if ($s == 'test3-002-post') $* 1 @@ -47,12 +46,11 @@ if! $sqlite $* 2 elif ($s == 'test3-003-post') $* 3 - end - end + } } else { - $* 1 &odb-test.db; - $* 2; + $* 1 &odb-test.db + $* 2 $* 3 } diff --git a/odb-tests/manifest b/odb-tests/manifest index 8924fb7..acb6fe7 100644 --- a/odb-tests/manifest +++ b/odb-tests/manifest @@ -1,6 +1,6 @@ : 1 name: odb-tests -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z project: odb type: tests language: c++ @@ -11,11 +11,8 @@ url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com ; Mailing list - -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. -# -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- depends: * odb == $ @@ -39,8 +36,8 @@ depends: libQt5Core ? ($qt && $qt_ver == 5) depends: libQt6Core ? ($qt && $qt_ver == 6) # Reflect whether libodb-pgsql is likely to support bulk operations. This is -# normally the case on POSIX platforms if libodb-pgsql is linked against libpq -# of the version 14 or above. +# normally the case if libodb-pgsql is linked against libpq of the version 14 +# or above. # # Note, though, that this approach doesn't work well for libodb-pgsql # configured as a system package, since the version of libpq it is linked to @@ -79,51 +76,39 @@ builds: -static ; Implementation uses plugins and requires -fPIC. # And they allow CI'ing odb-tests by itself (thus we specify the bot keys both # in libodb* and here). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: default ; Requires default config with GCC as host compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. -custom-multi-builds: latest ; Requires latest config with GCC as host compiler. +custom-multi-builds: default ; Requires default config with GCC as host compiler. custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. -custom-multi-oracle-builds: latest ; Requires proprietary software. +custom-multi-oracle-builds: default ; Requires proprietary software. custom-multi-oracle-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-oracle-build-bot: -- see below. -custom-multi-mssql-builds: latest ; Requires proprietary software. +custom-multi-mssql-builds: default ; Requires proprietary software. custom-multi-mssql-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-mssql-build-bot: -- see below. -# @@ TMP -# -#boost-custom-builds: latest ; Requires proprietary software. -#boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. -##boost-custom-build-bot: -- see below. -boost-custom-builds: latest ; Requires latest config with GCC as host compiler. +boost-custom-builds: default ; Requires default config with GCC as host compiler. boost-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. boost-custom-builds: -static ; Implementation uses plugins and requires -fPIC. boost-custom-builds: -( +macos &gcc ) ; Not supported by libboost-*. +#boost-custom-build-bot: -- see below. -# @@ TMP -# -#qt5-custom-builds: latest ; Requires proprietary software. -#qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. -##qt5-custom-build-bot: -- see below. -qt5-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt5-custom-builds: default ; Requires default config with GCC as host compiler. qt5-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. qt5-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt5-custom-builds: -( +macos &gcc ) ; Not supported by libQt5Core. +#qt5-custom-build-bot: -- see below. -# @@ TMP -# -#qt6-custom-builds: latest ; Requires proprietary software. -#qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. -##qt6-custom-build-bot: -- see below. -qt6-custom-builds: latest ; Requires latest config with GCC as host compiler. +qt6-custom-builds: default ; Requires default config with GCC as host compiler. qt6-custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. qt6-custom-builds: -static ; Implementation uses plugins and requires -fPIC. qt6-custom-builds: -( +macos &gcc ) ; Not supported by libQt6Core. +#qt6-custom-build-bot: -- see below. custom-build-bot: \ @@ -143,24 +128,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -179,24 +146,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-oracle-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -215,24 +164,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-oracle-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - custom-multi-mssql-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -251,24 +182,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -custom-multi-mssql-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - boost-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -287,24 +200,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -boost-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt5-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -323,24 +218,6 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv -----END PUBLIC KEY----- \ -qt5-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ - qt6-custom-build-bot: \ -----BEGIN PUBLIC KEY----- @@ -358,21 +235,3 @@ f5m1W/CcDr53PKWg/ayY9nWMUQaIwH4b69kLM+VTpYSbzu5UQJkmNBNq2EOHgoTv 9MLA+cE/nNJ/rMI//MZ1+kcCAwEAAQ== -----END PUBLIC KEY----- \ - -qt6-custom-build-bot: -\ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuLYZ68rotGDAtWViFHOe -XEsmZB8BGI+af1ixh9JOy9BE4ohGTfPr1YsjGDzh+PhOVLAtyykOoT/qG7cuGB0T -gBInoRrgVB2/ZKTMwxeDGb/TA3uykaXxcw7/liTsizHAY+phCNTbke8iER5Y78js -9GlnTPmNhwFqEj2fwCz+2o08eyZvZ9Vj1fH/bFDCmDmU33JR3crtJlC8wPiF70Ho -FJzHFdaFQl3MxvEV92HjOsyqozMi6tAVVefN1vapVQeNtjkB0Di18p0/EMugEuGU -OxktjDHQWNaV8Ao6cCDk6OkJnM3ZNL1no3cV4cuF+/xI8UZzwfPoBnwg/s183Qzu -pHHKOSHmuO0oVE/XohJhepSw3tb+wf5BwejRhYHikIjqCxJdm9H0QTiqXT82y24K -yg3gkRMOgqnVxERKKP4ZknLSMQCEKiND/t2zdLJ/lxH9eHZdPHKk3OZZG292j+Bh -fknxcTKNk1Dmf32Irs5hVrjsoU8eAutbItovzXdBaj//rn/ry/kUlCa1Ov6iLIDJ -gyxmsDlgKNR/uE9ogmDn0ishJIoCmxeqenRfJkttr9pEsDsUFuB425QGqiSxa1jh -PCNca3iRtO44wADXaQMTGpvLzBfdfVc8LoFpn+kynN0V1MvxAX4mHRXxw8ERXd3U -dpHDhOthPLolJQrYKb/YyW8CAwEAAQ== ------END PUBLIC KEY----- -\ diff --git a/odb-tests/pgsql/bulk/buildfile b/odb-tests/pgsql/bulk/buildfile index 1885fdd..af0bc7f 100644 --- a/odb-tests/pgsql/bulk/buildfile +++ b/odb-tests/pgsql/bulk/buildfile @@ -34,6 +34,9 @@ odb_options = --table-prefix pgsql_bulk_ \ cxx.poptions =+ "-I$out_base" "-I$src_base" +if ($cxx.target.class == 'windows') + cxx.libs += ($cxx.target.system == 'mingw32' ? -lws2_32 : ws2_32.lib) + # Testscript's run-time prerequisites. # exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/bulk/driver.cxx b/odb-tests/pgsql/bulk/driver.cxx index 6b30073..61e7d56 100644 --- a/odb-tests/pgsql/bulk/driver.cxx +++ b/odb-tests/pgsql/bulk/driver.cxx @@ -10,12 +10,17 @@ #include <stdio.h> #include <string.h> #include <stddef.h> -#include <sys/select.h> + +#ifndef _WIN32 +# include <sys/select.h> +# include <arpa/inet.h> +#else +# include <winsock2.h> +#endif // Note: hack (also, some platforms, like Mac OS, provide it). // -#include <arpa/inet.h> -#ifndef htonll +#if !defined(_MSC_VER) && !defined(htonll) # define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) #endif @@ -51,7 +56,7 @@ init (const struct data* d) lengths[1] = sizeof (d->idata); values[2] = (char*)d->sdata; - lengths[2] = strlen (d->sdata); + lengths[2] = (int)strlen (d->sdata); } static void @@ -85,6 +90,7 @@ execute (PGconn* conn, const struct data* ds, size_t n) FD_ZERO (&rds); FD_SET (sock, &rds); +#ifndef _WIN32 if (select (sock + 1, &rds, wdone ? NULL : &wds, NULL, NULL) == -1) { if (errno == EINTR) @@ -92,6 +98,10 @@ execute (PGconn* conn, const struct data* ds, size_t n) assert (false); } +#else + if (select (sock + 1, &rds, wdone ? NULL : &wds, NULL, NULL) == SOCKET_ERROR) + assert (false); +#endif // Try to minimize the chance of blocking the server by first processing // the result and then sending more queries. diff --git a/odb-tests/pgsql/bulk/testscript b/odb-tests/pgsql/bulk/testscript index 60b7d92..fce28fb 100644 --- a/odb-tests/pgsql/bulk/testscript +++ b/odb-tests/pgsql/bulk/testscript @@ -9,7 +9,7 @@ : basics : { - $*; + $* $* --fail-already-persistent 2>>EOE != 0 multiple exceptions, 252 elements attempted, 1 failed, fatal: diff --git a/odb-tests/pgsql/custom/test.hxx b/odb-tests/pgsql/custom/test.hxx index ec3d496..754acd2 100644 --- a/odb-tests/pgsql/custom/test.hxx +++ b/odb-tests/pgsql/custom/test.hxx @@ -20,8 +20,8 @@ struct point point () {} point (double x_, double y_): x (x_), y (y_) {} - double x; - double y; + double x = 0; + double y = 0; }; inline bool diff --git a/odb-tests/pgsql/stored-proc/buildfile b/odb-tests/pgsql/stored-proc/buildfile new file mode 100644 index 0000000..13def51 --- /dev/null +++ b/odb-tests/pgsql/stored-proc/buildfile @@ -0,0 +1,37 @@ +# file : pgsql/stored-proc/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +if ($build.meta_operation != 'dist') +{ + assert ($pgsql) "pgsql should be configured for this test" + assert (!$multi) "multi-database mode is not supported by this test" +} + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_stored_proc_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/stored-proc/driver.cxx b/odb-tests/pgsql/stored-proc/driver.cxx new file mode 100644 index 0000000..f1851f0 --- /dev/null +++ b/odb-tests/pgsql/stored-proc/driver.cxx @@ -0,0 +1,607 @@ +// file : pgsql/stored-proc/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test PostgreSQL stored procedure and function support. +// + +#include <memory> // std::unique_ptr +#include <iostream> + +#include <odb/pgsql/database.hxx> +#include <odb/pgsql/transaction.hxx> + +#include <libcommon/common.hxx> + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include <cassert> + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +static void +create_function (database& db, const string& signature, const string& body) +{ + transaction t (db.begin ()); + db.execute ("DROP ROUTINE IF EXISTS " + signature); + db.execute ("CREATE FUNCTION " + signature + ' ' + body); + t.commit (); +} + +static void +create_procedure (database& db, const string& signature, const string& body) +{ + transaction t (db.begin ()); + db.execute ("DROP ROUTINE IF EXISTS " + signature); + db.execute ("CREATE PROCEDURE " + signature + ' ' + body); + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr<database> db (create_specific_database<database> (argc, argv)); + + person john (1, "John", "Doe", 33); + person jane (2, "Jane", "Doe", 32); + person joe (3, "Joe", "Dirt", 30); + + { + transaction t (db->begin ()); + db->persist (john); + db->persist (jane); + db->persist (joe); + t.commit (); + } + + // Stored functions. + // + // Notes (as per the PostgreSQL documentation): + // + // - When there are OUT or INOUT parameters, the RETURNS clause can be + // omitted. If present, it must agree with the result type implied by + // the output parameters: RECORD if there are multiple output + // parameters, or the same type as the single output parameter. + // + // - Also, OUT and INOUT arguments cannot be used together with the + // RETURNS TABLE notation. + // + + // Return rowset. + // + { + // Note that if use `IN min_age SMALLINT, IN max_age SMALLINT` here, + // then we end up with the following runtime error, unless passing the + // `unsigned short` type values to the query::_val() calls: + // + // 42883: ERROR: function person_range(integer, integer) does not exist + // LINE 1: SELECT * FROM person_range ($1, $2) + // ^ + // HINT: No function matches the given name and argument types. You + // might need to add explicit type casts. + // + // Note that the PostgreSQL's INTEGER type for the function parameters + // works well for `unsigned short` C++ type values. + // + create_function (*db, + "person_range (IN min_age INTEGER,\n" + "IN max_age INTEGER,\n" + "OUT age SMALLINT,\n" + "OUT first TEXT,\n" + "OUT last TEXT)", + "RETURNS SETOF RECORD AS $$\n" + " SELECT age, first, last\n" + " FROM pgsql_stored_proc_person\n" + " WHERE age >= min_age AND age <= max_age\n" + " ORDER BY id;\n" + "$$ LANGUAGE SQL STABLE;"); + + typedef odb::query<person_range> query; + typedef odb::result<person_range> result; + + transaction t (db->begin ()); + + // Return multiple rows. + // + { + result r ( + db->query<person_range> ( + query::_val (1) + "," + query::_val (32))); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first << " " << i->last << " " << i->age << endl; + + cout << endl; + } + + // Return empty rowset. + // + { + result r ( + db->query<person_range> ( + query::_val (1) + "," + query::_val (10))); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first << " " << i->last << " " << i->age << endl; + + cout << endl; + } + + t.commit (); + } + + // As above (return rowset) but using the alternative `RETURNS TABLE` + // notation. + // + { + create_function (*db, + "person_range (IN min_age INTEGER,\n" + "IN max_age INTEGER)", + "RETURNS TABLE(age SMALLINT,\n" + "first TEXT,\n" + "last TEXT) AS $$\n" + " SELECT age, first, last\n" + " FROM pgsql_stored_proc_person\n" + " WHERE age >= min_age AND age <= max_age\n" + " ORDER BY id;\n" + "$$ LANGUAGE SQL STABLE;"); + + typedef odb::query<person_range> query; + typedef odb::result<person_range> result; + + transaction t (db->begin ()); + + result r ( + db->query<person_range> ( + query::_val (1) + "," + query::_val (32))); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first << " " << i->last << " " << i->age << endl; + + cout << endl; + + t.commit (); + } + + // Similar to the above but using INOUT parameter. + // + { + create_function (*db, + "person_range (INOUT person_age INTEGER,\n" + "OUT first TEXT,\n" + "OUT last TEXT)", + "RETURNS SETOF RECORD AS $$\n" + " SELECT age, first, last\n" + " FROM pgsql_stored_proc_person\n" + " WHERE age = person_age\n" + " ORDER BY id;\n" + "$$ LANGUAGE SQL STABLE;"); + + typedef odb::query<person_range> query; + typedef odb::result<person_range> result; + + transaction t (db->begin ()); + + // Return multiple rows. + // + { + result r (db->query<person_range> (query::_val (32))); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first << " " << i->last << " " << i->age << endl; + + cout << endl; + } + + t.commit (); + } + + // Return single row (no SETOF). + // + // Note: always returns one row, regardless of what is returned by SELECT + // (see below for details). + // + { + create_function (*db, + "person_range (IN min_age INTEGER,\n" + "IN max_age INTEGER,\n" + "OUT age SMALLINT,\n" + "OUT first TEXT,\n" + "OUT last TEXT)", + "AS $$\n" + " SELECT age, first, last\n" + " FROM pgsql_stored_proc_person\n" + " WHERE age >= min_age AND age <= max_age\n" + " ORDER BY id;\n" + "$$ LANGUAGE SQL STABLE;"); + + typedef odb::query<person_range> query; + + transaction t (db->begin ()); + + // Return the first row of the multiple ones generated by the SELECT + // statement in the function implementation. + // + { + person_range r ( + db->query_value<person_range> ( + query::_val (1) + "," + query::_val (32))); + + cout << r.first << " " << r.last << " " << r.age << endl + << endl; + } + + // Return the single row with the NULL column values if the SELECT + // statement in the function implementation ends up with an empty + // rowset. + // + { + person_range r ( + db->query_value<person_range> ( + query::_val (1) + "," + query::_val (10))); + + cout << r.first << " " << r.last << " " << r.age << endl + << endl; + } + + t.commit (); + } + + // Similar to the above but use INOUT parameter. + // + { + create_function (*db, + "person_range (INOUT person_age INTEGER,\n" + "OUT first TEXT,\n" + "OUT last TEXT)", + "AS $$\n" + " SELECT age, first, last\n" + " FROM pgsql_stored_proc_person\n" + " WHERE age = person_age\n" + " ORDER BY id;\n" + "$$ LANGUAGE SQL STABLE;"); + + typedef odb::query<person_range> query; + + transaction t (db->begin ()); + + // Return the first row of the multiple ones. + // + { + person_range r (db->query_value<person_range> (query::_val (32))); + + cout << r.first << " " << r.last << " " << r.age << endl + << endl; + } + + t.commit (); + } + + // No arguments. + // + { + create_function (*db, + "person_count ()", + "RETURNS BIGINT AS $$\n" + " SELECT count(id)\n" + " FROM pgsql_stored_proc_person;\n" + "$$ LANGUAGE SQL STABLE;"); + + transaction t (db->begin ()); + + person_count r (db->query_value<person_count> ()); + + cout << r.count << endl + << endl; + + t.commit (); + } + + // Modify the table and return void. + // + // Note that in reality the function returns a single row with a single + // column of type void containing the NULL value. + // + { + create_function (*db, + "person_age_increment (IN min_age INTEGER,\n" + "IN max_age INTEGER)", + "RETURNS VOID AS $$\n" + " UPDATE pgsql_stored_proc_person\n" + " SET age = age + 1\n" + " WHERE age >= min_age AND age <= max_age;\n" + "$$ LANGUAGE SQL;"); + + typedef odb::query<person_age_increment> query; + typedef odb::result<person> result; + + transaction t (db->begin ()); + + { + unique_ptr<person_age_increment> fr ( + db->query_one<person_age_increment> ( + query::_val (1) + "," + query::_val (32))); + + assert (fr != nullptr); + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + } + + t.commit (); + } + + // As above but also use the SETOF specifier in the function definition. + // In this case the function returns an empty rowset. + // + { + create_function (*db, + "person_age_increment (IN min_age INTEGER,\n" + "IN max_age INTEGER)", + "RETURNS SETOF VOID AS $$\n" + " UPDATE pgsql_stored_proc_person\n" + " SET age = age + 1\n" + " WHERE age >= min_age AND age <= max_age;\n" + "$$ LANGUAGE SQL;"); + + typedef odb::query<person_age_increment> query; + typedef odb::result<person> result; + + transaction t (db->begin ()); + + { + unique_ptr<person_age_increment> fr ( + db->query_one<person_age_increment> ( + query::_val (1) + "," + query::_val (32))); + + assert (fr == nullptr); + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + } + + t.commit (); + } + + // Stored procedures. + // + // Notes (as per the PostgreSQL documentation): + // + // - Output parameters are also supported in procedures, but they work a + // bit differently compared to functions. In the CALL statement, output + // parameters must be included in the argument list, customarily as + // NULL. They are returned as a single row. + // + // Note that we could automatically add the NULL values for all the output + // arguments since their number should match the number of members in the + // structure associated with the view. But we would need to make sure the + // user didn't do that. Plus they could be mixed with IN. Plus there could + // be INOUT. + + // Assign single row columns to the output parameters. + // + // Note that if there are output parameters specified, then the stored + // procedure assigns the columns of the first row produced by the + // underlying statement(s) to the output parameters. If the function + // implementation produces no rows then this is a libpq API level error. + // + // Also note that stored procedures cannot return rowsets. + // + { + create_procedure (*db, + "person_age_decrement (IN min_age INTEGER,\n" + "IN max_age INTEGER,\n" + "OUT age SMALLINT,\n" + "OUT first TEXT,\n" + "OUT last TEXT)", + "AS $$\n" + " UPDATE pgsql_stored_proc_person\n" + " SET age = age - 1\n" + " WHERE age >= min_age AND age <= max_age\n" + " RETURNING age, first, last;\n" + "$$ LANGUAGE SQL;"); + + typedef odb::query<person_age_decrement> query; + typedef odb::result<person> result; + + // Return the first row of the multiple ones generated by the UPDATE + // statement in the function implementation. + // + { + transaction t (db->begin ()); + + person_age_decrement fr ( + db->query_value<person_age_decrement> ( + query::_val (32) + "," + query::_val (33) + ", NULL, NULL, NULL")); + + cout << fr.first << " " << fr.last << " " << fr.age << endl + << endl; + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + + t.commit (); + } + + // If the implementation statement(s) returns no rows, then the + // procedure call ends up with the `procedure returned null record` + // error. + // + try + { + transaction t (db->begin ()); + + person_age_decrement fr ( + db->query_value<person_age_decrement> ( + query::_val (30) + "," + query::_val (30) + ", NULL, NULL, NULL")); + + assert (false); + } + catch (const odb::exception&) {} + } + + // Assign values to the output parameters directly. + // + { + create_procedure (*db, + "person_age_decrement (IN person_id BIGINT,\n" + "OUT person_age SMALLINT,\n" + "OUT person_first TEXT,\n" + "OUT person_last TEXT)", + "AS $$\n" + "DECLARE\n" + " a SMALLINT;\n" + " f TEXT;\n" + " l TEXT;\n" + "BEGIN\n" + " IF person_id > 0 THEN\n" + " UPDATE pgsql_stored_proc_person\n" + " SET age = age - 1\n" + " WHERE id=person_id\n" + " RETURNING age, first, last INTO a, f, l;\n" + " person_age := a;\n" + " person_first := f;\n" + " person_last := l;\n" + " ELSE\n" + " person_age=1000;\n" + " END IF;\n" + "END;\n" + "$$ LANGUAGE PLPGSQL;"); + + typedef odb::query<person_age_decrement> query; + typedef odb::result<person> result; + + transaction t (db->begin ()); + + // Assign the columns of the updated row to all the output parameters. + // + { + person_age_decrement fr ( + db->query_value<person_age_decrement> ( + query::_val (1) + ", NULL, NULL, NULL")); + + cout << fr.first << " " << fr.last << " " << fr.age << endl + << endl; + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + } + + // Assign value to a single output parameter and leave the remaining + // ones unassigned, which ends up with the NULL values for them. + // + { + person_age_decrement fr ( + db->query_value<person_age_decrement> ( + query::_val (0) + ", NULL, NULL, NULL")); + + cout << fr.first << " " << fr.last << " " << fr.age << endl + << endl; + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + } + + t.commit (); + } + + // No output parameters. Returns no rows. + // + { + create_procedure (*db, + "person_age_decrement_void (IN person_id BIGINT)", + "AS $$\n" + " UPDATE pgsql_stored_proc_person\n" + " SET age = age - 1\n" + " WHERE id=person_id;\n" + "$$ LANGUAGE SQL;"); + + typedef odb::query<person_age_decrement_void> query; + typedef odb::result<person> result; + + transaction t (db->begin ()); + + { + unique_ptr<person_age_decrement_void> fr ( + db->query_one<person_age_decrement_void> (query::_val (1))); + + assert (fr == nullptr); + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + } + + t.commit (); + } + + // Perform internal transaction. + // + // Note that we can only call such a procedure using execute() since + // query() cannot be called out of transaction. That also means that the + // procedure cannot have parameters (neither input nor output). + // + { + create_procedure (*db, + "decrement_all_ages ()", + "AS $$\n" + "BEGIN\n" + " UPDATE pgsql_stored_proc_person\n" + " SET age = age - 1;\n" + " COMMIT;\n" + "END;\n" + "$$ LANGUAGE PLPGSQL;"); + + { + connection_ptr conn (db->connection ()); + conn->execute ("CALL decrement_all_ages()"); + } + + typedef odb::result<person> result; + + transaction t (db->begin ()); + + result r (db->query<person> ("ORDER BY id")); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->first () << " " << i->last () << " " << i->age () << endl; + + cout << endl; + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/pgsql/stored-proc/test.hxx b/odb-tests/pgsql/stored-proc/test.hxx new file mode 100644 index 0000000..d014c87 --- /dev/null +++ b/odb-tests/pgsql/stored-proc/test.hxx @@ -0,0 +1,71 @@ +// file : pgsql/stored-proc/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include <string> +#include <cstddef> // std::size_t + +#include <odb/core.hxx> + +#pragma db object +class person +{ +public: + person (unsigned long long id, + const std::string& first, + const std::string& last, + unsigned short age) + : id_ (id), first_ (first), last_ (last), age_ (age) {} + + const std::string& first () const {return first_;} + const std::string& last () const {return last_;} + unsigned short age () const {return age_;} + +private: + person () {} + + friend class odb::access; + + #pragma db id + unsigned long long id_; + + std::string first_; + std::string last_; + unsigned short age_; +}; + +// Stored functions. +// +#pragma db view query("/*CALL*/ SELECT * FROM person_range((?))") +struct person_range +{ + unsigned short age; + std::string first; + std::string last; +}; + +#pragma db view query("/*CALL*/ SELECT * FROM person_count()") +struct person_count +{ + unsigned long long count; +}; + +#pragma db view query("/*CALL*/ SELECT * FROM person_age_increment((?))") +struct person_age_increment {}; + +// Stored procedures. +// +#pragma db view query("CALL person_age_decrement((?))") +struct person_age_decrement +{ + unsigned short age; + std::string first; + std::string last; +}; + +#pragma db view query("CALL person_age_decrement_void((?))") +struct person_age_decrement_void {}; + +#endif // TEST_HXX diff --git a/odb-tests/pgsql/stored-proc/testscript b/odb-tests/pgsql/stored-proc/testscript new file mode 100644 index 0000000..3d3e0fc --- /dev/null +++ b/odb-tests/pgsql/stored-proc/testscript @@ -0,0 +1,63 @@ +# file : pgsql/stored-proc/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* >>~%EOO% + Jane Doe 32 + Joe Dirt 30 + + + Jane Doe 32 + Joe Dirt 30 + + Jane Doe 32 + + Jane Doe 32 + + 0 + + Jane Doe 32 + + 3 + + John Doe 33 + Jane Doe 33 + Joe Dirt 31 + + John Doe 33 + Jane Doe 33 + Joe Dirt 32 + + %(John|Jane) Doe 32% + + John Doe 32 + Jane Doe 32 + Joe Dirt 31 + + John Doe 31 + + John Doe 31 + Jane Doe 32 + Joe Dirt 31 + + 1000 + + John Doe 31 + Jane Doe 32 + Joe Dirt 31 + + John Doe 30 + Jane Doe 32 + Joe Dirt 31 + + John Doe 29 + Jane Doe 31 + Joe Dirt 30 + + EOO diff --git a/odb-tests/qt/common/basic/testscript b/odb-tests/qt/common/basic/testscript index 02be561..58382bb 100644 --- a/odb-tests/qt/common/basic/testscript +++ b/odb-tests/qt/common/basic/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/qt/common/containers/basics/testscript b/odb-tests/qt/common/containers/basics/testscript index de65f68..bdb2d08 100644 --- a/odb-tests/qt/common/containers/basics/testscript +++ b/odb-tests/qt/common/containers/basics/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/qt/common/containers/change-tracking/testscript b/odb-tests/qt/common/containers/change-tracking/testscript index da193a9..c026f63 100644 --- a/odb-tests/qt/common/containers/change-tracking/testscript +++ b/odb-tests/qt/common/containers/change-tracking/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb-tests/qt/common/smart-ptr/testscript b/odb-tests/qt/common/smart-ptr/testscript index d78ccb0..657d47d 100644 --- a/odb-tests/qt/common/smart-ptr/testscript +++ b/odb-tests/qt/common/smart-ptr/testscript @@ -9,7 +9,7 @@ if $mysql { .include ../../../mysql.testscript - $create_schema; + $create_schema $* } @@ -28,7 +28,7 @@ if $pgsql { .include ../../../pgsql.testscript - $create_schema; + $create_schema $* } @@ -38,7 +38,7 @@ if $oracle { .include ../../../oracle.testscript - $create_schema; + $create_schema $* } @@ -48,6 +48,6 @@ if $mssql { .include ../../../mssql.testscript - $create_schema; + $create_schema $* } diff --git a/odb/GPLv3 b/odb/GPLv3 index 94a9ed0..b90b0f4 100644..120000 --- a/odb/GPLv3 +++ b/odb/GPLv3 @@ -1,674 +1 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), 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 prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey 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; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - 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. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -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. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - 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 the public, 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 -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program 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, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. +../GPLv3
\ No newline at end of file diff --git a/odb/INSTALL b/odb/INSTALL deleted file mode 100644 index 6bd473c..0000000 --- a/odb/INSTALL +++ /dev/null @@ -1,36 +0,0 @@ -Prerequisites -============= - - - GNU g++ >= 4.5.0 http://gcc.gnu.org/ - - libcutl >= 1.9.0 http://www.codesynthesis.com/projects/libcutl/ - -ODB requires the GCC compiler (g++) to be built with plugin support. -If you are building GCC yourself, you can enable plugin support with -the --enable-plugin configure option. If you are using a pre-packaged -GCC (for example, as part of your distribution), then you can verify -that GCC was built with plugin support by running g++ with the -v -option and then making sure --enable-plugin is present in the output. - -Note also that for pre-packaged GCC, plugin headers are usually -distributed in a separate package, normally called gcc-plugin-dev -or similar. You will need to install this package in order to build -ODB. For Debian/Ubuntu, this package is called gcc-X.Y-plugin-dev, -for example: - -apt-get install gcc-4.7-plugin-dev - -For RedHat/Fedora, this package is called gcc-plugin-devel, for -example: - -yum install gcc-plugin-devel - - -Building -======== - -The easiest way to build this package is with the bpkg package manager: - -$ bpkg build odb - -But if you don't want to use the package manager, then you can also build it -manually using the standard build2 build system. diff --git a/odb/LICENSE b/odb/LICENSE index 8f76d96..f9be5a4 100644 --- a/odb/LICENSE +++ b/odb/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as @@ -16,6 +16,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. You should have received a copy of the GNU General Public License -along with this program; if not, see: - -http://www.codesynthesis.com/licenses/gpl-3.txt +version 3 along with this program; if not, contact Code Synthesis +at info@codesynthesis.com. diff --git a/odb/PACKAGE-README.md b/odb/PACKAGE-README.md new file mode 120000 index 0000000..422e63f --- /dev/null +++ b/odb/PACKAGE-README.md @@ -0,0 +1 @@ +../PACKAGE-README.md
\ No newline at end of file diff --git a/odb/README b/odb/README deleted file mode 100644 index 90078e5..0000000 --- a/odb/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the ODB compiler and the ODB system documentation. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -See the doc/ directory for documentation. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/odb/README.md b/odb/README.md new file mode 100644 index 0000000..2a2487c --- /dev/null +++ b/odb/README.md @@ -0,0 +1,12 @@ +# odb - ODB compiler + +ODB is an open-source, cross-platform, and cross-database object-relational +mapping (ORM) system for C++. It allows you to persist C++ classes to a +relational database without having to deal with tables, columns, or SQL and +without manually writing any mapping code. + +For further information, including licensing conditions, documentation, and +binary packages, refer to the [ODB project +page](https://codesynthesis.com/products/odb/). + +This package contains the ODB compiler. diff --git a/odb/build/bindist-archive-post.bx b/odb/build/bindist-archive-post.bx new file mode 100644 index 0000000..fa48d5f --- /dev/null +++ b/odb/build/bindist-archive-post.bx @@ -0,0 +1,118 @@ +# file : build/bindist-archive-post.bx +# license : GNU GPL v3; see accompanying LICENSE file + +# Overlay the ODB compiler Windows distribution archive with the contents of +# the MinGW GCC distribution archive (see odb/manifest for details). +# +# Usage: $0 <odb-archive> +# +# Note that we expect to be operating in a clean temporary directory. + +info = [cmdline] echo 1>&2 + +odb_path = [path] $1 + +ife $odb_path + exit "ODB archive path is not specified" + +# Extract the top directory name from the ODB archive path. +# +# Note that we expect the archive path to contain the directory prefix since +# it cannot be located in the current directory (see above). +# +odb_name = [dir_path] $regex.match( \ + $odb_path, \ + '.+[/\\](odb-[^/\\]+-x86_64-windows[^/\\]+)\.(?:zip|tar\.[^./\\]+)', \ + return_subs) + +ifn $odb_name + exit "unable to extract top directory name from ODB archive path '$odb_path'" + +# Discover the URL of the GCC distribution archive (assumed to be named as +# build2-mingw-X.Y.Z-x86_64-windows.tar.xz). While at it, retrieve the archive +# checksum. +# +base_url = ($shell.version.stage \ + ? 'https://stage.build2.org/0' \ + : 'https://download.build2.org') + +u = "$base_url/toolchain.sha256" + +$info "fetching $u" + +curl -sS $u | \ + sed -n -e 's/^([^ ]+) \*([^ ]+build2-mingw-[^ ]+)$/\1 \2/p' | \ + set -w mi [strings] + +ife $mi + exit "unable to obtain MinGW GCC distribution info from $u" + +mingw_checksum = ($mi[0]) +mingw_url = "$base_url/($mi[1])" + +# Download the GCC distribution archive. +# +mingw_file = [path] $regex.match($mingw_url, '.+/([^/]+)', return_subs) + +ifn $mingw_file + exit "unable to extract archive file name from '$mingw_url'" + +$info "fetching $mingw_url" + +curl -sSf -o $mingw_file $mingw_url + +# Verify the checksum of the downloaded GCC distribution archive. +# +sha256sum -b --sum-only $mingw_file | set checksum [string] + +if ($checksum != $mingw_checksum) + exit "$mingw_file checksum $checksum does not match expected $mingw_checksum" + +# Overlay the original ODB archive with the downloaded GCC distribution +# archive. +# +$info "overlaying $odb_path with $mingw_file" + +bsdtar -xf $odb_path + +mkdir $odb_name/mingw +bsdtar -xf $mingw_file -C $odb_name/mingw --strip-components=1 +rm $mingw_file + +# While at it, verify that the version of the system g++ (used to build ODB) +# matches the version of the being bundled g++. +# +# Note: compare only the (first) `g++...` lines of `g++ --version` outputs. +# +g++ --version | \ + sed -n -e 's/^(g\+\+.+)$/\1/p' | \ + set -n system_gcc_ver [string] + +ife $system_gcc_ver + exit "unable to extract version of system g++" + +# Note that the below $path_search() function calls expect absolute path as a +# pattern argument. +# +mingw_bin = [dir_path] $~/$odb_name/mingw/bin + +$mingw_bin/g++ --version | \ + sed -n -e 's/^(g\+\+.+)$/\1/p' | \ + set -n bundled_gcc_ver [string] + +ife $bundled_gcc_ver + exit "unable to extract version of bundled g++" + +if ($system_gcc_ver != $bundled_gcc_ver) + exit "version of system g++ '$system_gcc_ver' does not match version of bundled g++ '$bundled_gcc_ver'" + +cp $path_search($mingw_bin/libgcc_s_seh-*.dll) $odb_name/bin/ +cp $path_search($mingw_bin/libstdc++-*.dll) $odb_name/bin/ +cp $path_search($mingw_bin/libwinpthread-*.dll) $odb_name/bin/ + +# Note that on Windows bsdtar doesn't like trailing slashes, so let's use +# $odb_name's string representation. +# +rm $odb_path +bsdtar -a --options=compression-level=9 -cf $odb_path $string($odb_name) +rm -r $odb_name diff --git a/odb/buildfile b/odb/buildfile index 78b5d08..bc65d81 100644 --- a/odb/buildfile +++ b/odb/buildfile @@ -1,9 +1,16 @@ # file : buildfile # license : GNU GPL v3; see accompanying LICENSE file -./: {*/ -build/ -m4/} doc{INSTALL NEWS README} legal{GPLv3 LICENSE} manifest +./: {*/ -build/ -m4/} \ + doc{README.md PACKAGE-README.md NEWS} \ + legal{GPLv3 LICENSE} \ + manifest -# Don't install tests or the INSTALL file. +# bbot worker hook script (see bindist-windows build configuration for +# details). # -tests/: install = false -doc{INSTALL}@./: install = false +./: build/file{bindist-archive-post.bx} + +# Don't install tests. +# +tests/: install = false diff --git a/odb/doc/buildfile b/odb/doc/buildfile index 88f30fc..fadbe40 100644 --- a/odb/doc/buildfile +++ b/odb/doc/buildfile @@ -83,7 +83,6 @@ if $develop # if! diff $src_base/pregenerated/odb.1 $path($>) >- cp $path($>) $src_base/pregenerated/odb.1 - end }} xhtml{odb}: ../odb/cli{options} file{odb-prologue.xhtml odb-epilogue.xhtml} $cli @@ -97,7 +96,6 @@ if $develop if! diff $src_base/pregenerated/odb.xhtml $path($>) >- cp $path($>) $src_base/pregenerated/odb.xhtml - end }} # diff --git a/odb/doc/manual.html2ps b/odb/doc/manual.html2ps index 65f0c9d..fb3d7bb 100644 --- a/odb/doc/manual.html2ps +++ b/odb/doc/manual.html2ps @@ -21,7 +21,7 @@ <h1> </h1> <h1> </h1> </div> - <p>Copyright © 2009-2020 Code Synthesis.</p> + <p>Copyright © 2009-2025 Code Synthesis.</p> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the diff --git a/odb/doc/manual.xhtml b/odb/doc/manual.xhtml index a004cd7..e0389ef 100644 --- a/odb/doc/manual.xhtml +++ b/odb/doc/manual.xhtml @@ -5,11 +5,11 @@ <head> <title>C++ Object Persistence with ODB</title> - <meta name="copyright" content="© 2009-2020 Code Synthesis"/> + <meta name="copyright" content="© 2009-2025 Code Synthesis"/> <meta name="keywords" content="odb,c++,object,persistence,ORM,relational,database,RDBMS,ODBMS,OODBMS"/> <meta name="description" content="C++ Object Persistence with ODB"/> - <meta name="revision" content="2.4"/> - <meta name="version" content="2.4.0"/> + <meta name="revision" content="2.6"/> + <meta name="version" content="2.6.0"/> <!-- @@ -35,9 +35,22 @@ for consistency. <link rel="stylesheet" type="text/css" href="default.css" /> <style type="text/css"> + code + { + background-color: rgba(0, 0, 0, 0.05); + border-radius: 0.2em; + padding: .2em .32em .18em .32em; + } + + table.toc * code + { + background-color: white; + border-radius: none; + } + pre { - padding : 0 0 0 0em; - margin : 0em 0em 0em 0; + padding : 0 0 0 0; + margin : 0 0 0 0; font-size : 102% } @@ -281,7 +294,7 @@ for consistency. <div id="titlepage"> <div class="title">C++ Object Persistence with ODB</div> - <p>Copyright © 2009-2020 Code Synthesis</p> + <p>Copyright © 2009-2025 Code Synthesis</p> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the @@ -290,8 +303,8 @@ for consistency. no Front-Cover Texts and no Back-Cover Texts.</p> <!-- REMEMBER TO CHANGE VERSIONS IN THE META TAGS ABOVE! --> - <p id="revision">Revision 2.4, February 2015</p> - <p>This revision of the manual describes ODB 2.4.0 and is available + <p id="revision">Revision 2.6, March 2025</p> + <p>This revision of the manual describes ODB 2.6.0 and is available in the following formats: <a href="http://www.codesynthesis.com/products/odb/doc/manual.xhtml">XHTML</a>, <a href="http://www.codesynthesis.com/products/odb/doc/odb-manual.pdf">PDF</a>, and @@ -621,6 +634,7 @@ for consistency. <tr><th>14.4.34</th><td><a href="#14.4.34"><code>index_column</code></a></td></tr> <tr><th>14.4.35</th><td><a href="#14.4.35"><code>key_column</code></a></td></tr> <tr><th>14.4.36</th><td><a href="#14.4.36"><code>value_column</code></a></td></tr> + <tr><th>14.4.36</th><td><a href="#14.4.37"><code>points_to</code></a></td></tr> </table> </td> </tr> @@ -645,7 +659,12 @@ for consistency. <th>14.7</th><td><a href="#14.7">Index Definition Pragmas</a></td> </tr> <tr> - <th>14.8</th><td><a href="#14.8">Database Type Mapping Pragmas</a></td> + <th>14.8</th><td><a href="#14.8">Type Mapping Pragmas</a> + <table class="toc"> + <tr><th>14.8.1</th><td><a href="#14.8.1">C++ Type Mapping Pragmas</a></td></tr> + <tr><th>14.8.2</th><td><a href="#14.8.2">Database Type Mapping Pragmas</a></td></tr> + </table> + </td> </tr> <tr> <th>14.9</th><td><a href="#14.9">C++ Compiler Warnings</a> @@ -700,6 +719,7 @@ for consistency. <table class="toc"> <tr><th>17.1.1</th><td><a href="#17.1.1">String Type Mapping</a></td></tr> <tr><th>17.1.2</th><td><a href="#17.1.2">Binary Type Mapping</a></td></tr> + <tr><th>17.1.3</th><td><a href="#17.1.3">Mixed Automatic/0 Object Id Assignment</a></td></tr> </table> </td> </tr> @@ -728,26 +748,28 @@ for consistency. <tr><th>18.1.1</th><td><a href="#18.1.1">String Type Mapping</a></td></tr> <tr><th>18.1.2</th><td><a href="#18.1.2">Binary Type Mapping</a></td></tr> <tr><th>18.1.3</th><td><a href="#18.1.3">Incremental <code>BLOB</code>/<code>TEXT</code> I/O</a></td></tr> + <tr><th>18.1.4</th><td><a href="#18.1.4">Mixed Automatic/Manual Object Id Assignment</a></td></tr> </table> </td> </tr> <tr><th>18.2</th><td><a href="#18.2">SQLite Database Class</a></td></tr> <tr><th>18.3</th><td><a href="#18.3">SQLite Connection and Connection Factory</a></td></tr> - <tr><th>18.4</th><td><a href="#18.4">SQLite Exceptions</a></td></tr> + <tr><th>18.4</th><td><a href="#18.4">Attached SQLite Databases</a></td></tr> + <tr><th>18.5</th><td><a href="#18.5">SQLite Exceptions</a></td></tr> <tr> - <th>18.5</th><td><a href="#18.5">SQLite Limitations</a> + <th>18.6</th><td><a href="#18.6">SQLite Limitations</a> <table class="toc"> - <tr><th>18.5.1</th><td><a href="#18.5.1">Query Result Caching</a></td></tr> - <tr><th>18.5.2</th><td><a href="#18.5.2">Automatic Assignment of Object Ids</a></td></tr> - <tr><th>18.5.3</th><td><a href="#18.5.3">Foreign Key Constraints</a></td></tr> - <tr><th>18.5.4</th><td><a href="#18.5.4">Constraint Violations</a></td></tr> - <tr><th>18.5.5</th><td><a href="#18.5.5">Sharing of Queries</a></td></tr> - <tr><th>18.5.6</th><td><a href="#18.5.6">Forced Rollback</a></td></tr> - <tr><th>18.5.7</th><td><a href="#18.5.7">Database Schema Evolution</a></td></tr> + <tr><th>18.6.1</th><td><a href="#18.6.1">Query Result Caching</a></td></tr> + <tr><th>18.6.2</th><td><a href="#18.6.2">Automatic Assignment of Object Ids</a></td></tr> + <tr><th>18.6.3</th><td><a href="#18.6.3">Foreign Key Constraints</a></td></tr> + <tr><th>18.6.4</th><td><a href="#18.6.4">Constraint Violations</a></td></tr> + <tr><th>18.6.5</th><td><a href="#18.6.5">Sharing of Queries</a></td></tr> + <tr><th>18.6.6</th><td><a href="#18.6.6">Forced Rollback</a></td></tr> + <tr><th>18.6.7</th><td><a href="#18.6.7">Database Schema Evolution</a></td></tr> </table> </td> </tr> - <tr><th>18.6</th><td><a href="#18.6">SQLite Index Definition</a></td></tr> + <tr><th>18.7</th><td><a href="#18.7">SQLite Index Definition</a></td></tr> </table> </td> </tr> @@ -780,6 +802,7 @@ for consistency. </td> </tr> <tr><th>19.6</th><td><a href="#19.6">PostgreSQL Index Definition</a></td></tr> + <tr><th>19.7</th><td><a href="#19.7">PostgreSQL Stored Procedures and Functions</a></td></tr> </table> </td> </tr> @@ -1263,14 +1286,11 @@ for consistency. <h2><a name="1.3">1.3 Supported C++ Standards</a></h2> - <p>ODB provides support for ISO/IEC C++ 1998/2003 (C++98/03), - ISO/IEC TR 19768 C++ Library Extensions (C++ TR1), and - ISO/IEC C++ 2011 (C++11). While the majority of the examples in - this manual use C++98/03, support for the new functionality and - library components introduced in TR1 and C++11 are discussed - throughout the document. The <code>c++11</code> example in the - <code>odb-examples</code> package also shows ODB support for - various C++11 features.</p> + <p>ODB provides support for ISO/IEC C++ 1998/2003 (C++98/03), ISO/IEC C++ + 2011 (C++11), as well later standards with the majority of the examples + in this manual using C++11. The <code>c++11</code> example in the + <code>odb-examples</code> package shows ODB support for various + features new in C++11.</p> <!-- CHAPTER --> @@ -1351,7 +1371,7 @@ private: friend class odb::access; // (4) #pragma db id auto // (5) - unsigned long id_; // (5) + unsigned long long id_; // (5) std::string first_; std::string last_; @@ -1614,7 +1634,7 @@ mysql --user=odb_test --database=odb_test < person.sql // driver.cxx // -#include <memory> // std::auto_ptr +#include <memory> // std::unique_ptr #include <iostream> #include <odb/database.hxx> @@ -1633,9 +1653,9 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (new odb::mysql::database (argc, argv)); + unique_ptr<database> db (new odb::mysql::database (argc, argv)); - unsigned long john_id, jane_id, joe_id; + unsigned long long john_id, jane_id, joe_id; // Create a few persistent person objects. // @@ -1854,8 +1874,8 @@ main (int argc, char* argv[]) ... } - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; // Say hello to those over 30. // @@ -1884,10 +1904,10 @@ main (int argc, char* argv[]) replaced with "..." in the above listing for brevity. Again, let's examine the rest of it piece by piece.</p> - <p>The two <code>typedef</code>s create convenient aliases for two - template instantiations that will be used a lot in our application. - The first is the query type for the <code>person</code> objects - and the second is the result type for that query.</p> + <p>The two <code>using</code> declarations create convenient aliases for two + template instantiations that will be used a lot in our application. The + first is the query type for the <code>person</code> objects and the + second is the result type for that query.</p> <p>Then we begin a new transaction and call the <code>query()</code> database function. We pass a query expression @@ -1976,7 +1996,7 @@ main (int argc, char* argv[]) { ... - unsigned long john_id, jane_id, joe_id; + unsigned long long john_id, jane_id, joe_id; // Create a few persistent person objects. // @@ -1995,7 +2015,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr<person> joe (db->load<person> (joe_id)); + unique_ptr<person> joe (db->load<person> (joe_id)); joe->age (joe->age () + 1); db->update (*joe); @@ -2022,13 +2042,11 @@ main (int argc, char* argv[]) <code>person</code> object with Joe's persistent state. We pass Joe's object identifier that we stored earlier when we made this object persistent. While here we use - <code>std::auto_ptr</code> to manage the returned object, we + <code>std::unique_ptr</code> to manage the returned object, we could have also used another smart pointer, for example - <code>std::unique_ptr</code> from C++11 or <code>shared_ptr</code> - from TR1, C++11, or Boost. For more information - on the object lifetime management and the smart pointers that we - can use for that, see <a href="#3.3">Section 3.3, "Object - and View Pointers"</a>.</p> + <code>shared_ptr</code> from C++11 or Boost. For more information on the + object lifetime management and the smart pointers that we can use for + that, see <a href="#3.3">Section 3.3, "Object and View Pointers"</a>.</p> <p>With the instantiated object in hand we increment the age and call the <code>update()</code> function to update @@ -2064,7 +2082,7 @@ Hello, Joe! // database so we use the query_one() shortcut instead of // manually iterating over the result returned by query(). // - auto_ptr<person> joe ( + unique_ptr<person> joe ( db->query_one<person> (query::first == "Joe" && query::last == "Dirt")); @@ -2200,7 +2218,7 @@ max age: 33 // Here we know that there can be only one John Doe in our // database so we use the query_one() shortcut again. // - auto_ptr<person> john ( + unique_ptr<person> john ( db->query_one<person> (query::first == "John" && query::last == "Doe")); @@ -2394,7 +2412,7 @@ odb --multi-database dynamic -d common -d mysql -d pgsql \ is how we create the database instance. Specifically, this line:</p> <pre class="cxx"> -auto_ptr<database> db (new odb::mysql::database (argc, argv)); +unique_ptr<database> db (new odb::mysql::database (argc, argv)); </pre> <p>Now our example is capable of storing its data either in MySQL or @@ -2413,7 +2431,7 @@ auto_ptr<database> db (new odb::mysql::database (argc, argv)); // #include <string> -#include <memory> // std::auto_ptr +#include <memory> // std::unique_ptr #include <iostream> #include <odb/database.hxx> @@ -2428,10 +2446,10 @@ auto_ptr<database> db (new odb::mysql::database (argc, argv)); using namespace std; using namespace odb::core; -auto_ptr<database> +unique_ptr<database> create_database (int argc, char* argv[]) { - auto_ptr<database> r; + unique_ptr<database> r; if (argc < 2) { @@ -2456,7 +2474,7 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (create_database (argc, argv)); + unique_ptr<database> db (create_database (argc, argv)); if (db.get () == 0) return 1; // Diagnostics has already been issued. @@ -2714,7 +2732,7 @@ class person ... #pragma db id - unsigned long id_; + unsigned long long id_; }; </pre> @@ -2778,7 +2796,7 @@ private: person () {} #pragma db id - unsigned long id_; + unsigned long long id_; std::string name_; }; @@ -2812,15 +2830,15 @@ public: ... - unsigned long id () const; - void id (unsigned long); + unsigned long long id () const; + void id (unsigned long long); const std::string& get_name () const; std::string& set_name (); private: #pragma db id - unsigned long id_; // Uses id() for access. + unsigned long long id_; // Uses id() for access. std::string name_; // Uses get_name()/set_name() for access. }; @@ -2895,15 +2913,15 @@ class name or object relationships. In particular, a dynamically allocated object or view that is returned as a raw pointer from a database operation can be assigned to a smart pointer of our choice, for example - <code>std::auto_ptr</code>, <code>std::unique_ptr</code> from C++11, or - <code>shared_ptr</code> from TR1, C++11, or Boost.</p> + <code>std::auto_ptr</code> (C++98/03 only), <code>std::unique_ptr</code> + from C++11, or <code>shared_ptr</code> from C++11 or Boost.</p> <p>However, to avoid any possibility of a mistake, such as forgetting to use a smart pointer for a returned object or view, as well as to simplify the use of more advanced ODB functionality, such as sessions and bidirectional object relationships, it is recommended that you use smart pointers with the sharing semantics as object pointers. - The <code>shared_ptr</code> smart pointer from TR1, C++11, or Boost + The <code>shared_ptr</code> smart pointer from C++11 or Boost is a good default choice. However, if sharing is not required and sessions are not used, then <code>std::unique_ptr</code> or <code>std::auto_ptr</code> can be used just as well.</p> @@ -2913,7 +2931,7 @@ class name we can use the <code>db pointer</code> pragma, for example:</p> <pre class="cxx"> -#pragma db object pointer(std::tr1::shared_ptr) +#pragma db object pointer(std::shared_ptr) class person { ... @@ -2924,7 +2942,7 @@ class person views at the namespace level:</p> <pre class="cxx"> -#pragma db namespace pointer(std::tr1::shared_ptr) +#pragma db namespace pointer(std::shared_ptr) namespace accounting { #pragma db object @@ -2948,14 +2966,14 @@ namespace accounting The typical usage is shown below:</p> <pre class="terminal"> ---default-pointer std::tr1::shared_ptr +--default-pointer std::shared_ptr </pre> <p>An alternative to this method with the same effect is to specify the default pointer for the global namespace:</p> <pre class="terminal"> -#pragma db namespace() pointer(std::tr1::shared_ptr) +#pragma db namespace() pointer(std::shared_ptr) </pre> <p>Note that we can always override the default pointer specified @@ -2987,13 +3005,13 @@ namespace accounting (namespace)"</a> for more information on these mechanisms.</p> <p>Built-in support that is provided by the ODB runtime library allows us - to use <code>shared_ptr</code> (TR1 or C++11), - <code>std::unique_ptr</code> (C++11), or <code>std::auto_ptr</code> as - pointer types. Plus, ODB profile libraries, that are available for - commonly used frameworks and libraries (such as Boost and Qt), - provide support for smart pointers found in these frameworks and - libraries (<a href="#III">Part III, "Profiles"</a>). It is also - easy to add support for our own smart pointers, as described in + to use <code>std::shared_ptr</code> (C++11), + <code>std::unique_ptr</code> (C++11), or <code>std::auto_ptr</code> + (C++98/03 only) as pointer types. Plus, ODB profile libraries, that are + available for commonly used frameworks and libraries (such as Boost and + Qt), provide support for smart pointers found in these frameworks and + libraries (<a href="#III">Part III, "Profiles"</a>). It is also easy to + add support for our own smart pointers, as described in <a href="#6.5"> Section 6.5, "Using Custom Smart Pointers"</a>.</p> <h2><a name="3.4">3.4 Database</a></h2> @@ -3014,7 +3032,7 @@ namespace accounting #include <odb/database.hxx> #include <odb/mysql/database.hxx> -auto_ptr<odb::database> db ( +unique_ptr<odb::database> db ( new odb::mysql::database ( "test_user" // database login name "test_password" // database password @@ -3206,8 +3224,8 @@ namespace odb class transaction { public: - typedef odb::database database_type; - typedef odb::connection connection_type; + using database_type = odb::database; + using connection_type = odb::connection; explicit transaction (transaction_impl*, bool make_current = true); @@ -3376,11 +3394,11 @@ update_age (database& db, person& p) <pre class="cxx"> void -update_age (database& db, unsigned long id) +update_age (database& db, unsigned long long id) { transaction t (db.begin ()); - auto_ptr<person> p (db.load<person> (id)); + unique_ptr<person> p (db.load<person> (id)); p.age (p.age () + 1); db.update (p); @@ -3452,7 +3470,7 @@ namespace odb class connection { public: - typedef odb::database database_type; + using database_type = odb::database; transaction begin () = 0; @@ -3470,7 +3488,7 @@ namespace odb database (); }; - typedef details::shared_ptr<connection> connection_ptr; + using connection_ptr = details::shared_ptr<connection>; } </pre> @@ -3668,7 +3686,7 @@ shared_ptr<person> jane (new person ("Jane", "Doe", 32)); transaction t (db.begin ()); db.persist (john); -unsigned long jane_id (db.persist (jane)); +unsigned long long jane_id (db.persist (jane)); t.commit (); @@ -3726,7 +3744,7 @@ cerr << "Jane's id: " << jane_id << endl; <pre class="cxx"> transaction t (db.begin ()); -auto_ptr<person> jane (db.load<person> (jane_id)); +unique_ptr<person> jane (db.load<person> (jane_id)); db.load (jane_id, *jane); @@ -3834,8 +3852,8 @@ t.commit (); <pre class="cxx"> void transfer (database& db, - unsigned long from_acc, - unsigned long to_acc, + unsigned long long from_acc, + unsigned long long to_acc, unsigned int amount) { bank_account from, to; @@ -3963,7 +3981,7 @@ t.commit (); <pre class="cxx"> person& john = ... shared_ptr<jane> jane = ... -unsigned long joe_id = ... +unsigned long long joe_id = ... transaction t (db.begin ()); @@ -4019,7 +4037,7 @@ t.commit (); specify the object type we are erasing. For example:</p> <pre class="cxx"> -typedef odb::query<person> query; +using query = odb::query<person>; transaction t (db.begin ()); @@ -4045,7 +4063,7 @@ t.commit (); classes.</p> <pre class="cxx"> -typedef odb::query<employee> query; +using query = odb::query<employee>; transaction t (db.begin ()); @@ -4630,8 +4648,8 @@ namespace odb introductory chapters. Below is another, more interesting, example:</p> <pre class="cxx"> - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; unsigned short age; query q (query::first == "John" && query::age < query::_ref (age)); @@ -4693,7 +4711,7 @@ namespace odb <code>||</code> (OR), and <code>!</code> (NOT). For example:</p> <pre class="cxx"> - typedef odb::query<person> query; + using query = odb::query<person>; query q (query::first == "John" || query::age == 31); </pre> @@ -4916,8 +4934,8 @@ namespace odb explicitly specify the object type we are querying. For example:</p> <pre class="cxx"> - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; result all (db.query<person> ()); result johns (db.query<person> (query::first == "John")); @@ -4971,9 +4989,9 @@ result r (find_minors (db, query::first == "John")); <code>database::query_value()</code> shortcut functions, for example:</p> <pre class="cxx"> - typedef odb::query<person> query; + using query = odb::query<person>; - auto_ptr<person> p ( + unique_ptr<person> p ( db.query_one<person> ( query::email == "jon@example.com")); </pre> @@ -5060,8 +5078,8 @@ result r (find_minors (db, query::first == "John")); class template, for example:</p> <pre class="cxx"> - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; result johns (db.query<person> (query::first == "John")); </pre> @@ -5086,7 +5104,7 @@ namespace odb class result { public: - typedef odb::result_iterator<T> iterator; + using iterator = odb::result_iterator<T>; public: result (); @@ -5272,7 +5290,7 @@ namespace odb { if (i->last == "Doe") { - auto_ptr p (i.load ()); + unique_ptr p (i.load ()); ... } } @@ -5305,7 +5323,7 @@ namespace odb identifier. For example:</p> <pre class="cxx"> - std::set<unsigned long> set = ...; // Persons of interest. + std::set<unsigned long long> set = ...; // Persons of interest. result r (db.query<person> (query::first == "John")); @@ -5405,8 +5423,8 @@ namespace odb querying. For example:</p> <pre class="cxx"> -typedef odb::query<person> query; -typedef odb::prepared_query<person> prep_query; +using query = odb::query<person>; +using prep_query = odb::prepared_query<person>; prep_query pq ( db.prepare_query<person> ("person-age-query", query::age > 50)); @@ -5516,9 +5534,9 @@ namespace odb <code>odb-examples</code> package.</p> <pre class="cxx"> -typedef odb::query<person> query; -typedef odb::prepared_query<person> prep_query; -typedef odb::result<person> result; +using query = odb::query<person>; +using prep_query = odb::prepared_query<person>; +using result = odb::result<person>; transaction t (db.begin ()); @@ -5604,8 +5622,8 @@ for (age = 90; age > 40; age -= 10) query on the connection. The second overloaded version of <code>cache_query()</code> also takes a pointer to the by-reference query parameters. In C++98/03 it should be - <code>std::auto_ptr</code> while in C++11 <code>std::auto_ptr</code> - or <code>std::unique_ptr</code> can be used. The + <code>std::auto_ptr</code> while in C++11 + — <code>std::unique_ptr</code>. The <code>cache_query()</code> function assumes ownership of the passed <code>params</code> argument. If a prepared query with the same name is already cached on this connection, @@ -5666,7 +5684,7 @@ for (unsigned short age (90); age > 40; age -= 10) if (!pq) { - auto_ptr<unsigned short> p (new unsigned short); + unique_ptr<unsigned short> p (new unsigned short); age_param = p.get (); query q (query::age > query::_ref (*age_param)); pq = db.prepare_query<person> ("person-age-query", q); @@ -5735,7 +5753,7 @@ struct params static void query_factory (const char* name, connection& c) { - auto_ptr<params> p (new params); + unique_ptr<params> p (new params); query q (query::age > query::_ref (p->age) && query::first == query::_ref (p->first)); prep_query pq (c.prepare_query<person> (name, q)); @@ -5761,8 +5779,7 @@ for (unsigned short age (90); age > 40; age -= 10) } </pre> - <p>In C++11 we could have instead used a lambda function as well as - <code>unique_ptr</code> rather than <code>auto_ptr</code>:</p> + <p>Instead of a static function we could have used a lambda:</p> <pre> db.query_factory ( @@ -5916,7 +5933,7 @@ class person ... private: #pragma db id auto - unsigned long id_; + unsigned long long id_; std::vector<std::string> nicknames_; ... @@ -6011,7 +6028,7 @@ class person ... private: #pragma db id auto - unsigned long id_; + unsigned long long id_; std::set<std::string> emails_; ... @@ -6078,7 +6095,7 @@ class person ... private: #pragma db id auto - unsigned long id_; + unsigned long long id_; std::map<unsigned short, float> age_weight_map_; ... @@ -6187,7 +6204,7 @@ p.names.pop_back (); { transaction t (db.begin ()); - auto_ptr<person> p1 (db.load<person> (...)); // Start change tracking. + unique_ptr<person> p1 (db.load<person> (...)); // Start change tracking. p1->names.insert (p1->names.begin (), "Joe Do"); db.update (*p1); // One UPDATE, one INSERT; reset change state. t.commit (); @@ -6304,7 +6321,7 @@ for (;;) <pre class="cxx"> namespace odb { - template <class T, class A = std::allocator<T> > + template <class T, class A = std::allocator<T>> class vector { ... @@ -6329,7 +6346,7 @@ namespace odb // Iterators. // - typedef typename std::vector<T, A>::const_iterator const_iterator; + using const_iterator = typename std::vector<T, A>::const_iterator; class iterator { @@ -6469,19 +6486,19 @@ std::sort (v.mbegin (), v.mend ()); <p>Relationships between persistent objects are expressed with pointers or containers of pointers. The ODB runtime library provides built-in support - for <code>shared_ptr</code>/<code>weak_ptr</code> (TR1 or C++11), + for <code>std::shared_ptr</code>/<code>std::weak_ptr</code> (C++11), <code>std::unique_ptr</code> (C++11), - <code>std::auto_ptr</code>, and raw pointers. Plus, ODB profile - libraries, that are available for commonly used frameworks and libraries - (such as Boost and Qt), provide support for smart pointers found in these - frameworks and libraries (<a href="#III">Part III, "Profiles"</a>). It is - also easy to add support for a custom smart pointer as discussed later - in <a href="#6.5"> Section 6.5, "Using Custom Smart Pointers"</a>. Any - supported smart pointer can be used in a data member as long as it can be - explicitly constructed from the canonical object pointer - (<a href="#3.3">Section 3.3, "Object and View Pointers"</a>). For - example, we can use <code>weak_ptr</code> if the object pointer - is <code>shared_ptr</code>.</p> + <code>std::auto_ptr</code> (C++98/03 only), and raw pointers. Plus, ODB + profile libraries, that are available for commonly used frameworks and + libraries (such as Boost and Qt), provide support for smart pointers + found in these frameworks and libraries (<a href="#III">Part III, + "Profiles"</a>). It is also easy to add support for a custom smart + pointer as discussed later in <a href="#6.5"> Section 6.5, "Using Custom + Smart Pointers"</a>. Any supported smart pointer can be used in a data + member as long as it can be explicitly constructed from the canonical + object pointer (<a href="#3.3">Section 3.3, "Object and View + Pointers"</a>). For example, we can use <code>weak_ptr</code> if the + object pointer is <code>shared_ptr</code>.</p> <p>When an object containing a pointer to another object is loaded, the pointed-to object is loaded as well. In some situations this @@ -6498,8 +6515,8 @@ std::sort (v.mbegin (), v.mend ()); <p>As a simple example, consider the following employee-employer relationship. Code examples presented in this chapter - will use the <code>shared_ptr</code> and <code>weak_ptr</code> - smart pointers from the TR1 (<code>std::tr1</code>) namespace.</p> + will use the C++11 <code>shared_ptr</code> and <code>weak_ptr</code> + smart pointers from the <code>std</code> namespace.</p> <pre class="cxx"> #pragma db object @@ -6517,7 +6534,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; std::string first_name_; std::string last_name_; @@ -6545,7 +6562,7 @@ class employee shared_ptr<employer> current_employer_; #pragma db value_not_null - std::vector<shared_ptr<employer> > previous_employers_; + std::vector<shared_ptr<employer>> previous_employers_; }; </pre> @@ -6563,7 +6580,7 @@ class employee <pre class="cxx"> // Create an employer and a few employees. // -unsigned long john_id, jane_id; +unsigned long long john_id, jane_id; { shared_ptr<employer> er (new employer ("Example Inc")); shared_ptr<employee> john (new employee ("John", "Doe")); @@ -6630,8 +6647,8 @@ unsigned long john_id, jane_id; employees of Example Inc that have the Doe last name:</p> <pre class="cxx"> -typedef odb::query<employee> query; -typedef odb::result<employee> result; +using query = odb::query<employee>; +using result = odb::result<employee>; session s; transaction t (db.begin ()); @@ -6720,7 +6737,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db not_null shared_ptr<employer> employer_; @@ -6761,10 +6778,10 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db value_not_null unordered - std::vector<shared_ptr<project> > projects_; + std::vector<shared_ptr<project>> projects_; }; </pre> @@ -6794,7 +6811,7 @@ class employee #pragma db value_not_null unordered \ id_column("employee_id") value_column("project_name") - std::vector<shared_ptr<project> > projects_; + std::vector<shared_ptr<project>> projects_; }; </pre> @@ -6826,7 +6843,7 @@ class position ... #pragma db id - unsigned long id_; + unsigned long long id_; weak_ptr<employee> employee_; }; @@ -6837,7 +6854,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db not_null shared_ptr<position> position_; @@ -7024,7 +7041,7 @@ class position ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db inverse(position_) weak_ptr<employee> employee_; @@ -7036,7 +7053,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db not_null shared_ptr<position> position_; @@ -7085,7 +7102,7 @@ class employer std::string name_; #pragma db value_not_null inverse(employer_) - std::vector<weak_ptr<employee> > employees_ + std::vector<weak_ptr<employee>> employees_ }; #pragma db object @@ -7094,7 +7111,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db not_null shared_ptr<employer> employer_; @@ -7150,7 +7167,7 @@ class project std::string name_; #pragma db value_not_null inverse(projects_) - std::vector<weak_ptr<employee> > employees_; + std::vector<weak_ptr<employee>> employees_; }; #pragma db object @@ -7159,10 +7176,10 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db value_not_null unordered - std::vector<shared_ptr<project> > projects_; + std::vector<shared_ptr<project>> projects_; }; </pre> @@ -7230,7 +7247,7 @@ class position ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db inverse(position_) weak_ptr<employee> employee_; @@ -7248,7 +7265,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db not_null shared_ptr<position> position_; @@ -7366,7 +7383,7 @@ class employer std::string name_; #pragma db value_not_null inverse(employer_) - std::vector<weak_ptr<employee> > employees_; + std::vector<weak_ptr<employee>> employees_; }; #pragma db object @@ -7375,7 +7392,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; #pragma db not_null shared_ptr<employer> employer_; @@ -7386,7 +7403,7 @@ class employee name given the employee id:</p> <pre class="cxx"> -unsigned long id = ... +unsigned long long id = ... string name; session s; @@ -7419,16 +7436,12 @@ t.commit (); supported pointers, namely: <code>odb::lazy_shared_ptr</code>/<code>lazy_weak_ptr</code> for C++11 <code>std::shared_ptr</code>/<code>weak_ptr</code>, - <code>odb::tr1::lazy_shared_ptr</code>/<code>lazy_weak_ptr</code> - for TR1 <code>std::tr1::shared_ptr</code>/<code>weak_ptr</code>, <code>odb::lazy_unique_ptr</code> for C++11 <code>std::unique_ptr</code>, - <code>odb::lazy_auto_ptr</code> for <code>std::auto_ptr</code>, - and <code>odb::lazy_ptr</code> for raw pointers. The TR1 lazy - pointers are defined in the <code><odb/tr1/lazy-ptr.hxx></code> - header while all the others — in - <code><odb/lazy-ptr.hxx></code>. The ODB profile - libraries also provide lazy pointer implementations for smart pointers - from popular frameworks and libraries (<a href="#III">Part III, + <code>odb::lazy_auto_ptr</code> for C++98/03 <code>std::auto_ptr</code>, + and <code>odb::lazy_ptr</code> for raw pointers. All these lazy pointers + are defined in the <code><odb/lazy-ptr.hxx></code> header. The ODB + profile libraries also provide lazy pointer implementations for smart + pointers from popular frameworks and libraries (<a href="#III">Part III, "Profiles"</a>).</p> <p>While we will discuss the interface of lazy pointers in more detail @@ -7454,7 +7467,7 @@ class employer ... #pragma db value_not_null inverse(employer_) - std::vector<lazy_weak_ptr<employee> > employees_; + std::vector<lazy_weak_ptr<employee>> employees_; }; #pragma db object @@ -7470,7 +7483,7 @@ class employee <p>And the transaction is changed like this:</p> <pre class="cxx"> -unsigned long id = ... +unsigned long long id = ... string name; session s; @@ -7571,7 +7584,7 @@ public: presented earlier.</p> <pre class="cxx"> -typedef std::vector<lazy_weak_ptr<employee> > employees; +using employees = std::vector<lazy_weak_ptr<employee>>; session s; transaction t (db.begin ()); @@ -7821,7 +7834,7 @@ class basic_name std::string last_; }; -typedef std::vector<basic_name> basic_names; +using basic_names = std::vector<basic_name>; #pragma db value class name_extras @@ -7886,7 +7899,7 @@ struct point T z; }; -typedef point<int> int_point; +using int_point = point<int>; #pragma db value(int_point) #pragma db object @@ -7901,7 +7914,7 @@ class object <p>Note that the database support code for such a composite value type is generated when compiling the header containing the <code>db value</code> pragma and not the header containing - the template definition or the <code>typedef</code> name. This + the template definition or the <code>using</code> alias. This allows us to use templates defined in other files, such as <code>std::pair</code> defined in the <code>utility</code> standard header file:</p> @@ -7909,7 +7922,7 @@ class object <pre class="cxx"> #include <utility> // std::pair -typedef std::pair<std::string, std::string> phone_numbers; +using phone_numbers = std::pair<std::string, std::string>; #pragma db value(phone_numbers) #pragma db object @@ -7938,8 +7951,8 @@ class person objects. For example:</p> <pre class="cxx"> -typedef odb::query<person> query; -typedef odb::result<person> result; +using query = odb::query<person>; +using result = odb::result<person>; transaction t (db.begin ()); @@ -8009,7 +8022,7 @@ class person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; name name_; }; @@ -8224,7 +8237,7 @@ namespace odb class nullable { public: - typedef T value_type; + using value_type = T; nullable (); nullable (const T&); @@ -8323,19 +8336,19 @@ class person std::string first_; #pragma db null - std::auto_ptr<std::string> middle_; + std::unique_ptr<std::string> middle_; std::string last_; }; </pre> <p>The ODB compiler includes built-in support for using - <code>std::auto_ptr</code>, <code>std::unique_ptr</code> (C++11), - and <code>shared_ptr</code> (TR1 or C++11) as pointers to values. - Plus, ODB profile libraries, that are - available for commonly used frameworks and libraries (such as Boost and - Qt), provide support for smart pointers found in these frameworks - and libraries (<a href="#III">Part III, "Profiles"</a>).</p> + <code>std::auto_ptr</code> (C++98/03 only), <code>std::unique_ptr</code> + (C++11), and <code>std::shared_ptr</code> (C++11) as pointers to values. + Plus, ODB profile libraries, that are available for commonly used + frameworks and libraries (such as Boost and Qt), provide support for + smart pointers found in these frameworks and libraries + (<a href="#III">Part III, "Profiles"</a>).</p> <p>ODB also supports the <code>NULL</code> semantics for composite values. In the relational database the <code>NULL</code> composite @@ -8372,7 +8385,7 @@ class person { ... - std::auto_ptr<std::vector<std::string> > aliases_; + std::unique_ptr<std::vector<std::string>> aliases_; }; </pre> @@ -8546,7 +8559,7 @@ class employee: public person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; }; // Concrete permanent_employee class. Note that it doesn't define @@ -8655,7 +8668,7 @@ employee e; person& r1 (p); person& r2 (e); -auto_ptr<person> p1 (new employee); +unique_ptr<person> p1 (new employee); </pre> <p>In the above example, the <code>r1</code> reference's both static @@ -8692,7 +8705,7 @@ class person ~person () = 0; // Automatically abstract. #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; @@ -8765,7 +8778,7 @@ class contractor: public person example:</p> <pre class="cxx"> -unsigned long id1, id2; +unsigned long long id1, id2; // Persist. // @@ -8793,8 +8806,8 @@ unsigned long id1, id2; // Query. // { - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; transaction t (db.begin ()); @@ -8853,8 +8866,8 @@ unsigned long id1, id2; instantiating the object. For example:</p> <pre class="cxx"> -typedef odb::query<person> query; -typedef odb::result<person> result; +using query = odb::query<person>; +using result = odb::result<person>; transaction t (db.begin ()); @@ -8944,7 +8957,7 @@ CREATE TABLE contractor ( difference:</p> <pre class="cxx"> -unsigned long id; +unsigned long long id; { employee e (...); @@ -9066,7 +9079,7 @@ struct contractor_manager be used in the query condition. For example:</p> <pre class="cxx"> -typedef odb::query<employee> query; +using query = odb::query<employee>; transaction t (db.begin ()); db.erase_query<employee> (query::permanent); // Ok. @@ -9142,7 +9155,7 @@ class person transaction t (db.begin ()); -auto_ptr<person> p (db.load<person> (...)); // Keys are not loaded. +unique_ptr<person> p (db.load<person> (...)); // Keys are not loaded. if (need_keys) { @@ -9371,7 +9384,7 @@ private: ... }; -auto_ptr<person> p (db.load<person> (...)); +unique_ptr<person> p (db.load<person> (...)); section s (p->keys ()); db.load (*p, s); // Throw section_not_in_object, copy. @@ -9408,7 +9421,7 @@ private: ... }; -auto_ptr<person> p (db.load<person> (...)); +unique_ptr<person> p (db.load<person> (...)); section& s (p->keys ()); db.load (*p, s); // Ok, reference. @@ -9462,7 +9475,7 @@ person p ("John", "Doe"); // Section state is undefined (transient). db.persist (p); // Section state: loaded, unchanged. -auto_ptr<person> l ( +unique_ptr<person> l ( db.load<person> (...)); // Section state: unloaded, unchanged. db.update (*l); // Section not updated since not loaded. @@ -9496,7 +9509,7 @@ class person { ... - typedef std::array<char, 1024> key_type; + using key_type = std::array<char, 1024>; const key_type& public_key () const {return public_key_;} @@ -9543,7 +9556,7 @@ private: the previous example):</p> <pre class="cxx"> -auto_ptr<person> p; +unique_ptr<person> p; try { @@ -9601,7 +9614,7 @@ class employee: public person transaction t (db.begin ()); -auto_ptr<person> p (db.load<person> (...)); // Person or employee. +unique_ptr<person> p (db.load<person> (...)); // Person or employee. db.load (*p, p->print_); // Load data members needed for print. p->print (); @@ -9645,7 +9658,7 @@ class manager: public employee ... }; -auto_ptr<manager> m (db.load<manager> (...)); +unique_ptr<manager> m (db.load<manager> (...)); person& p (*m); employee& e (*m); @@ -9681,7 +9694,7 @@ class person std::string bio_; }; -auto_ptr<person> p; +unique_ptr<person> p; { transaction t (db.begin ()); @@ -9773,7 +9786,7 @@ class employee transaction t (db.begin ()); -auto_ptr<employee> e (db.load<employee> (...)); // employer_ is NULL. +unique_ptr<employee> e (db.load<employee> (...)); // employer_ is NULL. db.load (*e, e->extras_); // employer_ contains valid employer id. @@ -9805,7 +9818,7 @@ class person transaction t (db.begin ()); -auto_ptr<person> p (db.load<person> (...)); +unique_ptr<person> p (db.load<person> (...)); db.load (*p, p->extras_); p->nicknames_.push_back ("JD"); @@ -9866,7 +9879,7 @@ class employer ... #pragma db id - unsigned long id_; + unsigned long long id_; std::string name_; }; @@ -9877,7 +9890,7 @@ class employee ... #pragma db id - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; @@ -9939,8 +9952,8 @@ struct employee_name employees that are younger than 31:</p> <pre class="cxx"> -typedef odb::query<employee_name> query; -typedef odb::result<employee_name> result; +using query = odb::query<employee_name>; +using result = odb::result<employee_name>; transaction t (db.begin ()); @@ -10219,7 +10232,7 @@ struct employee_count querying the database for an object. For example:</p> <pre class="cxx"> -typedef odb::query<employee_count> query; +using query = odb::query<employee_count>; transaction t (db.begin ()); @@ -10269,8 +10282,8 @@ struct employee_employer For example:</p> <pre class="cxx"> -typedef odb::result<employee_employer> result; -typedef odb::query<employee_employer> query; +using result = odb::result<employee_employer>; +using query = odb::query<employee_employer>; transaction t (db.begin ()); @@ -10302,8 +10315,8 @@ struct employee_country country of residence and nationality:</p> <pre class="cxx"> -typedef odb::query<employee_country> query; -typedef odb::result<employee_country> result; +using query = odb::query<employee_country>; +using result = odb::result<employee_country>; transaction t (db.begin ()); @@ -10321,8 +10334,8 @@ t.commit (); the following query is invalid:</p> <pre class="cxx"> -typedef odb::query<employee_name> query; -typedef odb::result<employee_name> result; +using query = odb::query<employee_name>; +using result = odb::result<employee_name>; transaction t (db.begin ()); @@ -10387,7 +10400,7 @@ struct employee_employer point to the loaded objects. For example:</p> <pre class="cxx"> -typedef odb::query<employee_employer> query; +using query = odb::query<employee_employer>; transaction t (db.begin ()); @@ -10419,7 +10432,7 @@ struct employer_view employ seniors:</p> <pre class="cxx"> -typedef odb::query<employer_view> query; +using query = odb::query<employer_view>; db.query<employer_view> (query::employee::age > 65) </pre> @@ -10526,7 +10539,7 @@ struct employee_employer of our transaction that uses the <code>employee_employer</code> view:</p> <pre class="cxx"> -typedef odb::query<employee_employer> query; +using query = odb::query<employee_employer>; transaction t (db.begin ()); odb::session s; @@ -10586,7 +10599,7 @@ t.commit (); object(country = res: employee::residence_) transient struct employee_res_country { - typedef country* country_ptr; + using country_ptr = country*; #pragma db member(res_) virtual(country_ptr) get(&this.res) \ set(this.res_null = ((?) == nullptr)) @@ -10617,7 +10630,7 @@ struct employee_res_country object(country = res: employee::residence_) transient struct employee_res_country { - typedef country* country_ptr; + using country_ptr = country*; #pragma db member(res_) virtual(country_ptr) get(&this.res) set() @@ -10648,7 +10661,7 @@ struct employee_country <p>And here is how we can use this view:</p> <pre class="cxx"> -typedef odb::result<employee_country> result; +using result = odb::result<employee_country>; transaction t (db.begin ()); @@ -10762,7 +10775,7 @@ struct view struct employee_vacation { #pragma db column("employee_id") type("INTEGER") - unsigned long employee_id; + unsigned long long employee_id; #pragma db column("vacation_days") type("INTEGER") unsigned short vacation_days; @@ -10873,7 +10886,7 @@ CREATE TABLE employee_health( struct employee_leave { #pragma db column("extra.employee_id") type("INTEGER") - unsigned long employee_id; + unsigned long long employee_id; #pragma db column("vacation_days") type("INTEGER") unsigned short vacation_days; @@ -10888,8 +10901,8 @@ struct employee_leave For example:</p> <pre class="cxx"> -typedef odb::query<employee_leave> query; -typedef odb::result<employee_leave> result; +using query = odb::query<employee_leave>; +using result = odb::result<employee_leave>; transaction t (db.begin ()); @@ -10932,8 +10945,8 @@ struct employee_vacation involve table columns. For example:</p> <pre class="cxx"> -typedef odb::query<employee_vacation> query; -typedef odb::result<employee_vacation> result; +using query = odb::query<employee_vacation>; +using result = odb::result<employee_vacation>; transaction t (db.begin ()); @@ -11126,7 +11139,7 @@ struct employer_info struct employee_vacation { #pragma db type("INTEGER") - unsigned long employee_id; + unsigned long long employee_id; #pragma db type("INTEGER") unsigned short vacation_days; @@ -11223,8 +11236,8 @@ struct sequence_value <p>Given this view, we can perform the following queries:</p> <pre class="cxx"> -typedef odb::query<sequence_value> query; -typedef odb::result<sequence_value> result; +using query = odb::query<sequence_value>; +using result = odb::result<sequence_value>; string seq_name = ... @@ -11529,7 +11542,7 @@ shared_ptr<person> p (new person ("John", "Doe")); session s; transaction t (db.begin ()); -unsigned long id (db.persist (p)); // p is cached in s. +unsigned long long id (db.persist (p)); // p is cached in s. shared_ptr<person> p1 (db.load<person> (id)); // p1 same as p. t.commit (); @@ -11568,7 +11581,7 @@ void save (database& db, shared_ptr<const person> p) session s; shared_ptr<const person> p1 (new const person ("John", "Doe")); -unsigned long id1 (save (db, p1)); // p1 is cached in s as non-const. +unsigned long long id1 (save (db, p1)); // p1 is cached in s as non-const. { transaction t (db.begin ()); @@ -11578,7 +11591,7 @@ unsigned long id1 (save (db, p1)); // p1 is cached in s as non-const. } shared_ptr<const person> p2 (new person ("Jane", "Doe")); -unsigned long id2 (save (db, p2)); // p2 is cached in s as non-const. +unsigned long long id2 (save (db, p2)); // p2 is cached in s as non-const. { transaction t (db.begin ()); @@ -11751,7 +11764,7 @@ public: updating the object in another database transaction. For example:</p> <pre class="cxx"> -unsigned long id = ...; +unsigned long long id = ...; person p; { @@ -11811,7 +11824,7 @@ class person ... #pragma db version - unsigned long version_; + unsigned long long version_; }; </pre> @@ -11834,7 +11847,7 @@ class person ... #pragma db version - const unsigned long version_; + const unsigned long long version_; }; </pre> @@ -11857,7 +11870,7 @@ class person transaction using the second recovery option:</p> <pre class="cxx"> -unsigned long id = ...; +unsigned long long id = ...; person p; { @@ -11909,7 +11922,7 @@ p.age (age); application transaction:</p> <pre class="cxx"> -unsigned long id = ...; +unsigned long long id = ...; person p; { @@ -11938,7 +11951,7 @@ if (answer == "yes") using optimistic concurrency:</p> <pre class="cxx"> -unsigned long id = ...; +unsigned long long id = ...; person p; { @@ -12274,7 +12287,7 @@ class person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string last_; @@ -12321,7 +12334,7 @@ class person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string first_; std::string middle_; @@ -12746,7 +12759,7 @@ CREATE TABLE "schema_version" ( <pre class="cxx"> namespace odb { - typedef unsigned long long schema_version; + using schema_version = unsigned long long; struct LIBODB_EXPORT schema_version_migration { @@ -13231,7 +13244,7 @@ namespace odb schema_version = 0, const std::string& name = ""); - typedef void data_migration_function_type (database&); + using data_migration_function_type = void (database&); // Common (for all the databases) data migration, C++98/03 version: // @@ -13615,7 +13628,7 @@ class person static void migrate_gender (odb::database& db) { - typedef odb::query<person> query; + using query = odb::query<person>; for (person& p: db.query<person> (query::gender.is_null ())) { @@ -13699,7 +13712,7 @@ class person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; #pragma db deleted(4) std::string first_; @@ -13762,7 +13775,7 @@ private: friend class odb::access; #pragma db id auto - unsigned long id_; + unsigned long long id_; #pragma db deleted(4) std::string first_; @@ -13837,7 +13850,7 @@ class person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; #pragma db added(4) std::string name_; @@ -13907,7 +13920,7 @@ class employee ... #pragma db id auto - unsigned long id_; + unsigned long long id_; std::string name_; gender gender_; @@ -14135,7 +14148,7 @@ class person ... private: #pragma db member id - unsigned long id_; + unsigned long long id_; ... }; </pre> @@ -14149,7 +14162,7 @@ private: <pre class="cxx"> #pragma db id - unsigned long id_; + unsigned long long id_; </pre> <p>Note also that if the C++ declaration immediately following a @@ -14158,7 +14171,7 @@ private: <pre class="cxx"> #pragma db object // Error: expected class instead of data member. - unsigned long id_; + unsigned long long id_; </pre> <p>While keeping the C++ declarations and database declarations close @@ -14174,7 +14187,7 @@ class person { ... private: - unsigned long id_; + unsigned long long id_; ... }; @@ -14194,7 +14207,7 @@ namespace db { ... private: - unsigned long id_; + unsigned long long id_; ... }; } @@ -14412,7 +14425,7 @@ class person class. For example:</p> <pre class="cxx"> -#pragma db object pointer(std::tr1::shared_ptr<person>) +#pragma db object pointer(std::shared_ptr<person>) class person { ... @@ -14428,7 +14441,7 @@ class person equivalent to the one above:</p> <pre class="cxx"> -#pragma db object pointer(std::tr1::shared_ptr) +#pragma db object pointer(std::shared_ptr) class person { ... @@ -14532,7 +14545,7 @@ class person ... #pragma db version - unsigned long version_; + unsigned long long version_; }; </pre> @@ -15434,9 +15447,7 @@ class person columns that allow <code>NULL</code> values. For example:</p> <pre class="cxx"> -using std::tr1::shared_ptr; - -typedef shared_ptr<std::string> string_ptr; +using string_ptr = std::shared_ptr<std::string>; #pragma db value(string_ptr) type("TEXT") null #pragma db object @@ -15447,7 +15458,7 @@ class person string_ptr name_; // Mapped to TEXT NULL. }; -typedef shared_ptr<person> person_ptr; +using person_ptr = std::shared_ptr<person>; #pragma db value(person_ptr) not_null </pre> @@ -15644,7 +15655,7 @@ class object not be the same as the order in which they were stored. For example:</p> <pre class="cxx"> -typedef std::vector<std::string> names; +using names = std::vector<std::string>; #pragma db value(names) unordered </pre> @@ -15662,7 +15673,7 @@ typedef std::vector<std::string> names; database type is expected to be an integer type. For example:</p> <pre class="cxx"> -typedef std::vector<std::string> names; +using names = std::vector<std::string>; #pragma db value(names) index_type("SMALLINT UNSIGNED") </pre> @@ -15676,7 +15687,7 @@ typedef std::vector<std::string> names; example:</p> <pre class="cxx"> -typedef std::map<unsigned short, float> age_weight_map; +using age_weight_map = std::map<unsigned short, float>; #pragma db value(age_weight_map) key_type("INT UNSIGNED") </pre> @@ -15690,7 +15701,7 @@ typedef std::map<unsigned short, float> age_weight_map; example:</p> <pre class="cxx"> -typedef std::vector<std::string> names; +using names = std::vector<std::string>; #pragma db value(names) value_type("VARCHAR(255)") </pre> @@ -15711,15 +15722,13 @@ typedef std::vector<std::string> names; For example:</p> <pre class="cxx"> -using std::tr1::shared_ptr; - #pragma db object class account { ... }; -typedef std::vector<shared_ptr<account> > accounts; +using accounts = std::vector<std::shared_ptr<account>>; #pragma db value(accounts) value_not_null </pre> @@ -15735,7 +15744,7 @@ typedef std::vector<shared_ptr<account> > accounts; id column. For example:</p> <pre class="cxx"> -typedef std::vector<std::string> nicknames; +using nicknames = std::vector<std::string>; #pragma db value(nicknames) id_options("COLLATE binary") </pre> @@ -15752,7 +15761,7 @@ typedef std::vector<std::string> nicknames; index column. For example:</p> <pre class="cxx"> -typedef std::vector<std::string> nicknames; +using nicknames = std::vector<std::string>; #pragma db value(nicknames) index_options("ZEROFILL") </pre> @@ -15769,7 +15778,7 @@ typedef std::vector<std::string> nicknames; key column. For example:</p> <pre class="cxx"> -typedef std::map<std::string, std::string> properties; +using properties = std::map<std::string, std::string>; #pragma db value(properties) key_options("COLLATE binary") </pre> @@ -15786,7 +15795,7 @@ typedef std::map<std::string, std::string> properties; value column. For example:</p> <pre class="cxx"> -typedef std::set<std::string> nicknames; +using nicknames = std::set<std::string>; #pragma db value(nicknames) value_options("COLLATE binary") </pre> @@ -15803,7 +15812,7 @@ typedef std::set<std::string> nicknames; container's table. For example:</p> <pre class="cxx"> -typedef std::vector<std::string> names; +using names = std::vector<std::string>; #pragma db value(names) id_column("id") </pre> @@ -15817,7 +15826,7 @@ typedef std::vector<std::string> names; ordered container's table. For example:</p> <pre class="cxx"> -typedef std::vector<std::string> names; +using names = std::vector<std::string>; #pragma db value(names) index_column("name_number") </pre> @@ -15831,7 +15840,7 @@ typedef std::vector<std::string> names; container's table. For example:</p> <pre class="cxx"> -typedef std::map<unsigned short, float> age_weight_map; +using age_weight_map = std::map<unsigned short, float>; #pragma db value(age_weight_map) key_column("age") </pre> @@ -15845,7 +15854,7 @@ typedef std::map<unsigned short, float> age_weight_map; container's table. For example:</p> <pre class="cxx"> -typedef std::map<unsigned short, float> age_weight_map; +using age_weight_map = std::map<unsigned short, float>; #pragma db value(age_weight_map) value_column("weight") </pre> @@ -16086,6 +16095,12 @@ typedef std::map<unsigned short, float> age_weight_map; <td><a href="#14.4.36">14.4.36</a></td> </tr> + <tr> + <td><code>points_to</code></td> + <td>establish relationship without object pointer</td> + <td><a href="#14.4.37">14.4.37</a></td> + </tr> + </table> <p>Many of the member specifiers have corresponding value type @@ -16137,16 +16152,15 @@ class person ... #pragma db id auto - unsigned long id_; + unsigned long long id_; }; </pre> - <p>Note that automatically-assigned object ids are not reused. - If you have a high object turnover (that is, objects are routinely - made persistent and then erased), then care must be taken not to - run out of object ids. In such situations, using - <code>unsigned long long</code> as the identifier type - is a safe choice.</p> + <p>Note that automatically-assigned object ids are not reused. If you have + a high object turnover (that is, objects are routinely made persistent + and then erased), then care must be taken not to run out of object + ids. In such situations, using a 64-bit integer as the identifier type is + a safe choice.</p> <p>For additional information on the automatic identifier assignment, refer to <a href="#3.8">Section 3.8, "Making Objects Persistent"</a>.</p> @@ -16308,21 +16322,29 @@ private: single or multiple (separated by semicolon) C++ statements with the effect of setting the new member value.</p> - <p>There are two special placeholders that are recognized by the + <p>There are three special placeholders that are recognized by the ODB compiler in accessor and modifier expressions. The first is the <code>this</code> keyword which denotes a reference (note: not a pointer) to the persistent object. In accessor expressions this reference is <code>const</code> while in modifier expressions it is non-<code>const</code>. If an expression does not contain the <code>this</code> placeholder, - then the ODB compiler automatically prefixes it with <code>this.</code> - sequence.</p> + then the ODB compiler automatically prefixes it with the + <code>this.</code> sequence.</p> <p>The second placeholder, the <code>(?)</code> sequence, is used to denote the new value in by-value modifier expressions. The ODB compiler replaces the question mark with the variable name, - keeping the surrounding parenthesis. The following example shows - a few more interesting accessor and modifier expressions:</p> + keeping the surrounding parenthesis.</p> + + <p>The third placeholder, the <code>(!)</code> sequence, is used to denote + the database instance in the modifier expressions. The ODB compiler + replaces the exclamation mark with the reference to the database, + keeping the surrounding parenthesis. The database instance can, for + example, be used to load an object pointer.</p> + + <p>The following example shows a few more interesting accessor and + modifier expressions:</p> <pre class="cxx"> #pragma db value @@ -16461,8 +16483,6 @@ private: to columns that allow <code>NULL</code> values. For example:</p> <pre class="cxx"> -using std::tr1::shared_ptr; - #pragma db object class person { @@ -16478,7 +16498,7 @@ class account ... #pragma db not_null - shared_ptr<person> holder_; + std::shared_ptr<person> holder_; }; </pre> @@ -16682,7 +16702,7 @@ class person ... #pragma db id column("person_id") - unsigned long id_; + unsigned long long id_; }; </pre> @@ -16800,7 +16820,7 @@ class person { ... - const std::auto_ptr<const date> born_; + const std::unique_ptr<const date> born_; }; </pre> @@ -16896,6 +16916,34 @@ class person #pragma db member(person::name) virtual(std::string) access(name_) </pre> + <p>The order of data members determines the order of columns in the + resulting table. The order of virtual data members in relation to other + data members (virtual or not) is the order of declaration, with virtual + data members declared outside of the class coming last. This order, + however, can be adjusted with the <code>before</code> + and <code>after</code> specifiers. One of these specifiers without a + parameter places the virtual member at the beginning or at the end of the + members list, respectively. Alternatively, we can specify the member + (virtual or not) before/after which this virtual member should be + placed. For example:</p> + + <pre class="cxx"> +#pragma db object +class person +{ + ... + + #pragma db id auto + unsigned long long id_; + + #pragma db member(first) virtual(std::string) before + #pragma db member(last) virtual(std::string) after(first) +}; + </pre> + + <p>The order of columns in the resulting table will be: <code>first</code>, + <code>last</code>, <code>id</code>.</p> + <p>While in the above examples using virtual data members doesn't seem to yield any benefits, this mechanism can be useful in a number of situations. As one example, consider the need to @@ -17060,26 +17108,23 @@ private: member name in the referenced object. For example:</p> <pre class="cxx"> -using std::tr1::shared_ptr; -using std::tr1::weak_ptr; - class person; -#pragma db object pointer(shared_ptr) +#pragma db object pointer(std::shared_ptr) class employer { ... - std::vector<shared_ptr<person> > employees_; + std::vector<std::shared_ptr<person>> employees_; }; -#pragma db object pointer(shared_ptr) +#pragma db object pointer(std::shared_ptr) class person { ... #pragma db inverse(employee_) - weak_ptr<employer> employer_; + std::weak_ptr<employer> employer_; }; </pre> @@ -17117,7 +17162,7 @@ class employer ... #pragma db id auto - unsigned long id_; + unsigned long long id_; }; #pragma db object @@ -17129,7 +17174,7 @@ class person employer* employer_; }; -unsigned long id; +unsigned long long id; { employer e; @@ -17234,16 +17279,15 @@ class person ... #pragma db version - unsigned long version_; + unsigned long long version_; }; </pre> - <p>A version member must be of an integral C++ type and must map to - an integer or similar database type. Note also that object versions - are not reused. If you have a high update frequency, then care must - be taken not to run out of versions. In such situations, using - <code>unsigned long long</code> as the version type is a safe - choice.</p> + <p>A version member must be of an integral C++ type and must map to an + integer or similar database type. Note also that object versions are not + reused. If you have a high update frequency, then care must be taken not + to run out of versions. In such situations, using a 64-bit integer as the + version type is a safe choice.</p> <p>For a more detailed discussion of optimistic concurrency, refer to <a href="#12">Chapter 12, "Optimistic Concurrency"</a>.</p> @@ -17469,8 +17513,6 @@ class person For example:</p> <pre class="cxx"> -using std::tr1::shared_ptr; - #pragma db object class person { @@ -17483,7 +17525,7 @@ class account ... #pragma db value_not_null - std::vector<shared_ptr<person> > holders_; + std::vector<std::shared_ptr<person>> holders_; }; </pre> @@ -17674,6 +17716,32 @@ class person <p>If the column name is not specified, then <code>value</code> is used by default.</p> + <h3><a name="14.4.37">14.4.37 <code>points_to</code></a></h3> + + <p>The <code>points_to</code> specifier allows the establishment of + object relationships without using object pointers. For example:</p> + +<pre class="cxx"> + +#pragma db object +class employer +{ + ... + + #pragma db id + std::string id_; +}; + +#pragma db object +class person +{ + ... + + #pragma db points_to(employer) + std::string employer_; +}; + </pre> + <h2><a name="14.5">14.5 Namespace Pragmas</a></h2> <p>A pragma with the <code>namespace</code> qualifier describes a @@ -17741,7 +17809,7 @@ namespace test example:</p> <pre class="cxx"> -#pragma db namespace pointer(std::tr1::shared_ptr) +#pragma db namespace pointer(std::shared_ptr) namespace accounting { #pragma db object @@ -18133,7 +18201,104 @@ class object <h2><a name="14.8">14.8 Database Type Mapping Pragmas</a></h2> - <p>A pragma with the <code>map</code> qualifier describes a + <p>A pragma with the <code>map</code> qualifier describes a mapping between + either two C++ types (<a href="#14.8.1">Section 14.8.1, "C++ Type Mapping + Pragmas"</a>) or two database types (<a href="#14.8.2">Section 14.8.2, + "Database Type Mapping Pragmas"</a>).</p> + + <h3><a name="14.8.1">14.8.1 C++ Type Mapping Pragmas</a></h3> + + <p>A pragma with the <code>map</code> qualifier can describe a mapping + between two C++ types. For each database system ODB provides built-in + support for mapping a standard set of C++ types, such as integers, + strings, binary, etc. However, many codebases may use custom versions of + corresponding (or similar) C++ types. While it is possible to add support + for such custom types by providing a suitable specialization of the + <code>value_traits</code> class template, it is often simpler to define + their mapping in terms of one of the already supported types by + specifying the conversion between the two types. This mechanism can also + be used to redefine the mapping for one of the standard types. For + example, we could map <code>bool</code> to <code>std::string</code> in + order to save boolean values as string literals. This mechanism can also + be used with composite value types.</p> + + <p>The <code>map</code> pragma for C++ types has the following format:</p> + +<pre class="cxx"> +#pragma db map type(<name>) \ + as(<name>) \ + [to(<expr>)] \ + [from(<expr>)] +</pre> + + <p>The <code>type</code> clause specifies the name of the C++ type + that we are mapping. We will refer to it as the <em>mapped type</em> + from now on.</p> + + <p>The <code>as</code> clause specifies the name of the C++ type that we are + mapping the mapped type to. We will refer to it as the <em>interface + type</em> from now on.</p> + + <p>The optional <code>to</code> and <code>from</code> clauses specify the + C++ conversion expressions between the mapped type and the + interface type. The <code>to</code> expression converts from the + interface type to the mapped type and <code>from</code> converts + in the other direction. If no explicit conversion is required for + either direction, then the corresponding clause can be omitted. + + If the conversion expressions are specified, then they must contain the + special <code>(?)</code> placeholder which will be replaced with the + actual value to be converted.</p> + + <p>As an example, suppose we have the <code>path</code> type which + represents a filesystem path and which we wish to store in the + database. Suppose also that it has a constructor that allows implicit + conversion of <code>std::string</code> to <code>path</code> as well as + the <code>string()</code> member function which returns the + <code>std::string</code> representation of <code>path</code>. This is + how we can map <code>path</code> to <code>std::string</code> to be able + to store it in the database:</p> + +<pre class="cxx"> +#pragma db map type(path) \ + as(std::string) \ + from((?).string ()) +</pre> + + <p>Notice that we could omit the <code>to</code> expression because + <code>std::string</code> can be implicitly converted to + <code>path</code>. In this case the implied expression is equivalent + to <code>to((?))</code>.</p> + + <p>As a more elaborate example, the following <code>map</code> pragma maps + the standard <code>chrono</code> <code>time_point</code> type (that is, a + timestamp) as <code>uint64</code> with the stored values representing the + number of nanoseconds since the UNIX epoch:</p> + +<pre class="cxx"> +#pragma db map \ + type(std::chrono::system_clock::time_point) \ + as(std::uint64_t) \ + to(std::chrono::duration_cast<std::chrono::nanoseconds> ( \ + (?).time_since_epoch ()).count ()) \ + from(std::chrono::system_clock::time_point ( \ + std::chrono::duration_cast<std::chrono::system_clock::duration> ( \ + std::chrono::nanoseconds (?)))) +</pre> + + <p>And the following example shows how to redefine the mapping for one of + the standard types:</p> + +<pre class="cxx"> +#pragma db map type(bool) \ + as(std::string) \ + to((?) ? "true" : "false") \ + from((?) == "true") +</pre> + + <h3><a name="14.8.2">14.8.2 Database Type Mapping Pragmas</a></h3> + + <p>A pragma with the <code>map</code> qualifier can describe a mapping between two database types. For each database system ODB provides built-in support for a core set of database types, such as integers, strings, binary, etc. However, many database @@ -18146,10 +18311,14 @@ class object and thus establish a mapping between an extended database type and its C++ equivalent.</p> - <p>The <code>map</code> pragma has the following format:</p> + <p>The <code>map</code> pragma for database types has the following + format:</p> <pre class="cxx"> -#pragma db map type("regex") as("subst") [to("subst")] [from("subst")] +#pragma db map type("<regex>") \ + as("<subst>") \ + [to("<subst>")] \ + [from("<subst>")] </pre> <p>The <code>type</code> clause specifies the name of the database type @@ -18230,9 +18399,9 @@ namespace odb class value_traits<std::vector<int>, id_string> { public: - typedef std::vector<int> value_type; - typedef value_type query_type; - typedef details::buffer image_type; + using value_type = std::vector<int>; + using query_type = value_type; + using image_type = details::buffer; static void set_value (value_type& v, @@ -18313,7 +18482,7 @@ class object write:</p> <pre class="cxx"> -typedef std::vector<int> int_vector; +using int_vector = std::vector<int>; #pragma db value(int_vector) type("INTEGER[]") #pragma db object @@ -18359,7 +18528,7 @@ class person ... PRAGMA_DB(id) - unsigned long id_; + unsigned long long id_; }; </pre> @@ -18373,7 +18542,7 @@ class person { ... - unsigned long id_; + unsigned long long id_; }; #ifdef ODB_COMPILER @@ -18425,7 +18594,7 @@ class person ... #pragma db id - unsigned long id_; + unsigned long long id_; }; #pragma warning (pop) @@ -18491,7 +18660,7 @@ class person ... #pragma db id - unsigned long id_; + unsigned long long id_; }; #pragma clang diagnostic pop @@ -18531,7 +18700,7 @@ namespace odb static const unsigned short event_rollback = 0x02; static const unsigned short event_all = event_commit | event_rollback; - typedef void (*callback_type) ( + using callback_type = void (*) ( unsigned short event, void* key, unsigned long long data); void @@ -18683,7 +18852,7 @@ class person T last_; }; -typedef person<std::string> std_person; +using std_person = person<std::string>; #pragma db object(std_person) #pragma db member(std_person::last_) id @@ -18692,13 +18861,13 @@ typedef person<std::string> std_person; <p>Note that the database support code for such a persistent object is generated when compiling the header containing the <code>db object</code> pragma and not the header containing - the template definition or the <code>typedef</code> name. This + the template definition or the <code>using</code> alias. This allows us to use templates defined in other files, for example:</p> <pre class="cxx"> #include <utility> // std::pair -typedef std::pair<unsigned int, std::string> person; +using person = std::pair<unsigned int, std::string>; #pragma db object(person) #pragma db member(person::first) id auto column("id") #pragma db member(person::second) column("name") @@ -18733,7 +18902,7 @@ class base_common ... #pragma db id auto - unsigned long id; + unsigned long long id; }; template <typename T> @@ -18744,7 +18913,7 @@ class base: public base_common T value; }; -typedef base<std::string> string_base; +using string_base = base<std::string>; #pragma db object(string_base) abstract #pragma db object @@ -18802,7 +18971,7 @@ class person ... #pragma db id auto - unsigned long id; + unsigned long long id; }; </pre> @@ -18931,7 +19100,7 @@ struct person_entry ... }; -typedef std::vector<person_entry> people; +using people = std::vector<person_entry>; void persist (odb::database& db, people& p) @@ -18956,7 +19125,7 @@ persist (odb::database& db, people& p) have to specify the object type explicitly, for example:</p> <pre class="cxx"> -std::vector<unsigned long> ids {1, 2}; +std::vector<unsigned long long> ids {1, 2}; db.erase<person> (ids.begin (), ids.end ()); </pre> @@ -19004,10 +19173,10 @@ struct multiple_exceptions: odb::exception // Iteration. // - typedef std::set<value_type> set_type; + using set_type = std::set<value_type>; - typedef set_type::const_iterator iterator; - typedef set_type::const_iterator const_iterator; + using iterator = set_type::const_iterator; + using const_iterator = set_type::const_iterator; iterator begin () const; @@ -19399,8 +19568,8 @@ odb --odb-file-suffix common:-odb-common ... odb::database& db = ... -typedef odb::query<person> query; -typedef odb::result<person> result; +using query = odb::query<person>; +using result = odb::result<person>; odb::transaction t (db.begin ()); result r (db.query<person> (query::age < 30)); @@ -19416,8 +19585,8 @@ t.commit (); odb::sqlite::database& db = ... -typedef odb::sqlite::query<person> query; -typedef odb::result<person> result; // odb:: not odb::sqlite:: +using query = odb::sqlite::query<person>; +using result = odb::result<person>; // odb:: not odb::sqlite:: odb::sqlite::transaction t (db.begin ()); result r (db.query<person> (query::age < 30)); @@ -19458,8 +19627,8 @@ odb::database& db = ... { using namespace odb::core; - typedef query<person> person_query; - typedef result<person> person_result; + using person_query = query<person>; + using person_result = result<person>; transaction t (db.begin ()); person_result r (db.query<person> (person_query::age < 30)); @@ -19483,8 +19652,8 @@ odb::sqlite::database& db = ... { using namespace odb::sqlite::core; - typedef query<person> person_query; - typedef result<person> person_result; + using person_query = query<person>; + using person_result = result<person>; transaction t (db.begin ()); person_result r (db.query<person> (person_query::age < 30)); @@ -19508,9 +19677,9 @@ namespace sl = odb::sqlite; pg::database& pg_db = ... sl::database& sl_db = ... -typedef pg::query<person> pg_query; -typedef sl::query<person> sl_query; -typedef odb::result<person> result; +using pg_query = pg::query<person>; +using sl_query = sl::query<person>; +using result = odb::result<person>; // First check the local cache. // @@ -19651,8 +19820,8 @@ if (p == 0) void print (odb::database& db, unsigned short age, unsigned long limit) { - typedef odb::query<person> query; - typedef odb::result<person> result; + using query = odb::query<person>; + using result = odb::result<person>; odb::transaction t (db.begin ()); @@ -19665,7 +19834,7 @@ print (odb::database& db, unsigned short age, unsigned long limit) // add the LIMIT clause to the query. // namespace pg = odb::pgsql; - typedef pg::query<person> pg_query; + using pg_query = pg::query<person>; pg::database& pg_db (static_cast<pg::database&> (db)); pg_query pg_q (pg_query (q) + "LIMIT" + pg_query::_val (limit)); @@ -20168,7 +20337,7 @@ class object <p>Alternatively, this can be done on the per-type basis, for example:</p> <pre class="cxx"> -typedef std::vector<char> buffer; +using buffer = std::vector<char>; #pragma db value(buffer) type("BLOB") #pragma db object @@ -20195,6 +20364,23 @@ db.query<object> ("uuid = " + query::_val<odb::mysql::id_blob> (u)); db.query<object> (query::uuid == query::_ref (u)); </pre> + + <h3><a name="17.1.3">17.1.3 Mixed Automatic/0 Object Id Assignment</a></h3> + + <p>In MySQL an automatic object id can also be set manually to + <code>0</code>. For example:</p> + + <pre class="cxx"> + #pragma db id auto + odb::nullable<int64_t> id; + </pre> + + <p>Then, when used with the <code>NO_AUTO_VALUE_ON_ZERO</code> mode, set the + id member to <code>NULL</code> to get auto-assignment or to <code>0</code> + to use <code>0</code> as the id. This functionality is normally used to + assign the special <code>0</code> id to a special object.</p> + + <h2><a name="17.2">17.2 MySQL Database Class</a></h2> <p>The MySQL <code>database</code> class has the following @@ -20396,7 +20582,7 @@ namespace odb handle (); }; - typedef details::shared_ptr<connection> connection_ptr; + using connection_ptr = details::shared_ptr<connection>; } } </pre> @@ -20487,7 +20673,7 @@ namespace odb pooled_connection (database_type&, MYSQL*); }; - typedef details::shared_ptr<pooled_connection> pooled_connection_ptr; + using pooled_connection_ptr = details::shared_ptr<pooled_connection>; virtual pooled_connection_ptr create (); @@ -20561,10 +20747,10 @@ namespace odb int main (int argc, char* argv[]) { - auto_ptr<odb::mysql::connection_factory> f ( + unique_ptr<odb::mysql::connection_factory> f ( new odb::mysql::connection_pool_factory (20)); - auto_ptr<odb::database> db ( + unique_ptr<odb::database> db ( new mysql::database (argc, argv, false, 0, f)); } </pre> @@ -20704,8 +20890,8 @@ struct person_range print the list of people in a specific age range:</p> <pre class="cxx"> -typedef odb::query<person_range> query; -typedef odb::result<person_range> result; +using query = odb::query<person_range>; +using result = odb::result<person_range>; transaction t (db.begin ()); @@ -20732,16 +20918,15 @@ t.commit (); <p>In MySQL, a stored procedure can produce multiple results. For example, if a stored procedure executes several - <code>SELECT</code> statements, then the result of calling such - a procedure consists of two row sets, one for each <code>SELECT</code> - statement. Additionally, if the procedure has any <code>OUT</code> - or <code>INOUT</code> parameters, then their values are returned as - an additional special row set containing only a single row. - Because such multiple row sets can contain varying number - and type of columns, they cannot be all extracted into a - single view. As a result, an ODB view will only extract the - data from the first row set and ignore all the subsequent - ones.</p> + <code>SELECT</code> statements, then the result of calling such a + procedure consists of multiple row sets, one for + each <code>SELECT</code> statement. Additionally, if the procedure has + any <code>OUT</code> or <code>INOUT</code> parameters, then their values + are returned as an additional special row set containing only a single + row. Because such multiple row sets can contain varying number and type + of columns, they cannot be all extracted into a single view. As a + result, an ODB view will only extract the data from the first row set + and ignore all the subsequent ones.</p> <p>In particular, this means that we can use an ODB view to extract the values of the <code>OUT</code> and <code>INOUT</code> @@ -20767,7 +20952,7 @@ struct person_min_max_age </pre> <pre class="cxx"> -typedef odb::query<person_min_max_age> query; +using query = odb::query<person_min_max_age>; transaction t (db.begin ()); @@ -21010,7 +21195,7 @@ class object <p>Alternatively, this can be done on the per-type basis, for example:</p> <pre class="cxx"> -typedef std::array<char, 128> name_type; +using name_type = std::array<char, 128>; #pragma db value(name_type) type("TEXT") #pragma db object @@ -21061,7 +21246,7 @@ class object <p>Alternatively, this can be done on the per-type basis, for example:</p> <pre class="cxx"> -typedef std::vector<char> buffer; +using buffer = std::vector<char>; #pragma db value(buffer) type("BLOB") #pragma db object @@ -21113,7 +21298,7 @@ class object { public #pragma db id auto - unsigned long id; + unsigned long long id; odb::sqlite::blob b; // Mapped to BLOB. odb::sqlite::text t; // Mapped to TEXT. @@ -21295,7 +21480,7 @@ object o; // { transaction tx (db.begin ()); - auto_ptr<object> p (db.load<object> (o.id)); + unique_ptr<object> p (db.load<object> (o.id)); text_stream ts (p->t, false); // Open for reading. vector<char> t (ts.size () + 1, '\0'); @@ -21358,7 +21543,7 @@ struct load_b odb::sqlite::blob b; }; -typedef odb::query<load_b> query; +using query = odb::query<load_b>; transaction tx (db.begin ()); @@ -21412,7 +21597,7 @@ text_stream ts (o.t, true); <pre class="cxx"> transaction tx (db.begin ()); -auto_ptr<object> p (db.load<object> (o.id)); +unique_ptr<object> p (db.load<object> (o.id)); p->name = "foo"; // Update some other member. db.update (*p); // Bad behavior: incremental BLOB/TEXT invalidated. @@ -21433,6 +21618,22 @@ tx.commit (); default; see SQLite <code>PRAGMA encoding</code> documentation for details).</p> + <h3><a name="18.1.4">18.1.4 Mixed Automatic/Manual Object Id Assignment</a></h3> + + <p>In SQLite an automatic object id can also be assigned manually. For + example:</p> + + <pre class="cxx"> + #pragma db id auto + odb::nullable<int64_t> id; + </pre> + + <p>Then set the id member to <code>NULL</code> to get auto-assignment or to + the actual value to use a manual id. This functionality is normally + used to reserve a special id, typically <code>0</code>, for a special + object.</p> + + <h2><a name="18.2">18.2 SQLite Database Class</a></h2> <p>The SQLite <code>database</code> class has the following @@ -21506,7 +21707,7 @@ namespace odb values, refer to the <code>sqlite3_open_v2()</code> function description in the SQLite C API documentation. The <code>foreign_keys</code> argument specifies whether foreign key constraints checking - should be enabled. See <a href="#18.5.3">Section 18.5.3, + should be enabled. See <a href="#18.6.3">Section 18.6.3, "Foreign Key Constraints"</a> for more information on foreign keys. The <code>vfs</code> argument specifies the SQLite virtual file system module that should be used to access the @@ -21518,7 +21719,7 @@ namespace odb database in the read-write mode and create it if it does not exist:</p> <pre class="cxx"> -auto_ptr<odb::database> db ( +unique_ptr<odb::database> db ( new odb::sqlite::database ( "test.db", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); @@ -21562,7 +21763,7 @@ auto_ptr<odb::database> db ( <p>The third constructor throws the <code>odb::sqlite::cli_exception</code> exception if the SQLite option values are missing or invalid. - See <a href="#18.4">Section 18.4, "SQLite Exceptions"</a> + See <a href="#18.5">Section 18.5, "SQLite Exceptions"</a> for more information on this exception.</p> <p>The static <code>print_usage()</code> function prints the list of options @@ -21619,7 +21820,7 @@ namespace odb handle (); }; - typedef details::shared_ptr<connection> connection_ptr; + using connection_ptr = details::shared_ptr<connection>; } } </pre> @@ -21670,8 +21871,9 @@ namespace odb <code>connect()</code> function is called whenever a database connection is requested.</p> - <p>The three implementations of the <code>connection_factory</code> + <p>The four implementations of the <code>connection_factory</code> interface provided by the SQLite ODB runtime library are + <code>serial_connection_factory</code>, <code>single_connection_factory</code>, <code>new_connection_factory</code>, and <code>connection_pool_factory</code>. You will need to include @@ -21679,6 +21881,37 @@ namespace odb header file to make the <code>connection_factory</code> interface and these implementation classes available in your application.</p> + <p>The <code>serial_connection_factory</code> class creates a single + connection that is expected to be used by an application in a serialized + manner. For example, a single-threaded application that executes all the + database operations via the database instance and without dealing with + multiple connections/transactions would qualify. The + <code>serial_connection_factory</code> class has the following + interface:</p> + + <pre class="cxx"> +namespace odb +{ + namespace sqlite + { + class serial_connection_factory: public connection_factory + { + public: + serial_connection_factory (); + + protected: + virtual connection_ptr + create (); + }; +}; + </pre> + + <p>The <code>create()</code> virtual function is called when the + factory needs to create the connection. By deriving from the + <code>serial_connection_factory</code> class and overriding this + function we can implement custom connection establishment + and configuration.</p> + <p>The <code>single_connection_factory</code> class creates a single connection that is shared between all the threads in an application. If the connection is currently not in use, @@ -21705,7 +21938,7 @@ namespace odb single_connection (database&, sqlite3*); }; - typedef details::shared_ptr<single_connection> single_connection_ptr; + using single_connection_ptr = details::shared_ptr<single_connection>; virtual single_connection_ptr create (); @@ -21760,7 +21993,7 @@ namespace odb pooled_connection (database_type&, sqlite3*); }; - typedef details::shared_ptr<pooled_connection> pooled_connection_ptr; + using pooled_connection_ptr = details::shared_ptr<pooled_connection>; virtual pooled_connection_ptr create (); @@ -21831,15 +22064,119 @@ namespace odb int main (int argc, char* argv[]) { - auto_ptr<odb::sqlite::connection_factory> f ( + unique_ptr<odb::sqlite::connection_factory> f ( new odb::sqlite::connection_pool_factory (20)); - auto_ptr<odb::database> db ( + unique_ptr<odb::database> db ( new sqlite::database (argc, argv, false, SQLITE_OPEN_READWRITE, f)); } </pre> - <h2><a name="18.4">18.4 SQLite Exceptions</a></h2> + + <h2><a name="18.4">18.4 Attached SQLite Databases</a></h2> + + <p>The SQLite database class provides support for attaching additional + databases to the main database connections using the SQLite <code>ATTACH + DATABASE</code> statement. Good understanding of the SQLite attached + database semantics and ODB connection management is strongly recommended + when using this functionality.</p> + + <p>The relevant part of the SQLite database class interface is shown + below:</p> + + <pre class="cxx"> +namespace odb +{ + namespace sqlite + { + class database: public odb::database + { + public: + + ... + + database (const connection_ptr&, + const std::string& name, + const std::string& schema, + std::[auto|unique]_ptr<attached_connection_factory> = 0); + + void + detach (); + + database& + main_database (); + + const std::string& + schema () const; + }; + } +} + </pre> + + <p>The shown constructor attaches to the specified connection a database + with the specified name as the specified schema.</p> + + <p>The resulting database instance is referred to as an <em>attached + database</em> and the connection it returns as an <em>attached + connection</em> (which is just a proxy for the main connection). Database + operations executed on the attached database or attached connection are + automatically translated to refer to the specified schema rather than + <code>"main"</code>. For uniformity attached databases can also be + created for the pre-attached <code>"main"</code> and <code>"temp"</code> + schemas (in this case the <code>name</code> argument can be + anything).</p> + + <p>The automatic translation of the statements relies on their text having + references to top-level database entities (tables, indexes, etc) + qualified with the <code>"main"</code> schema. To achieve this, compile + your headers with the <code>--schema main</code> option and, if using + schema migration, with the <code>--schema-version-table + main.schema_version</code> option. You must also not + use <code>"main"</code> as an object/table alias in views of native + statements. For optimal translation performance use 4-character schema + names.</p> + + <p>The main connection and attached to it databases and connections are all + meant to be used within the same thread. In particular, the attached + database holds a counted reference to the main connection which means the + connection will not be released until all the attached to this connection + databases are destroyed.</p> + + <p>Note that in this model the attached databases are attached to the main + connection, not to the (main) database, which mimics the underlying + semantics of SQLite. An alternative model would have been to notionally + attach the databases to the main database and under the hood + automatically attach them to each returned connection. While this may + seem like a more convenient model in some cases, it is also less + flexible: the current model allows attaching a different set of databases + to different connections, attaching them on demand as the transaction + progresses, etc. Also, the more convenient model can be implemented on + top of this model by deriving an application-specific database class + and/or providing custom connection factories.</p> + + <p>Note also that unless the name is a URI with appropriate mode, the + attached database is opened with the + <code>SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE</code> flags. In + particular, if you want just <code>SQLITE_OPEN_READWRITE</code>, then you + will need to verify the database file existence manually prior to calling + this constructor.</p> + + <p>Note that attaching/detaching databases within a transaction is only + supported since SQLite 3.21.0.</p> + + <p>The <code>detach()</code> function detaches the attached database. The + database is automatically detached on destruction but a failure to detach + is ignored. To detect such a failure perform explicit detach. For + uniformity detaching a main database is a no-op.</p> + + <p>The <code>main_database()</code> function returns the main database of an + attached database. If this database is main, return itself.</p> + + <p>The <code>schema()</code> function returns the schema name under which + this database was attached or empty if this is the main database.</p> + + + <h2><a name="18.5">18.5 SQLite Exceptions</a></h2> <p>The SQLite ODB runtime library defines the following SQLite-specific exceptions:</p> @@ -21887,7 +22224,7 @@ namespace odb <p>The <code>odb::sqlite::forced_rollback</code> exception is thrown if SQLite is forcing the current transaction to roll back. For more - information on this behavior refer to <a href="#18.5.6">Section 18.5.6, + information on this behavior refer to <a href="#18.6.6">Section 18.6.6, "Forced Rollback"</a>.</p> <p>The <code>odb::sqlite::database_exception</code> is thrown if @@ -21904,12 +22241,12 @@ namespace odb of an error.</p> - <h2><a name="18.5">18.5 SQLite Limitations</a></h2> + <h2><a name="18.6">18.6 SQLite Limitations</a></h2> <p>The following sections describe SQLite-specific limitations imposed by the current SQLite and ODB runtime versions.</p> - <h3><a name="18.5.1">18.5.1 Query Result Caching</a></h3> + <h3><a name="18.6.1">18.6.1 Query Result Caching</a></h3> <p>SQLite ODB runtime implementation does not perform query result caching (<a href="#4.4">Section 4.4, "Query Result"</a>) even when explicitly @@ -21924,7 +22261,7 @@ namespace odb thrown. Future versions of the SQLite ODB runtime library may add support for result caching.</p> - <h3><a name="18.5.2">18.5.2 Automatic Assignment of Object Ids</a></h3> + <h3><a name="18.6.2">18.6.2 Automatic Assignment of Object Ids</a></h3> <p>Due to SQLite API limitations, every automatically assigned object id (<a href="#14.4.2">Section 14.4.2, "<code>auto</code>"</a>) should have @@ -21950,7 +22287,7 @@ class person }; </pre> - <h3><a name="18.5.3">18.5.3 Foreign Key Constraints</a></h3> + <h3><a name="18.6.3">18.6.3 Foreign Key Constraints</a></h3> <p>By default the SQLite ODB runtime enables foreign key constraints checking (<code>PRAGMA foreign_keys=ON</code>). You can disable foreign @@ -22020,7 +22357,7 @@ CREATE TABLE Employee ( which you persist, update, and erase objects within a transaction becomes important.</p> - <h3><a name="18.5.4">18.5.4 Constraint Violations</a></h3> + <h3><a name="18.6.4">18.6.4 Constraint Violations</a></h3> <p>Due to the granularity of the SQLite error codes, it is impossible to distinguish between the duplicate primary key and other constraint @@ -22029,7 +22366,7 @@ CREATE TABLE Employee ( <code>object_already_persistent</code> exception (<a href="#3.14">Section 3.14, "ODB Exceptions"</a>).</p> - <h3><a name="18.5.5">18.5.5 Sharing of Queries</a></h3> + <h3><a name="18.6.5">18.6.5 Sharing of Queries</a></h3> <p>As discussed in <a href="#4.3">Section 4.3, "Executing a Query"</a>, a query instance that does not have any by-reference parameters is @@ -22038,7 +22375,7 @@ CREATE TABLE Employee ( functionality. Future versions of the library will remove this limitation.</p> - <h3><a name="18.5.6">18.5.6 Forced Rollback</a></h3> + <h3><a name="18.6.6">18.6.6 Forced Rollback</a></h3> <p>In SQLite 3.7.11 or later, if one of the connections participating in the shared cache rolls back a transaction, then ongoing transactions @@ -22049,12 +22386,12 @@ CREATE TABLE Employee ( <p>If a transaction is being forced to roll back by SQLite, then ODB throws <code>odb::sqlite::forced_rollback</code> - (<a href="#18.4">Section 18.4, "SQLite Exceptions"</a>) which is + (<a href="#18.5">Section 18.5, "SQLite Exceptions"</a>) which is a recoverable exception (<a href="#3.7">3.7 Error Handling and Recovery</a>). As a result, the recommended way to handle this exception is to re-execute the affected transaction.</p> - <h3><a name="18.5.7">18.5.7 Database Schema Evolution</a></h3> + <h3><a name="18.6.7">18.6.7 Database Schema Evolution</a></h3> <p>From the list of schema migration changes supported by ODB (<a href="#13.2">Section 13.2, "Schema Migration"</a>), the @@ -22126,7 +22463,7 @@ CREATE TABLE Employee ( avoid composite object ids if we are planning to use object relationships.</p> - <h2><a name="18.6">18.6 SQLite Index Definitions</a></h2> + <h2><a name="18.7">18.7 SQLite Index Definitions</a></h2> <p>When the <code>index</code> pragma (<a href="#14.7">Section 14.7, "Index Definition Pragmas"</a>) is used to define an SQLite index, @@ -22412,7 +22749,7 @@ class object <p>Alternatively, this can be done on the per-type basis, for example:</p> <pre class="cxx"> -typedef std::vector<char> buffer; +using buffer = std::vector<char>; #pragma db value(buffer) type("BYTEA") #pragma db object @@ -22608,7 +22945,7 @@ namespace odb handle (); }; - typedef details::shared_ptr<connection> connection_ptr; + using connection_ptr = details::shared_ptr<connection>; } } </pre> @@ -22698,7 +23035,7 @@ namespace odb pooled_connection (database_type&, PGconn*); }; - typedef details::shared_ptr<pooled_connection> pooled_connection_ptr; + using pooled_connection_ptr = details::shared_ptr<pooled_connection>; virtual pooled_connection_ptr create (); @@ -22762,10 +23099,10 @@ namespace odb int main (int argc, char* argv[]) { - auto_ptr<odb::pgsql::connection_factory> f ( + unique_ptr<odb::pgsql::connection_factory> f ( new odb::pgsql::connection_pool_factory (20)); - auto_ptr<odb::database> db ( + unique_ptr<odb::database> db ( new pgsql::database (argc, argv, false, "", f)); } </pre> @@ -22942,6 +23279,236 @@ class object ODB automatically prefixes each index name with the table name on which it is defined.</p> + + <h2><a name="19.7">19.7 PostgreSQL Stored Procedures and Functions</a></h2> + + <p>ODB native views (<a href="#10.6">Section 10.6, "Native Views"</a>) can + be used to call PostgreSQL stored procedures and functions. For example, + assuming we are using the <code>person</code> class + from <a href="#2">Chapter 2, "Hello World Example"</a> (and the + corresponding <code>person</code> table), we can create a stored + function that given the min and max ages returns some information about + all the people in that range:</p> + + <pre class="sql"> +CREATE FUNCTION +person_range (IN min_age INTEGER, + IN max_age INTEGER, + OUT age SMALLINT, + OUT first TEXT, + OUT last TEXT) +RETURNS SETOF RECORD AS $$ + SELECT age, first, last + FROM person + WHERE age >= min_age AND age <= max_age; +$$ LANGUAGE SQL STABLE; + </pre> + + <p>Given the above stored function we can then define an ODB view that can + be used to call it and retrieve its result:</p> + + <pre class="cxx"> +#pragma db view query("/*CALL*/ SELECT * FROM person_range((?))") +struct person_range +{ + unsigned short age; + std::string first; + std::string last; +}; + </pre> + + <p>Notice the special <code>/*CALL*/</code> prefix: because PostgreSQL uses + ordinary <code>SELECT</code> queries to call functions, we need to + communicate to ODB that the query is actually a function call.</p> + + <p>The following example shows how we can use the above view to + print the list of people in a specific age range:</p> + + <pre class="cxx"> +using query = odb::query<person_range>; +using result = odb::result<person_range>; + +transaction t (db.begin ()); + +result r ( + db.query<person_range> ( + query::_val (1) + "," + query::_val (18))); + +for (result::iterator i (r.begin ()); i != r.end (); ++i) + cerr << i->first << " " << i->last << " " << i->age << endl; + +t.commit (); + </pre> + + <p>Note that as with all native views, the order and types of data members + must match those returned by the stored function or procedure.</p> + + <p>In the above example, the stored function returned a set of rows. Other + common cases are functions that return a single row, a single value, or + nothing (<code>VOID</code>). An example of a function returning a single + row via the <code>OUT</code> parameters:</p> + + <pre class="sql"> +CREATE FUNCTION +person_age_range (IN last_name TEXT, + OUT min_age SMALLINT, + OUT max_age SMALLINT) +AS $$ + SELECT min(age), max(age) + FROM person + WHERE last = last_name; +$$ LANGUAGE SQL STABLE; + </pre> + + <pre class="cxx"> +#pragma db view query("/*CALL*/ SELECT * FROM person_age_range((?))") +struct person_age_range +{ + unsigned short min_age; + unsigned short max_age; +}; + </pre> + + <pre class="cxx"> +using query = odb::query<person_age_range>; + +person_age_range r ( + db.query_value<person_age_range> ( + query::_val ("Doe"))); + </pre> + + <p>An example of a function returning a single value:</p> + + <pre class="sql"> +CREATE FUNCTION +person_count () +RETURNS BIGINT AS $$ + SELECT count(id) + FROM person; +$$ LANGUAGE SQL STABLE; + </pre> + + <pre class="cxx"> +#pragma db view query("/*CALL*/ SELECT * FROM person_count()") +struct person_count +{ + unsigned long long count; +}; + </pre> + + <pre class="cxx"> +unsigned long long count (db.query_value<person_count> ().count); + </pre> + + <p>Finally, a function that returns <code>VOID</code>:</p> + + <pre class="sql"> +CREATE FUNCTION +person_increment_age (IN min_age INTEGER, + IN max_age INTEGER) +RETURNS VOID AS $$ + UPDATE person + SET age = age + 1 + WHERE age >= min_age AND age <= max_age; +$$ LANGUAGE SQL; + </pre> + + <pre class="cxx"> +#pragma db view query("/*CALL*/ SELECT * FROM person_increment_age((?))") +struct person_increment_age {}; + </pre> + + <pre class="cxx"> +using query = odb::query<person_increment_age>; + +db.query_value<person_increment_age> ( + query::_val (1) + "," + + query::_val (18)); + </pre> + + <p>We can reuse a single view to call several functions (or procedure; see + below) that return <code>VOID</code> or, more generally, return the same + result, by specifying the function (or procedure) at the call site rather + than in the view definition. For example:</p> + + <pre class="cxx"> +#pragma db view +struct no_result {}; + +using query = odb::query<no_result>; + +db.query_one<no_result> ( + "/*CALL*/ SELECT * FROM person_increment_age(" + + query::_val (1) + "," + + query::_val (18) + ")"); + </pre> + + <p>In contrast to functions, stored procedures in PostgreSQL are called with + the <code>CALL</code> statement. They can only return a single set of + values via the <code>OUT</code> parameters. If there are no output + parameters, then a stored procedure doesn't return anything. For + example:</p> + + <pre class="sql"> +CREATE PROCEDURE +person_increment_age (IN id BIGINT, + OUT first TEXT, + OUT last TEXT, + OUT age SMALLINT) +AS $$ + UPDATE person + SET age = age + 1 + WHERE person.id = id + RETURNING first, last, age; +$$ LANGUAGE SQL; + </pre> + + <pre class="cxx"> +#pragma db view query("CALL person_increment_age((?))") +struct person_increment_age +{ + std::string first; + std::string last; + unsigned short age; +}; + </pre> + + <pre class="cxx"> +using query = odb::query<person_increment_age>; + +person_increment_age r ( + db.query_value<person_increment_age> ( + query::_val (123) + ",NULL,NULL,NULL")); + </pre> + + <p>Note that in the <code>CALL</code> statement, output parameters must + be included in the argument list, normally as <code>NULL</code>.</p> + + <p>A stored procedure that doesn't return anything and has no parameters can + be called with <code>execute()</code> (<a href="#3.12">3.12 Executing + Native SQL Statements</a>) rather than <code>query()</code>. Such a + procedure can also control transactions. For example:</p> + + <pre class="sql"> +CREATE PROCEDURE +person_increment_all_ages () +AS $$ +BEGIN + UPDATE person + SET age = age + 1; + COMMIT; +END; +$$ LANGUAGE PLPGSQL; + </pre> + + <pre class="cxx"> +db.connection ()->execute ("CALL person_increment_all_ages()"); + </pre> + + <p>For more information on how to call stored procedures and functions with + the various return approaches refer to the <code>pgsql/stored-proc</code> + test in the <code>odb-tests</code> package.</p> + <!-- CHAPTER --> @@ -23202,7 +23769,7 @@ class object <p>Alternatively, this can be done on the per-type basis, for example:</p> <pre class="cxx"> -typedef std::vector<char> buffer; +using buffer = std::vector<char>; #pragma db value(buffer) type("BLOB") #pragma db object @@ -23432,7 +23999,7 @@ namespace odb lob_buffer (); }; - typedef details::shared_ptr<connection> connection_ptr; + using connection_ptr = details::shared_ptr<connection>; } } </pre> @@ -23537,7 +24104,7 @@ namespace odb pooled_connection (database_type&, OCISvcCtx*); }; - typedef details::shared_ptr<pooled_connection> pooled_connection_ptr; + using pooled_connection_ptr = details::shared_ptr<pooled_connection>; virtual pooled_connection_ptr create (); @@ -23601,10 +24168,10 @@ namespace odb int main (int argc, char* argv[]) { - auto_ptr<odb::oracle::connection_factory> f ( + unique_ptr<odb::oracle::connection_factory> f ( new odb::oracle::connection_pool_factory (20)); - auto_ptr<odb::database> db ( + unique_ptr<odb::database> db ( new oracle::database (argc, argv, false, 0, 0, 0, f)); } </pre> @@ -23632,10 +24199,10 @@ namespace odb message () const; }; - typedef std::vector<record> records; + using records = std::vector<record>; - typedef records::size_type size_type; - typedef records::const_iterator iterator; + using size_type = records::size_type; + using iterator = records::const_iterator; iterator begin () const; @@ -24181,7 +24748,7 @@ class object <p>Alternatively, this can be done on the per-type basis, for example:</p> <pre class="cxx"> -typedef std::vector<char> buffer; +using buffer = std::vector<char>; #pragma db value(buffer) type("VARBINARY(max)") #pragma db object @@ -24280,8 +24847,8 @@ class object std::string str_; }; -typedef odb::query<object> query; -typedef odb::result<object> result; +using query = odb::query<object>; +using result = odb::result<object>; transaction t (db.begin ()); @@ -24336,8 +24903,8 @@ namespace odb class database: public odb::database { public: - typedef protocol protocol_type; - typedef transaction_isolation transaction_isolation_type; + using protocol_type = protocol; + using transaction_isolation_type = transaction_isolation; database (const std::string& user, const std::string& password, @@ -24657,7 +25224,7 @@ namespace odb long_data_buffer (); }; - typedef details::shared_ptr<connection> connection_ptr; + using connection_ptr = details::shared_ptr<connection>; } } </pre> @@ -24758,7 +25325,7 @@ namespace odb pooled_connection (database_type&, SQLHDBC handle); }; - typedef details::shared_ptr<pooled_connection> pooled_connection_ptr; + using pooled_connection_ptr = details::shared_ptr<pooled_connection>; virtual pooled_connection_ptr create (); @@ -24822,10 +25389,10 @@ namespace odb int main (int argc, char* argv[]) { - auto_ptr<odb::mssql::connection_factory> f ( + unique_ptr<odb::mssql::connection_factory> f ( new odb::mssql::connection_pool_factory (20)); - auto_ptr<odb::database> db ( + unique_ptr<odb::database> db ( new mssql::database (argc, argv, false, "", 0, f)); } </pre> @@ -24856,10 +25423,10 @@ namespace odb message () const; }; - typedef std::vector<record> records; + using records = std::vector<record>; - typedef records::size_type size_type; - typedef records::const_iterator iterator; + using size_type = records::size_type; + using iterator = records::const_iterator; iterator begin () const; @@ -25080,8 +25647,8 @@ struct person_range print the list of people in a specific age range:</p> <pre class="cxx"> -typedef odb::query<person_range> query; -typedef odb::result<person_range> result; +using query = odb::query<person_range>; +using result = odb::result<person_range>; transaction t (db.begin ()); @@ -25150,12 +25717,12 @@ t.commit (); <p>In SQL Server, a stored procedure can produce multiple results. For example, if a stored procedure executes several - <code>SELECT</code> statements, then the result of calling such - a procedure consists of two row sets, one for each <code>SELECT</code> - statement. Because such multiple row sets can contain varying number - and type of columns, they cannot be all extracted into a - single view. Consequently, these kind of stored procedures are - currently not supported.</p> + <code>SELECT</code> statements, then the result of calling such a + procedure consists of multiple row sets, one for each <code>SELECT</code> + statement. Because such multiple row sets can contain varying number and + type of columns, they cannot be all extracted into a single + view. Consequently, these kind of stored procedures are currently not + supported.</p> <p>A stored procedure may also produce no row sets at all. For example, a stored procedure that only executes DML statements @@ -25408,14 +25975,14 @@ class person { ... - typedef - mi::multi_index_container< - std::string, - mi::indexed_by< - mi::sequenced<>, - mi::ordered_unique<mi::identity<std::string> > - > - > emails; + using emails = + mi::multi_index_container< + std::string, + mi::indexed_by< + mi::sequenced<>, + mi::ordered_unique<mi::identity<std::string>> + > + >; emails emails_; }; @@ -25458,19 +26025,19 @@ class person { ... - typedef - mi::multi_index_container< - name, - mi::indexed_by< - mi::ordered_unique<mi::identity<name> > - mi::ordered_non_unique< - mi::member<name, std::string, &name::first> - >, - mi::ordered_non_unique< - mi::member<name, std::string, &name::last> + using aliases = + mi::multi_index_container< + name, + mi::indexed_by< + mi::ordered_unique<mi::identity<name>> + mi::ordered_non_unique< + mi::member<name, std::string, &name::first> + >, + mi::ordered_non_unique< + mi::member<name, std::string, &name::last> + > > - > - > aliases; + > ; aliases aliases_; }; @@ -26603,7 +27170,7 @@ class QOdbList // Iterators. // - typedef typename QList<T>::const_iterator const_iterator; + using const_iterator = typename QList<T>::const_iterator; class iterator { diff --git a/odb/doc/odb-prologue.1 b/odb/doc/odb-prologue.1 index 24e83f4..9092f95 100644 --- a/odb/doc/odb-prologue.1 +++ b/odb/doc/odb-prologue.1 @@ -1,7 +1,7 @@ .\" Process this file with .\" groff -man -Tascii odb.1 .\" -.TH ODB 1 "February 2015" "ODB 2.4.0" +.TH ODB 1 "January 2025" "ODB 2.6.0" .SH NAME odb \- object-relational mapping (ORM) compiler for C++ .\" diff --git a/odb/doc/odb-prologue.xhtml b/odb/doc/odb-prologue.xhtml index b8cc694..0ad11a4 100644 --- a/odb/doc/odb-prologue.xhtml +++ b/odb/doc/odb-prologue.xhtml @@ -2,7 +2,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> - <title>ODB 2.4.0 Compiler Command Line Manual</title> + <title>ODB 2.6.0 Compiler Command Line Manual</title> <meta name="copyright" content="© $copyright$"/> <meta name="keywords" content="odb,object,relational,mapping,compiler,c++"/> diff --git a/odb/doc/pregenerated/odb.1 b/odb/doc/pregenerated/odb.1 index c440ca1..69bf59b 100644 --- a/odb/doc/pregenerated/odb.1 +++ b/odb/doc/pregenerated/odb.1 @@ -1,7 +1,7 @@ .\" Process this file with .\" groff -man -Tascii odb.1 .\" -.TH ODB 1 "February 2015" "ODB 2.4.0" +.TH ODB 1 "January 2025" "ODB 2.6.0" .SH NAME odb \- object-relational mapping (ORM) compiler for C++ .\" @@ -260,8 +260,8 @@ must be declared \fBextern\fR\. This option is normally used together with enabled\. .IP "\fB--std\fR \fIversion\fR" Specify the C++ standard that should be used during compilation\. Valid values -are \fBc++98\fR (default), \fBc++11\fR, \fBc++14\fR, \fBc++17\fR, and -\fBc++20\fR\. +are \fBc++98\fR (default), \fBc++11\fR, \fBc++14\fR, \fBc++17\fR, \fBc++20\fR, +\fBc++23\fR, and \fBc++26\fR\. .IP "\fB--warn-hard-add\fR" Warn about hard-added data members\. .IP "\fB--warn-hard-delete\fR" @@ -790,7 +790,7 @@ Send bug reports to the odb-users@codesynthesis.com mailing list. .\" COPYRIGHT .\" .SH COPYRIGHT -Copyright (c) 2009-2024 Code Synthesis. +Copyright (c) 2009-2025 Code Synthesis. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, diff --git a/odb/doc/pregenerated/odb.xhtml b/odb/doc/pregenerated/odb.xhtml index 8abce64..0988717 100644 --- a/odb/doc/pregenerated/odb.xhtml +++ b/odb/doc/pregenerated/odb.xhtml @@ -2,9 +2,9 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> - <title>ODB 2.4.0 Compiler Command Line Manual</title> + <title>ODB 2.6.0 Compiler Command Line Manual</title> - <meta name="copyright" content="© 2009-2024 Code Synthesis"/> + <meta name="copyright" content="© 2009-2025 Code Synthesis"/> <meta name="keywords" content="odb,object,relational,mapping,compiler,c++"/> <meta name="description" content="ODB Compiler Command Line Manual"/> @@ -317,8 +317,9 @@ <dt><code><b>--std</b></code> <code><i>version</i></code></dt> <dd>Specify the C++ standard that should be used during compilation. Valid values are <code><b>c++98</b></code> (default), <code><b>c++11</b></code>, - <code><b>c++14</b></code>, <code><b>c++17</b></code>, and - <code><b>c++20</b></code>.</dd> + <code><b>c++14</b></code>, <code><b>c++17</b></code>, + <code><b>c++20</b></code>, <code><b>c++23</b></code>, and + <code><b>c++26</b></code>.</dd> <dt><code><b>--warn-hard-add</b></code></dt> <dd>Warn about hard-added data members.</dd> @@ -963,7 +964,7 @@ </div> <div id="footer"> - Copyright © 2009-2024 Code Synthesis. + Copyright © 2009-2025 Code Synthesis. <div id="terms"> Permission is granted to copy, distribute and/or modify this diff --git a/odb/manifest b/odb/manifest index 2ef8b08..7751cec 100644 --- a/odb/manifest +++ b/odb/manifest @@ -1,34 +1,174 @@ : 1 name: odb -version: 2.5.0-b.26.z +version: 2.6.0-b.1.z summary: ODB compiler license: GPL-3.0-only topics: C++, ORM, source code generation, object persistence, \ relational database -description-file: README +description-file: README.md +package-description-file: PACKAGE-README.md changes-file: NEWS url: https://www.codesynthesis.com/products/odb/ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml src-url: https://git.codesynthesis.com/cgit/odb/odb/ email: odb-users@codesynthesis.com build-warning-email: odb-builds@codesynthesis.com -builds: all +builds: all relocatable builds: -( +windows -gcc ) ; Requires MinGW GCC. builds: &gcc ; Requires GCC with plugin support enabled. builds: &gcc-5+ ; Requires GCC 5 or later. builds: -static ; Implementation uses plugins and requires -fPIC. requires: host requires: c++11 +depends: * build2 >= 0.18.0- +depends: * bpkg >= 0.18.0- -# @@ TMP Bump the toolchain version to 0.17.0 after it is released. +depends: libstudxml ^1.1.0 +depends: libcutl ^1.11.0 + +#depends: libstudxml == 1.1.0-b.10 +#depends: libcutl == 1.11.0-b.1 + +depends: * cli ^1.2.0 ? ($config.odb.develop) + +# Binary distribution packages. Overall notes: +# +# - Link dependencies that don't come from system packages statically. Note +# that duplicate symbols are not an issue since the plugin shared library is +# loaded by the GCC compiler, not ODB. +# +# - We suppress generating binary packages for dependencies (libstudxml, +# libcutl) with --recursive=auto since they are linked statically. # -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- -depends: libstudxml ^1.1.0- -depends: libcutl ^1.11.0- +# Linux binary distributions packages. +# +# - Compile (static) dependencies with -fPIC since they are linked to the ODB +# plugin shared library. +# +# - Note that Fedora's rpmbuild and Ubuntu's dpkg-buildpackage compile the +# ODB's sources with the -flto=auto option, which breaks the plugin. Thus, +# we always disable the link-time optimization by adding -fno-lto. +# +bindist-debian-builds: bindist +bindist-debian-build-include: linux_debian*-** +bindist-debian-build-include: linux_ubuntu*-** +bindist-debian-build-exclude: ** +bindist-debian-build-config: +\ ++bpkg.bindist.debian: ++bbot.bindist.upload: +bpkg.bindist.debian:--recursive=auto +bpkg.bindist.debian:--debian-main-extradep=g++ -#depends: libstudxml == 1.1.0-b.10 -#depends: libcutl == 1.11.0-b.9 +# Prepend system package manager options instead of overriding. +# +bpkg.bindist.debian:--debian-buildflags=prepend + +bpkg.create:config.bin.lib=static + +# Reset common options for dependencies (because we are prepending). +# +bpkg.create:config.cc.poptions=[null] +bpkg.create:config.cc.coptions=[null] +bpkg.create:config.cc.loptions=[null] + +# Append custom options for dependencies. +# +bpkg.create:config.c.coptions="-fPIC -fno-lto" +bpkg.create:config.cxx.coptions="-fPIC -fno-lto" + +# Reset common options for odb (because we are prepending). +# +bpkg.configure.build:.../config.cc.poptions=[null] +bpkg.configure.build:.../config.cc.coptions=[null] +bpkg.configure.build:.../config.cc.loptions=[null] + +# Append custom options for odb. +# +bpkg.configure.build:.../config.cxx.coptions=-fno-lto +\ + +bindist-fedora-builds: bindist +bindist-fedora-build-include: linux_fedora*-** +bindist-fedora-build-include: linux_rhel*-** +bindist-fedora-build-exclude: ** +bindist-fedora-build-config: +\ ++bpkg.bindist.fedora: ++bbot.bindist.upload: +bpkg.bindist.fedora:--recursive=auto +bpkg.bindist.fedora:--fedora-main-extrareq=gcc-c++ + +# Prepend system package manager options instead of overriding. +# +bpkg.bindist.fedora:--fedora-buildflags=prepend + +bpkg.create:config.bin.lib=static + +# Reset common options for dependencies (because we are prepending). +# +bpkg.create:config.cc.poptions=[null] +bpkg.create:config.cc.coptions=[null] +bpkg.create:config.cc.loptions=[null] + +# Append custom options for dependencies. +# +bpkg.create:config.c.coptions="-fPIC -fno-lto" +bpkg.create:config.cxx.coptions="-fPIC -fno-lto" + +# Reset common options for odb (because we are prepending). +# +bpkg.configure.build:.../config.cc.poptions=[null] +bpkg.configure.build:.../config.cc.coptions=[null] +bpkg.configure.build:.../config.cc.loptions=[null] + +# Append custom options for odb. +# +bpkg.configure.build:.../config.cxx.coptions=-fno-lto +\ + +# Windows binary distribution archive. +# +# - Strip the default compiler name from metadata in the archive name since it +# is built with GCC and the run-time libraries are supposed to be bundled +# (see below for details). +# +# - Note that the contents of this archive can be overlaid with the contents +# of the ODB runtime library archives extracted into the root directory. +# +bindist-windows-builds: bindist +bindist-windows-build-include: windows*-gcc** +bindist-windows-build-exclude: ** +bindist-windows-build-config: +\ ++bpkg.bindist.archive: ++bbot.bindist.upload: +bpkg.bindist.archive:--recursive=auto +bpkg.bindist.archive:--archive-lang-impl=cc= + +# Relocatable by default (see target configuration for details). +# +#bpkg.bindist.archive:config.install.relocatable=true + +# Supplement the generated archive with the GCC compiler and run-time +# libraries by overlaying it with the contents of the +# build2-mingw-X.Y.Z-x86_64-windows.tar.xz archive (located at +# https://download.build2.org/) extracted into the mingw/ subdirectory and +# mingw/bin/{libgcc_s_seh-*,libstdc++-*,libwinpthread-*}.dll files copied into +# the bin/ subdirectory. +# +# Note that since the resulting archive is quite big (about 120MB for zip), we +# use the tar.xz archive type to reduce its size (to about 45MB). +# ++bpkg.bindist.archive.post:build/bindist-archive-post.bx +bpkg.bindist.archive:--archive-type=tar.xz + +# At the bpkg.bindist.archive step, configure odb to refer to g++ using the +# relative ../mingw/bin/g++ path (see above for details). +# +bpkg.bindist.archive:config.odb.gxx_name=../mingw/bin/g++ -depends: * cli ^1.2.0- ? ($config.odb.develop) +bpkg.create:config.bin.lib=static +b.create:config.cc.coptions="-Wall -O3" +\ diff --git a/odb/odb/buildfile b/odb/odb/buildfile index 21b98ed..fafc10a 100644 --- a/odb/odb/buildfile +++ b/odb/odb/buildfile @@ -163,7 +163,6 @@ if $develop diff $src_base/pregenerated/odb/options.ixx $path($>[1]) >- && \ diff $src_base/pregenerated/odb/options.cxx $path($>[2]) >- exit - end cp $path($>[0]) $src_base/pregenerated/odb/options.hxx cp $path($>[1]) $src_base/pregenerated/odb/options.ixx diff --git a/odb/odb/gcc-fwd.hxx b/odb/odb/gcc-fwd.hxx index 83d3746..4587814 100644 --- a/odb/odb/gcc-fwd.hxx +++ b/odb/odb/gcc-fwd.hxx @@ -25,8 +25,12 @@ # undef SAFE_CTYPE_H # include <coretypes.h> +#if BUILDING_GCC_MAJOR >= 15 +# include <line-map.h> // location_t (included anyway by above headers) +#else typedef unsigned int source_location; // <line-map.h> typedef source_location location_t; // <input.h> +#endif #else // GCC < 6 diff --git a/odb/odb/gcc.hxx b/odb/odb/gcc.hxx index e5fecef..c546ee1 100644 --- a/odb/odb/gcc.hxx +++ b/odb/odb/gcc.hxx @@ -176,7 +176,7 @@ INCLUDED_FROM (line_maps* set, const line_map_ordinary* map) return linemap_included_from_linemap (set, map); } -inline source_location +inline location_t LAST_SOURCE_LINE_LOCATION (const line_map_ordinary* map) { return (((map[1].start_location - 1 diff --git a/odb/odb/odb.cxx b/odb/odb/odb.cxx index 41063d5..12d8fc6 100644 --- a/odb/odb/odb.cxx +++ b/odb/odb/odb.cxx @@ -709,6 +709,16 @@ main (int argc, char* argv[]) args[3] = "-std=c++2a"; break; } + case cxx_version::cxx23: + { + args[3] = "-std=c++2b"; + break; + } + case cxx_version::cxx26: + { + args[3] = "-std=c++2c"; + break; + } } } diff --git a/odb/odb/option-types.cxx b/odb/odb/option-types.cxx index c4a030b..6055c12 100644 --- a/odb/odb/option-types.cxx +++ b/odb/odb/option-types.cxx @@ -19,7 +19,9 @@ static const char* cxx_version_[] = "c++11", "c++14", "c++17", - "c++20" + "c++20", + "c++23", + "c++26" }; string cxx_version:: @@ -46,6 +48,10 @@ operator>> (istream& is, cxx_version& v) v = cxx_version::cxx17; else if (s == "c++20") v = cxx_version::cxx20; + else if (s == "c++23") + v = cxx_version::cxx23; + else if (s == "c++26") + v = cxx_version::cxx26; else is.setstate (istream::failbit); } diff --git a/odb/odb/option-types.hxx b/odb/odb/option-types.hxx index 869fc83..91371f5 100644 --- a/odb/odb/option-types.hxx +++ b/odb/odb/option-types.hxx @@ -23,7 +23,9 @@ struct cxx_version cxx11, cxx14, cxx17, - cxx20 + cxx20, + cxx23, + cxx26 }; cxx_version (value v = value (0)) : v_ (v) {} diff --git a/odb/odb/options.cli b/odb/odb/options.cli index 17ee438..db2ae5b 100644 --- a/odb/odb/options.cli +++ b/odb/odb/options.cli @@ -127,8 +127,8 @@ class options bool --generate-schema-only { "Generate only the database schema. Note that this option is only valid - when generating schema as a standalone SQL file (see \cb{--schema-format} - for details)." + when generating schema into a separate file (SQL or C++; see + \cb{--schema-format} for details)." }; bool --suppress-migration @@ -317,7 +317,7 @@ class options "<version>", "Specify the C++ standard that should be used during compilation. Valid values are \cb{c++98} (default), \cb{c++11}, \cb{c++14}, - \cb{c++17}, and \cb{c++20}." + \cb{c++17}, \cb{c++20}, \cb{c++23}, and \cb{c++26}." }; // Diagnostics. diff --git a/odb/odb/pragma.cxx b/odb/odb/pragma.cxx index 6668733..378286d 100644 --- a/odb/odb/pragma.cxx +++ b/odb/odb/pragma.cxx @@ -159,12 +159,17 @@ parse_expression (cxx_lexer& l, string& tl, tree& tn, cxx_tokens& ts, - string const& prag) + string const& prag, + bool balance_angles = false) { // Keep reading tokens until we see a mis-matching ')' or ',' while - // keeping track of the '()' and '{}' balance. + // keeping track of the '()', '{}', and '<>' balance. // - size_t p_balance (0), b_balance (0); + // @@ The below implementation of the '<>' balance tracking doesn't + // distinguish angle brackets from the comparison/stream operators and + // should be fixed one day. + // + size_t p_balance (0), b_balance (0), a_balance (0); for (; tt != CPP_EOF; tt = l.next (tl, &tn)) { @@ -173,6 +178,34 @@ parse_expression (cxx_lexer& l, switch (tt) { + case CPP_LESS: + { + if (balance_angles) + a_balance++; + + break; + } + case CPP_GREATER: + { + if (balance_angles) + a_balance--; + + break; + } + case CPP_LSHIFT: + { + if (balance_angles) + a_balance += 2; + + break; + } + case CPP_RSHIFT: + { + if (balance_angles) + a_balance -= 2; + + break; + } case CPP_OPEN_BRACE: { b_balance++; @@ -190,7 +223,7 @@ parse_expression (cxx_lexer& l, } case CPP_CLOSE_PAREN: { - if (p_balance == 0 && b_balance == 0) + if (p_balance == 0 && b_balance == 0 && a_balance == 0) done = true; else p_balance--; @@ -198,7 +231,7 @@ parse_expression (cxx_lexer& l, } case CPP_COMMA: { - if (p_balance == 0 && b_balance == 0) + if (p_balance == 0 && b_balance == 0 && a_balance == 0) done = true; else break; @@ -1202,7 +1235,7 @@ handle_pragma (cxx_lexer& l, tt = l.next (tl, &tn); if (tt != CPP_CLOSE_PAREN) // Empty expression are ok. { - if (!parse_expression (l, tt, tl, tn, ma.expr, p)) + if (!parse_expression (l, tt, tl, tn, ma.expr, p, true /* balance_angles */)) return; // Diagnostics has already been issued. if (tt != CPP_CLOSE_PAREN) diff --git a/odb/odb/pragma.hxx b/odb/odb/pragma.hxx index 0d4d3f1..3efe559 100644 --- a/odb/odb/pragma.hxx +++ b/odb/odb/pragma.hxx @@ -210,13 +210,13 @@ struct pragma_set: std::multimap<std::string, pragma> if (r.first != r.second) { i = r.first; - assert (++r.first == r.second); + assert (++r.first == r.second); // NDEBUG-ok (unused). i->second = p; } } else if (r.first != r.second) - assert ((--r.second)->second.loc <= p.loc); + assert ((--r.second)->second.loc <= p.loc); // NDEBUG-ok (unused). if (i == end ()) i = base::insert (base::value_type (n, p)); diff --git a/odb/odb/processor.cxx b/odb/odb/processor.cxx index fb129fa..3de95e1 100644 --- a/odb/odb/processor.cxx +++ b/odb/odb/processor.cxx @@ -1883,7 +1883,14 @@ namespace // specialization for this type. // tree inst ( - lookup_template_class (t, args, 0, 0, 0, tf_warning_or_error)); + lookup_template_class (t, + args, + 0, + 0, +#if BUILDING_GCC_MAJOR < 15 + 0 /* entering_scope */, +#endif + tf_warning_or_error)); if (inst == error_mark_node) { diff --git a/odb/odb/relational/header.cxx b/odb/odb/relational/header.cxx index 364d48e..fe715e6 100644 --- a/odb/odb/relational/header.cxx +++ b/odb/odb/relational/header.cxx @@ -862,7 +862,7 @@ traverse_view (type& c) os << "," << endl << "const schema_version_migration&"; - os << ")" << (columns != 0 ? ";\n" : "{}"); + os << ")" << (columns != 0 ? ";\n" : "{return false;}"); } // bind (image_type) diff --git a/odb/odb/relational/processor.cxx b/odb/odb/relational/processor.cxx index 0f60359..7abd6d9 100644 --- a/odb/odb/relational/processor.cxx +++ b/odb/odb/relational/processor.cxx @@ -1181,11 +1181,11 @@ namespace relational string q (upcase (vq.literal)); //@@ We need to recognize database-specific list of prefixes. For - // example, PG has WITH. Alternatively (or in addition) we could - // do the same comment trick (e.g., /*SELECT*/ to treat it as a - // SELECT-like queiry). + // now any unrecognized prefix can be worked around with the + // /*SELECT*/ comment prefix. // - if (q.compare (0, 7, "SELECT ") == 0) + if (q.compare (0, 7, "SELECT ") == 0 || + q.compare (0, 5, "WITH ") == 0) vq.kind = view_query::complete_select; else if (q.compare (0, 5, "EXEC ") == 0 || q.compare (0, 5, "CALL ") == 0 || @@ -1200,21 +1200,30 @@ namespace relational vq.literal = string (vq.literal, q[8] == ' ' ? 9 : 8); vq.kind = view_query::complete_execute; } + // + // Hint that what follows is a SELECT-like query. + // + else if (q.compare (0, 10, "/*SELECT*/") == 0) + { + vq.literal = string (vq.literal, q[10] == ' ' ? 11 : 10); + vq.kind = view_query::complete_select; + } else vq.kind = view_query::condition; } else if (!vq.expr.empty ()) { - // If the first token in the expression is a string and - // it starts with "SELECT " or is equal to "SELECT" or - // one of the stored procedure call keywords, then we - // have a complete query. + // If the first token in the expression is a string and it starts + // with "SELECT " or is equal to "SELECT" (or equivalent) or one + // of the stored procedure call keywords, then we have a complete + // query. // if (vq.expr.front ().type == CPP_STRING) { string q (upcase (vq.expr.front ().literal)); - if (q.compare (0, 7, "SELECT ") == 0 || q == "SELECT") + if (q.compare (0, 7, "SELECT ") == 0 || q == "SELECT" || + q.compare (0, 5, "WITH ") == 0 || q == "WITH") vq.kind = view_query::complete_select; else if (q.compare (0, 5, "EXEC ") == 0 || q == "EXEC" || q.compare (0, 5, "CALL ") == 0 || q == "CALL" || @@ -1226,6 +1235,12 @@ namespace relational string (vq.expr.front ().literal, q[8] == ' ' ? 9 : 8); vq.kind = view_query::complete_execute; } + else if (q.compare (0, 10, "/*SELECT*/") == 0) + { + vq.expr.front ().literal = + string (vq.expr.front ().literal, q[10] == ' ' ? 11 : 10); + vq.kind = view_query::complete_select; + } else vq.kind = view_query::condition; } diff --git a/odb/odb/semantics/elements.cxx b/odb/odb/semantics/elements.cxx index b5793d0..9bc96e4 100644 --- a/odb/odb/semantics/elements.cxx +++ b/odb/odb/semantics/elements.cxx @@ -254,7 +254,8 @@ namespace semantics // namespace) but we only use this function to print names // of anonymous types. // - assert (l.next (t) == CPP_SCOPE); + cpp_ttype tt (l.next (t)); + assert (tt == CPP_SCOPE); continue; } } diff --git a/odb/odb/version.hxx.in b/odb/odb/version.hxx.in index 2bf2ae7..52a5343 100644 --- a/odb/odb/version.hxx.in +++ b/odb/odb/version.hxx.in @@ -45,10 +45,10 @@ // 2.2.0.a1 02019901 // 3.0.0.b2 02999952 // -#define ODB_COMPILER_VERSION_OLD 2049976 +#define ODB_COMPILER_VERSION_OLD 2059951 // ODB interface version: minor, major, and alpha/beta versions. // -#define ODB_VERSION 20476 +#define ODB_VERSION 20551 #endif // ODB_COMPILER_VERSION diff --git a/odb/tests/build/bootstrap.build b/odb/tests/build/bootstrap.build index 5e48571..c6cf800 100644 --- a/odb/tests/build/bootstrap.build +++ b/odb/tests/build/bootstrap.build @@ -3,6 +3,7 @@ project = # Unnamed subproject. +using version using config using dist using test |