pax_global_header00006660000000000000000000000064123262003630014507gustar00rootroot0000000000000052 comment=1bc5a9851195b9c67fd48cc82a4ccba378e63534 vsqlite---0.3.13/000077500000000000000000000000001232620036300134145ustar00rootroot00000000000000vsqlite---0.3.13/.travis.yml000066400000000000000000000014701232620036300155270ustar00rootroot00000000000000language: cpp install: sudo apt-get install libboost-dev libsqlite3-dev compiler: - gcc # Change this to your needs script: ./autogen.sh && ./configure && make env: global: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - secure: "Uxoa7/n6oSuHp1hv6+VSqjwjkmRowFEIY/FgUvA27khM5XovqFPpO/NzeKmJEka7Dmg8VuwHbn5HzHMzEZmewyxTpXSBSpklJ1O0EyvNVvzp/Mc8xmOf03XAqN0vwcEggaaz0jJjUZrWdyJceA9QFBVlBpLJSF6mVcxgAqlGOM8=" addons: coverity_scan: project: name: "vinzenz/vsqlite--" description: "A welldesigned and portable SQLite3 Wrapper for C++" notification_email: evilissimo@gmail.com build_command_prepend: "./autogen.sh && ./configure" build_command: "make -j4" branch_pattern: coverity_scan vsqlite---0.3.13/AUTHORS000066400000000000000000000000501232620036300144570ustar00rootroot00000000000000Vinzenz Feenstra vsqlite---0.3.13/COPYING000066400000000000000000000034511232620036300144520ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ vsqlite---0.3.13/ChangeLog000066400000000000000000000506301232620036300151720ustar00rootroot00000000000000commit 86344362015539e7500e5d3a2bd8d75cf19df496 Author: Vinzenz Feenstra Date: Thu Apr 24 14:08:15 2014 +0200 Fixing coverity issue CID:43719 Uninitialized scalar field This field was a left-over and is unused. Signed-off-by: Vinzenz Feenstra commit 6041bcbf797b7e6527566997df5298874106eff2 Author: Vinzenz Feenstra Date: Wed Apr 23 09:55:54 2014 +0200 Coverity model added Signed-off-by: Vinzenz Feenstra commit e1a6bee8165d6e268264bbff9d32019c88b128f2 Author: Vinzenz Feenstra Date: Wed Apr 23 09:35:26 2014 +0200 Added coverity scan to travis Signed-off-by: Vinzenz Feenstra commit e7a60cb27e96255bd656c7fb975d1bf2e1e1e03d Author: Vinzenz Feenstra Date: Wed Apr 23 09:32:02 2014 +0200 Add coverity status Signed-off-by: Vinzenz Feenstra commit f8e00a38622c82d591a372e522f082d5dac620a8 Author: Vinzenz Feenstra Date: Sun Feb 16 23:01:57 2014 +0100 Updated copyright & removed trailing spaces Signed-off-by: Vinzenz Feenstra commit 9cdaf4a640699d9ae7cd864c631e0ab68fe3967a Author: Vinzenz Feenstra Date: Sun Feb 16 22:47:32 2014 +0100 boost 1.46 on travis builds seems to be broken with clang++ 3.3 -> Disabled tests Signed-off-by: Vinzenz Feenstra commit a5a6a7c644b7f0d4bde409d7b3988eafd17c4e19 Author: Vinzenz Feenstra Date: Sun Feb 16 22:41:00 2014 +0100 Trying to workaround the build error on clang Signed-off-by: Vinzenz Feenstra commit 51cff6a4e15b2bad8adec7878a40fe86d93722f2 Author: Vinzenz Feenstra Date: Sun Feb 16 21:52:15 2014 +0100 Missing { Signed-off-by: Vinzenz Feenstra commit 47cfdd0e7e690bd623c345796c3568c546293705 Author: Vinzenz Feenstra Date: Sun Feb 16 21:50:05 2014 +0100 Trying to workaround the build error on clang Signed-off-by: Vinzenz Feenstra commit a6b95daebb6d123e8612f151dbd16dc4d8f77167 Author: Vinzenz Feenstra Date: Sun Feb 16 21:33:48 2014 +0100 Moving to C++0x to keep at least some support for older compilers Signed-off-by: Vinzenz Feenstra commit 6660679d3232d9a5de71aa03aa7b377de4459780 Merge: 1de25fc db4c120 Author: Vinzenz Feenstra Date: Sun Feb 16 21:29:47 2014 +0100 Merge pull request #5 from mmickey/master Functionality inprovement of transaction calss, also new savepoint class added commit db4c120258451ccca2d8104c25cbaf96f9070a4b Author: mickey mouse Date: Thu Feb 13 00:22:42 2014 +0100 Enabled c++11 flag for strongly typed enums support commit 2abf2c833aea965495c020eac9a762c9f69fec88 Author: mmickey Date: Wed Feb 12 23:59:48 2014 +0100 Update transaction.hpp fixed documentation issue commit 3cba7d7123f9e623417e62329f515aedbd715f50 Author: mmickey Date: Wed Feb 12 23:56:31 2014 +0100 Update savepoint.hpp Changed license, fixed documentation commit 56fbd9732a29145a74311d1b1249e2a80a9ed692 Author: mickey mouse Date: Sun Feb 9 23:38:14 2014 +0100 Added savepoint class and an accessor method to transaction class commit b84bfdb20e77388f06d175f5d19e0d3ee5865a32 Author: mickey mouse Date: Sat Feb 8 14:48:35 2014 +0100 More documentation commit da898cae69c296c7aad4f1f16da7004d5e67b741 Author: mickey mouse Date: Sat Feb 8 00:26:50 2014 +0100 Added missing documentation commit 6fbb41be68a4fa8af2f39cdbe1bc2bd747ae82b2 Author: mickey mouse Date: Fri Feb 7 16:42:33 2014 +0100 Added possibility to define the transaction type on construction/begin. commit 1f82e3cc6e6f7f8822b89ab170afabe84d83feca Author: mickey mouse Date: Fri Feb 7 15:56:42 2014 +0100 Bugfix in transaction class From documentation: "END TRANSACTION is an alias for COMMIT." (http://www.sqlite.org/lang_transaction.html) Removed commit()+end() commands on destructor. Also added a flag in order to avoid commit when no transactions are open. commit 1de25fc868f26ed514679e457431c09b491ec177 Author: Vinzenz Feenstra Date: Fri Feb 7 15:33:56 2014 +0100 Updated README Signed-off-by: Vinzenz Feenstra commit a490c973acb79a3cb1246448e36cb2ae3df3c1d8 Author: Vinzenz Feenstra Date: Fri Feb 7 15:32:04 2014 +0100 Renamed README Signed-off-by: Vinzenz Feenstra commit eda9915f1150690dc70b1a10ad6bd8cabf93995b Author: Vinzenz Feenstra Date: Fri Feb 7 15:30:44 2014 +0100 Build Status Signed-off-by: Vinzenz Feenstra commit 3c53bac5bb563feaa97b935ccdd7f20b974708d3 Author: Vinzenz Feenstra Date: Fri Feb 7 15:25:43 2014 +0100 Updated README Signed-off-by: Vinzenz Feenstra commit e184a14d47a8a75167e409ccc6f53423637f80c5 Author: Vinzenz Feenstra Date: Fri Feb 7 15:24:55 2014 +0100 Updated README Signed-off-by: Vinzenz Feenstra commit b737a0f81afb6c02a571f6e52214bc9cd3fc4579 Author: Vinzenz Feenstra Date: Fri Feb 7 15:11:35 2014 +0100 travis-ci: install boost and sqlite3 development files Signed-off-by: Vinzenz Feenstra commit 586752a4521b376a56dd6c86d47a1ca306ca599d Author: Vinzenz Feenstra Date: Fri Feb 7 15:04:02 2014 +0100 We need autogen.sh Signed-off-by: Vinzenz Feenstra commit 453cc82fc512d4852488d2c3f52ec888a383f06f Author: Vinzenz Feenstra Date: Fri Feb 7 15:00:20 2014 +0100 Adding Travis CI Signed-off-by: Vinzenz Feenstra commit a24503acee03fdd85b2767a3beb47fa0005d2041 Merge: 7b69fa7 d615daa Author: Vinzenz Feenstra Date: Tue Oct 8 02:41:03 2013 -0700 Merge pull request #4 from phpdan/patch-1 Update INSTALL Adds information in how to create a configure script. Note: Alternative is ./autogen.sh commit d615daa1d8b3ad88f35c2a49776dd4aa11f8e3cd Author: phpdan Date: Tue Oct 8 03:15:01 2013 -0400 Update INSTALL Does not include a configure script, so added instructions on how to create one. commit 7b69fa7e4594d78f37bd703189f9686741470da7 Author: Vinzenz Feenstra Date: Tue Aug 27 15:22:04 2013 +0200 Applied dos2unix on all files Solves #3 Signed-off-by: Vinzenz Feenstra commit 759efc9bfd14002223f9df8d9ee9a0953a22e3bb Author: Vinzenz Feenstra Date: Mon Aug 26 15:40:10 2013 +0200 Adding include for using numeric_limits Signed-off-by: Vinzenz Feenstra commit f894f88c7095ff4a004f16042c22fd6f9e0e6469 Author: Vinzenz Feenstra Date: Sun Aug 25 15:14:58 2013 +0200 Build system: Use -std=c++98 instead of -std=c++03 Should fix the build issue on OpenSuse SLES fixes #2 Signed-off-by: Vinzenz Feenstra commit e724f31c0eba95b76b60ce9d4f682e9eee96be0a Author: Vinzenz Feenstra Date: Sun Aug 18 16:49:41 2013 +0200 Update README License details clarified. Fedora 18 and 19 added. commit 3fa8d32c315da7260fb8be2812db74c2e9e98f7b Author: Vinzenz Feenstra Date: Thu Jan 31 09:05:47 2013 +0100 Updated changelog for 0.3.12 Signed-off-by: Vinzenz Feenstra commit d16d225aa06c2600be7f8a0403099e5f0b779c76 Author: Vinzenz Feenstra Date: Thu Jan 31 09:03:55 2013 +0100 * Building - Compilation warning for variant.hpp removed - Attempt to obey FHS in configure.ac started - Building now also the example (but not installing it) Signed-off-by: Vinzenz Feenstra commit ad327d8b84bc05699ba4ca4dfe704d4f8b6927c1 Author: Vinzenz Feenstra Date: Thu Jan 31 07:58:58 2013 +0100 * Version bump 0.3.12 Signed-off-by: Vinzenz Feenstra commit 6adfd45108e6f6d2a80a6abe4753bcc1568aa7d0 Author: Vinzenz Feenstra Date: Thu Jan 31 07:57:54 2013 +0100 * Improvement of the build system make install now installs the headers Signed-off-by: Vinzenz Feenstra commit b1d582de4734fd3d73819d3413892bffd0327872 Author: Vinzenz Feenstra Date: Fri Dec 21 16:15:18 2012 +0100 0.3.11 Signed-off-by: Vinzenz Feenstra commit 0d6ff8125d0f0015a6961b188ee413609f42a89f Author: Vinzenz Feenstra Date: Fri Dec 21 16:14:39 2012 +0100 Build error fix Signed-off-by: Vinzenz Feenstra commit 14673c537603318de7ef2eb8a730405c64bf64d8 Author: Vinzenz Feenstra Date: Fri Dec 21 12:45:38 2012 +0100 v0.3.10 Signed-off-by: Vinzenz Feenstra commit bce01dcbbeb530bfa33a1779bfce0c043ab1ceb6 Author: Vinzenz Feenstra Date: Fri Dec 21 12:42:19 2012 +0100 Exposing step bool result to operator() and emit() Signed-off-by: Vinzenz Feenstra commit 36c6404a5cf56f33cfafa715bcb8a83633a6deb1 Author: Vinzenz Feenstra Date: Fri Dec 21 12:38:18 2012 +0100 Adding variant support to result set mysql-workbench currently uses the library patched. This commit is bringing the features used by mysql-workbench to vsqlite++. Signed-off-by: Vinzenz Feenstra commit 62c5b54d704b9b65a25848f6c25ecad4500d8852 Author: Vinzenz Feenstra Date: Fri Dec 21 10:53:54 2012 +0100 Version 0.3.10 from now Signed-off-by: Vinzenz Feenstra commit 3bab77350ad217217eb1e667e70d511d4dfe7165 Author: Vinzenz Feenstra Date: Tue Sep 25 16:43:11 2012 +0200 Examples should be shipped too commit 0685494f222cf54c58e8b8e9ba0b52c34c5bd16c Author: Vinzenz Feenstra Date: Tue Sep 25 16:30:06 2012 +0200 LICENSE -> COPYING, Changelog -> ChangeLog commit 14fb85580d346ca67b73bfd2adc5f8f215192ad5 Author: Vinzenz Feenstra Date: Tue Sep 25 16:05:20 2012 +0200 0.3.9 prep commit bab391eac649736d302e03b1c6ce3a0ceeb555f2 Author: Vinzenz Feenstra Date: Tue Sep 25 16:03:49 2012 +0200 0.3.8 ChangeLog commit b9a22937fdd47e65cd2bbcb71c270b499f4429ed Author: Vinzenz Feenstra Date: Tue Sep 25 13:00:57 2012 +0200 tag/0.3.8 commit dab93f24523708f882c496967af3fa7d6461a878 Author: Vinzenz Feenstra Date: Tue Sep 25 12:58:39 2012 +0200 Updated distribute commit 0b2abd5b1d6ca864cf5dc138dcc3f0f1024a4a8f Author: Vinzenz Feenstra Date: Mon Sep 24 21:54:51 2012 +0200 Prepare configure.ac for 0.3.8 commit 3df606b68f2d522ca10a56752a4d68ddc17332f8 Author: Vinzenz Feenstra Date: Mon Sep 24 21:46:55 2012 +0200 0.3.7 commit 157aa94198b2a2ebbb64df9309cb4d926d4d0528 Author: Vinzenz Feenstra Date: Mon Sep 24 21:46:18 2012 +0200 License fix => BSD 3Clause not MIT commit 88e2042ec6b16ad95a0ae6ae0c856dd3b5e6abc0 Author: Vinzenz Feenstra Date: Mon Sep 24 21:17:33 2012 +0200 0.3.6 ChangeLog update commit 069f9d1ca282fa7f96bbae26d9d9abec6e389151 Author: Vinzenz Feenstra Date: Mon Sep 24 21:15:21 2012 +0200 More make file fixes commit 86b22baab0f2e26345237614dc7af5736fd59d23 Author: Vinzenz Feenstra Date: Mon Sep 24 18:58:19 2012 +0200 libsqlitemm -> libsqlitepp commit 6644d58460ec41d3ba333966122f3e6e16799cfa Author: Vinzenz Feenstra Date: Mon Sep 24 16:01:09 2012 +0200 sed -i 's/\r//' examples/sqlite_wrapper.cpp commit f62b788ec8d948c05c948ddfb090f18f9914b6e4 Author: Vinzenz Feenstra Date: Mon Sep 24 15:53:17 2012 +0200 Updated distribute commit f47e88497d7cc83ebf6848c3d9a3d12f397c3e7a Author: Vinzenz Feenstra Date: Mon Sep 24 15:40:23 2012 +0200 Changing distribute commit a542858adb9d56bb521623164b304cfb611f27de Author: Vinzenz Feenstra Date: Mon Sep 24 15:39:05 2012 +0200 Autogen commit 1c903166ec9535cc712f13d8277d35159b7f5f68 Author: Vinzenz Feenstra Date: Mon Sep 24 15:27:37 2012 +0200 Zip file mask fixed commit ec7f160b3b001b863ab46f7323de370d97474bbd Author: Vinzenz Feenstra Date: Mon Sep 24 15:26:35 2012 +0200 Moving also zip files and being more specific commit 857c14e2151f9d11b616bc1ad336a7d13b3da702 Author: Vinzenz Feenstra Date: Mon Sep 24 15:25:10 2012 +0200 Adding distribute script commit 92f8d98c303027e5248496461b59d37bfd29af26 Author: Vinzenz Feenstra Date: Mon Sep 24 15:16:57 2012 +0200 Bump version 0.3.4 commit ac7565922fe054cfee269700f41024161d36bf25 Author: Vinzenz Feenstra Date: Mon Sep 24 15:12:55 2012 +0200 Adding m4 dir commit 02d5a717a6965e38eb92f15bdb29056df26a31aa Author: Vinzenz Feenstra Date: Mon Sep 24 15:05:43 2012 +0200 Library naming correction commit 925bf001a1b1db6803a9ecf23f52452cab71ad4b Author: Vinzenz Feenstra Date: Mon Sep 24 13:48:07 2012 +0200 Automake... commit a314607b8895ce282242672e9377d3f22da82c02 Author: Vinzenz Feenstra Date: Sat Sep 22 18:01:58 2012 +0200 Line encoding commit 4c8e8b3faa6e494d78493231c390cb4ff6f2164c Author: Vinzenz Feenstra Date: Sat Sep 22 15:55:58 2012 +0200 Fixing build - linking sqlite3 against library commit e4bb2502d8df36688f8596ba0db5bb35ad5ce923 Author: Vinzenz Feenstra Date: Sat Sep 22 14:18:14 2012 +0200 Bump v0.3.2 - updated docs commit 5d1d24cf6e04992128da11cacdbad773d25a6a57 Author: Vinzenz Feenstra Date: Sat Sep 22 14:12:23 2012 +0200 Bump version because of restructuring commit dba1619d3a9919cef36533a7f4511553ee8b9825 Author: Vinzenz Feenstra Date: Fri Sep 21 17:22:37 2012 +0200 * Packaging improvements commit ea4facb73bc4764a9f30743744a7a286f9784a51 Author: Vinzenz Feenstra Date: Tue Aug 21 00:46:57 2012 +0200 Updated doxyfile commit 6921b325dd9a1342f4a81331bb399e5a395ac6b9 Author: Vinzenz Feenstra Date: Tue Aug 21 00:41:15 2012 +0200 New build script commit 28e191387b9f3850e20f1883473d79626c166845 Author: Vinzenz Feenstra Date: Tue Aug 21 00:24:07 2012 +0200 First step of restructuring commit f6767fb7bd622271aa245793785661dab576a34c Author: Vinzenz Feenstra Date: Tue Aug 21 00:18:11 2012 +0200 Removed old build system, libsqlite3 code commit 3efe6eee0d91a7a51f1a91f146a67b2f666dddc7 Author: Vinzenz Feenstra Date: Wed Aug 15 16:10:41 2012 +0200 Updated missing copyright commit 31c8d4e4248a6a26e92f3aff82aa44d6ec0116df Author: Vinzenz Feenstra Date: Wed Aug 15 16:08:55 2012 +0200 Updated author information commit 6da79f41d3d83adb7a9b1228f09fc12add527791 Author: Vinzenz Feenstra Date: Wed Aug 15 16:00:31 2012 +0200 Moving INSTALL and LICENSE too commit 0c9c4bf93c6cf1ddb0aa328d5bc86058150daa4b Author: Vinzenz Feenstra Date: Wed Aug 15 15:59:56 2012 +0200 Moved readme to basefolder commit 9a364238a2b957609e148957792c9c0fb194a952 Author: evilissimo Date: Mon Oct 16 00:12:47 2006 +0000 * Removed docs from svn git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@12 062d0e6d-a41f-0410-a212-cd34bd342b03 commit b4e8fca747fef5f6c0f208e916eb5c4dcf44ca6e Author: evilissimo Date: Mon Oct 16 00:10:49 2006 +0000 * Fixed vsqlite++.vcproj git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@11 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 47cfc0a55afc946dcd5a5a655fe0b2c76aacb781 Author: evilissimo Date: Sun Oct 15 23:40:13 2006 +0000 * Added documentation git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@10 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 0250a07e934dad8d273b4985787e50e7109fac0a Author: evilissimo Date: Sun Oct 15 23:09:04 2006 +0000 * Improved cleanup.sh git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@9 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 53ad3d1164cc16d51945655f9e1eafba52ceab86 Author: evilissimo Date: Sun Oct 15 23:01:30 2006 +0000 * Added build.sh * Added cleanup.sh * Added buildconf files * Fixed options.py git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@8 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 7b09a5dc414884e311181fb891346bc1062464e0 Author: evilissimo Date: Sun Oct 15 22:49:05 2006 +0000 * Added some comments to options.py * Edited Changelog * Wrote a bit in README * Wrote a bit in INSTALL * Changed SConstruct git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@7 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 4c04517150f7e65916e64554b1e1ba06b5b15524 Author: evilissimo Date: Sun Oct 15 22:19:26 2006 +0000 * Added options.py * Added SConscript * Added SConstruct * Started modifying MSVC++ Projectfiles git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@6 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 8eb683590444191ad13f824bb8db43a981452294 Author: evilissimo Date: Sun Oct 15 21:54:22 2006 +0000 * Renamed lib dir to libs git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@5 062d0e6d-a41f-0410-a212-cd34bd342b03 commit f55d379bcdcec37dba94898de0835445448161ca Author: evilissimo Date: Sun Oct 15 21:53:49 2006 +0000 * Added lib dir git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@4 062d0e6d-a41f-0410-a212-cd34bd342b03 commit afdcee16c09077327c61e91673e439e284ead35a Author: evilissimo Date: Sun Oct 15 21:53:06 2006 +0000 removed binary git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@3 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 6b1f8eaeb0fdecdcbc053934d40ff298b95c0273 Author: evilissimo Date: Sun Oct 15 21:48:52 2006 +0000 * Added scons * Renamed sqlite_wrapper directory git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@2 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 30b102050f8053cc49f8db61a9cd89f25ef58e9e Author: evilissimo Date: Thu Oct 12 22:58:30 2006 +0000 Initial import git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@1 062d0e6d-a41f-0410-a212-cd34bd342b03 vsqlite---0.3.13/Doxyfile000066400000000000000000000211111232620036300151160ustar00rootroot00000000000000# Doxyfile 1.4.6 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "VSQLite++" PROJECT_NUMBER = 0.3 OUTPUT_DIRECTORY = ./ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = ./ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = NO FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ./include FILE_PATTERNS = *.hpp RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = YES TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = YES GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = YES DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = YES vsqlite---0.3.13/INSTALL000066400000000000000000000371361232620036300144570ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `libtoolize --force' `aclocal' `autoheader' `automake --force-missing --add-missing' `autoconf' autoconf and the four preceding commands will create a configure script for you `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. vsqlite---0.3.13/Makefile.am000066400000000000000000000015371232620036300154560ustar00rootroot00000000000000LIBVSQLITE_VERSION=`cat VERSION` AUTOMAKE_OPTIONS = subdir-objects foreign ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 AM_CXXFLAGS = -W -Wall -pedantic -O3 -W -std=c++0x lib_LTLIBRARIES = libvsqlitepp.la libvsqlitepp_la_CXXFLAGS = -I include $(AM_CXXFLAGS) libvsqlitepp_la_LDFLAGS = -lsqlite3 -Wl,--as-needed -Wl,-soname -Wl,libvsqlitepp.so.3 -version-info 3:0:0 libvsqlitepp_la_SOURCES = \ src/sqlite/command.cpp \ src/sqlite/connection.cpp \ src/sqlite/savepoint.cpp \ src/sqlite/execute.cpp \ src/sqlite/query.cpp \ src/sqlite/result.cpp \ src/sqlite/transaction.cpp \ src/sqlite/view.cpp \ $(NULL) noinst_PROGRAMS=vsqlitepp_example vsqlitepp_example_CXXFLAGS=-I include $(AM_CXXFLAGS) vsqlitepp_example_LDADD = libvsqlitepp.la vsqlitepp_example_SOURCES = \ examples/sqlite_wrapper.cpp \ $(NULL) SUBDIRS=include EXTRA_DIST=Doxyfile build examples vsqlite---0.3.13/NEWS000066400000000000000000000000001232620036300141010ustar00rootroot00000000000000vsqlite---0.3.13/README000077700000000000000000000000001232620036300155462README.mdustar00rootroot00000000000000vsqlite---0.3.13/README.md000066400000000000000000000013631232620036300146760ustar00rootroot00000000000000[![Build Status](https://travis-ci.org/vinzenz/vsqlite--.png?branch=master)](https://travis-ci.org/vinzenz/vsqlite--) [![Coverity Scan Build Status](https://scan.coverity.com/projects/1976/badge.svg)](https://scan.coverity.com/projects/1976) VSQLite++ - A welldesigned and portable SQLite3 Wrapper for C++ (C) 2006-2014 by virtuosic bytes - vinzenz.feenstra@gmail.com Author: Vinzenz Feenstra License: BSD-3 # Supported Compilers - g++ 4.x - MSVC 2005-2013 - Clang 3.x # Operating Systems - Linux - Windows - Mac OS X # Dependencies - Boost Libraries [ http://www.boost.org ] >= 1.33 - libsqlite3 Additional notices: - Please let me know if you want to suggest features - Contributions are welcome - Proposals for Design Improvement are welcome vsqlite---0.3.13/TODO000066400000000000000000000000351232620036300141020ustar00rootroot00000000000000* Writing build instructions vsqlite---0.3.13/VERSION000066400000000000000000000000071232620036300144610ustar00rootroot000000000000000.3.13 vsqlite---0.3.13/autogen.sh000077500000000000000000000001401232620036300154100ustar00rootroot00000000000000#!/bin/sh echo "Generating autobuild environment..." autoreconf --install --force > /dev/null vsqlite---0.3.13/build/000077500000000000000000000000001232620036300145135ustar00rootroot00000000000000vsqlite---0.3.13/build/packaging.sh000077500000000000000000000012021232620036300167710ustar00rootroot00000000000000#!/bin/sh VSQLITE_CURRENT=0 VSQLITE_REVISION=3 VSQLITE_AGE=0 VSQLITE_LIBRARY=libvsqlite++.so VSQLITE_CURRENT_LIBRARY=$VSQLITE_LIBRARY.$VSQLITE_CURRENT VSQLITE_FULL_LIBRARY=$VSQLITE_CURRENT_LIBRARY.$VSQLITE_REVISION.$VSQLITE_AGE SOURCE="${BASH_SOURCE[0]}" DIR="$( dirname "$SOURCE" )" while [ -h "$SOURCE" ] do SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" mv $VSQLITE_LIBRARY $VSQLITE_FULL_LIBRARY ln -s $VSQLITE_FULL_LIBRARY $VSQLITE_CURRENT_LIBRARY ln -s $VSQLITE_FULL_LIBRARY $VSQLITE_LIBRARY vsqlite---0.3.13/build/premake4.lua000066400000000000000000000027121232620036300167300ustar00rootroot00000000000000 --- Solution solution "vsqlite++" configurations { "Debug", "Release" } --- The library evipp definition project "vsqlite++-static" kind "StaticLib" language "C++" targetname "vsqlite++" files { "../include/**.hpp", "../src/sqlite/**.cpp" } includedirs { "../include" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } project "vsqlite++-shared" kind "SharedLib" language "C++" targetname "vsqlite++" files { "../include/**.hpp", "../src/sqlite/**.cpp" } includedirs { "../include" } links { "sqlite3" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } configuration {"linux", "gmake"} linkoptions { "-Wl,--as-needed", "-Wl,-soname,libvsqlite++.so.0" } --- The unit test definition project "vsqlite_example" kind "ConsoleApp" language "C++" files { "../examples/**.cpp" } includedirs { "../include" } links { "vsqlite++-shared" } --- Configuration settings configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } vsqlite---0.3.13/configure.ac000066400000000000000000000027351232620036300157110ustar00rootroot00000000000000AC_INIT([libvsqlite++],[0.3.13], [evilissimo@gmail.com], [vsqlite++], [http://github.com/vinzenz/vsqlite--]) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CXX LT_INIT dnl ------------------------------------------- dnl test "$prefix" = "NONE" && prefix=/usr/local dnl test "$exec_prefix" = "NONE" && exec_prefix=/usr/local dnl test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var dnl test "$localstatedir" = '${prefix}/var' && localstatedir=/var dnl dnl if test "$prefix" = /usr; then dnl if test "${sysconfdir}" = "\${prefix}/etc"; then dnl sysconfdir=/etc dnl fi dnl if test "$sharedstatedir" = '\${prefix}/com'; then dnl sharedstatedir=/var dnl fi dnl if test "$localstatedir" = '\${prefix}/var'; then dnl localstatedir=/var dnl fi dnl fi dnl dnl if test "$libdir" = "\${exec_prefix}/lib"; then dnl if test -e ${exec_prefix}/lib64; then dnl libdir='${exec_prefix}/lib64' dnl fi dnl fi dnl ------------------------------------------- AC_CONFIG_FILES([Makefile include/Makefile]) AC_OUTPUT dnl ------------------------------------------- dnl echo "prefix..........."${prefix} dnl echo "exec_prefix......"${exec_prefix} dnl echo "bindir..........."${bindir} dnl echo "libdir..........."${libdir} dnl echo "sharedstatedir..."${sharedstatedir} dnl echo "localstatedir...."${localstatedir} dnl echo "sysconfdir......."${sysconfdir} dnl echo "oldsysconfdir...."${old_sys_conf_dir} dnl ------------------------------------------- vsqlite---0.3.13/examples/000077500000000000000000000000001232620036300152325ustar00rootroot00000000000000vsqlite---0.3.13/examples/sqlite_wrapper.cpp000066400000000000000000000052351232620036300210040ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include int main() { try { sqlite::connection con("test.db"); sqlite::execute(con,"Create Table test(id INTEGER PRIMARY KEY, name TEXT);",true); sqlite::execute ins(con,"INSERT INTO TEST VALUES(?,?);"); ins % sqlite::nil % "Hallo"; ins(); ins.clear(); ins % sqlite::nil % "Test"; ins.emit(); sqlite::query q(con,"SELECT * from test;"); boost::shared_ptr res = q.emit_result(); do{ std::cout << res->get_int(0) << "|" << res->get_string(1) << std::endl; } while(res->next_row()); sqlite::execute(con,"DROP TABLE test;",true); sqlite::execute(con,"VACUUM;",true); } catch (std::exception const & e) { std::cout << "EXCEPTION: " << e.what() << std::endl; } return 0; } vsqlite---0.3.13/include/000077500000000000000000000000001232620036300150375ustar00rootroot00000000000000vsqlite---0.3.13/include/Makefile.am000066400000000000000000000006131232620036300170730ustar00rootroot00000000000000nobase_include_HEADERS = \ sqlite/command.hpp \ sqlite/database_exception.hpp \ sqlite/query.hpp \ sqlite/transaction.hpp \ sqlite/connection.hpp \ sqlite/execute.hpp \ sqlite/result.hpp \ sqlite/view.hpp \ sqlite/ext/variant.hpp \ $(NULL) noinst_HEADERS=\ sqlite/private/private_accessor.hpp \ sqlite/private/result_construct_params_private.hpp \ $(NULL) vsqlite---0.3.13/include/sqlite/000077500000000000000000000000001232620036300163405ustar00rootroot00000000000000vsqlite---0.3.13/include/sqlite/command.hpp000066400000000000000000000171031232620036300204710ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_COMMAND_HPP_INCLUDED #define GUARD_SQLITE_COMMAND_HPP_INCLUDED #include #include #include #include struct sqlite3_stmt; namespace sqlite{ /** \brief \a null_type is an empty type used to represent NULL * values */ struct null_type{}; /** \brief \a nil is used instead of NULL within the operator % * syntax in this wrapper */ extern null_type nil; /** \brief \a command is the base class of all sql command classes * An object of this class is not copyable */ struct command : boost::noncopyable{ /** \brief \a command constructor * \param con takes a reference to the database connection type * \a connection * \param sql is the SQL string. The sql string can contain placeholder * the question mark '?' is used as placeholder the * \a command::bind methods or command::operator% syntax must be * used to replace the placeholders */ command(connection & con, std::string const & sql); /** \brief \a command destructor */ virtual ~command(); /** \brief clear is used if you'd like to reuse a command object */ void clear(); /** \brief emit executes the sql command * If you have used placeholders you must have replaced all * placeholders */ bool emit(); /** \brief works exactly like the method \a command::emit * */ bool operator()(); /** \brief binds NULL to the given 1 based index * */ void bind(int idx); /** \brief binds the 32-Bit integer v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v 32-Bit integer value which should replace the placeholder */ void bind(int idx, int v); /** \brief binds the 64-Bit integer v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v 64-Bit integer value which should replace the placeholder */ void bind(int idx, boost::int64_t v); /** \brief binds the double v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v double value which should replace the placeholder */ void bind(int idx, double v); /** \brief binds the text/string v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v text/string value which should replace the placeholder */ void bind(int idx, std::string const & v); /** \brief binds the binary/blob buf to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param buf binary/blob buf which should replace the placeholder * \param buf_size size in bytes of the binary buffer */ void bind(int idx, void const * buf, size_t buf_size); /** \brief binds the binary/blob v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v binary/blob buffer which should replace the placeholder * v is a std::vector const & */ void bind(int idx, std::vector const & v); /** \brief replacement for void command::bind(int idx); * To use this operator% you have to use the global object * \a nil * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be \a nil */ command & operator % (null_type const & p); /** \brief replacement for void command::bind(int idx,int); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be a 32-Bit integer */ command & operator % (int p); /** \brief replacement for void command::bind(int idx,boost::int64_t); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be a 64-Bit integer */ command & operator % (boost::int64_t p); /** \brief replacement for void command::bind(int idx,double); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p a double variable */ command & operator % (double p); /** \brief replacement for void command::bind(int idx,std::string const&); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be a Zero Terminated C-style string (char * or * char const*), or a std::string object, */ command & operator % (std::string const & p); /** \brief replacement for void command::bind(int idx,std::vector const&); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p a constant reference to a std::vector object * (For blob/binary data) */ command & operator % (std::vector const & p); protected: void access_check(); bool step(); struct sqlite3 * get_handle(); private: void prepare(); void finalize(); private: connection & m_con; std::string m_sql; protected: sqlite3_stmt * stmt; private: int last_arg_idx; }; } #endif //GUARD_SQLITE_COMMAND_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/connection.hpp000066400000000000000000000073751232620036300212240ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_CONNECTION_HPP_INCLUDED #define GUARD_SQLITE_CONNECTION_HPP_INCLUDED #include #include struct sqlite3; namespace sqlite{ /** \brief connection is used to open, close, attach and detach a database. * Further it has to be passed to all classes since it represents the * connection to the database and contains the internal needed handle, so * you can see a connection object as handle to the database * An object of this class is not copyable */ struct connection : boost::noncopyable{ /** \brief constructor opens the database * \param db filename of the database file * if the given file already exists the file will be opened * as database. * If the file does not exist a new database will be created */ connection(std::string const & db); /** \brief destructor closes the database automatically * */ ~connection(); /** \brief attaches another database file to the database represented by * the object of this class. It is possible to attach up to 10 times * the same database file with different aliases * \param db database filename of the database should be attached * \param database_alias alias which should be used */ void attach(std::string const & db, std::string const & database_alias); /** \brief detaches a database via alias, if the same database was * attached with several names they will be still present * \param database_alias of the database (must be the same alias which * was passed in the attach() call) */ void detach(std::string const & database_alias); private: friend struct private_accessor; private: void open(std::string const & db); void close(); void access_check(); private: sqlite3 * handle; }; } #endif //GUARD_SQLITE_CONNECTION_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/database_exception.hpp000066400000000000000000000047201232620036300226760ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_DATABASE_EXCEPTION_HPP_INCLUDED #define GUARD_SQLITE_DATABASE_EXCEPTION_HPP_INCLUDED #include #include namespace sqlite{ struct database_exception : public std::runtime_error { database_exception(std::string const & msg) : std::runtime_error(msg.c_str()){} }; struct buffer_too_small_exception : public std::runtime_error{ buffer_too_small_exception(std::string const & msg) : std::runtime_error(msg.c_str()){} }; struct database_misuse_exception : public std::logic_error{ database_misuse_exception(std::string const & msg) : std::logic_error(msg){} }; } #endif //GUARD_SQLITE_DATABASE_EXCEPTION_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/execute.hpp000066400000000000000000000052731232620036300205220ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_EXECUTE_HPP_INCLUDED #define GUARD_SQLITE_EXECUTE_HPP_INCLUDED #include namespace sqlite{ /** \brief execute can be used for SQL commands which should executed * the constructor is defined in a way that it can be used like a function * An object of this class is not copyable */ struct execute : command{ /** \brief constructor * \param con reference to the connection object which should be used * \param sql the SQL statement which should be executed * \param immediately if it is true the sql command will be immediately * executed if it is false the command will be executed after an * emit or operator() call */ execute(connection & con, std::string const & sql, bool immediately = false); /** \brief destructor * */ virtual ~execute(); }; } #endif //GUARD_SQLITE_EXECUTE_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/ext/000077500000000000000000000000001232620036300171405ustar00rootroot00000000000000vsqlite---0.3.13/include/sqlite/ext/variant.hpp000066400000000000000000000047051232620036300213230ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2012-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_EXT_VARIANT_HPP_INCLUDED #define GUARD_SQLITE_EXT_VARIANT_HPP_INCLUDED #include #include #include #include #include namespace sqlite{ enum type { unknown, null, integer, real, text, blob }; struct unknown_t{}; struct null_t{}; typedef std::vector blob_t; typedef boost::shared_ptr blob_ref_t; typedef boost::variant< unknown_t, int, boost::int64_t, long double, std::string, null_t, blob_ref_t > variant_t; } #endif //GUARD_SQLITE_EXT_VARIANT_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/private/000077500000000000000000000000001232620036300200125ustar00rootroot00000000000000vsqlite---0.3.13/include/sqlite/private/private_accessor.hpp000066400000000000000000000044111232620036300240570ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_PRIVATE_PRIVATE_ACCESSOR_HPP_INCLUDED #define GUARD_SQLITE_PRIVATE_PRIVATE_ACCESSOR_HPP_INCLUDED #include namespace sqlite{ /** \brief A internal used class, shall not be used from users * */ struct private_accessor{ static struct sqlite3 * get_handle(connection & m_con){ return m_con.handle; } static void acccess_check(connection & m_con){ m_con.access_check(); } }; } #endif// GUARD_SQLITE_PRIVATE_PRIVATE_ACCESSOR_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/private/result_construct_params_private.hpp000066400000000000000000000043531232620036300272470ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_RESULT_CONSTRUCT_PARAMS_PRIVATE_HPP_INCLUDED #define GUARD_SQLITE_RESULT_CONSTRUCT_PARAMS_PRIVATE_HPP_INCLUDED #include struct sqlite3; struct sqlite3_stmt; namespace sqlite{ struct query; struct result_construct_params_private{ sqlite3 * db; sqlite3_stmt * statement; int row_count; boost::function0 access_check; boost::function0 step; }; } #endif //GUARD_SQLITE_RESULT_CONSTRUCT_PARAMS_PRIVATE_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/query.hpp000066400000000000000000000055061232620036300202240ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_QUERY_HPP_INCLUDED #define GUARD_SQLITE_QUERY_HPP_INCLUDED #include #include #include namespace sqlite{ /** \brief query should be used to execute SQL queries * An object of this class is not copyable */ struct query : command { /** \brief constructor * \param con reference to the connection which should be used * \param sql is the SQL query statement */ query(connection & con, std::string const & sql); /** \brief destructor * */ virtual ~query(); /** \brief executes the sql command * \return result_type which is boost::shared_ptr */ result_type emit_result(); /** \brief returns the results (needs a previous emit() call) * \return result_type which is boost::shared_ptr */ result_type get_result(); private: friend struct result; void access_check(); bool step(); }; } #endif //GUARD_SQLITE_QUERY_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/result.hpp000066400000000000000000000133231232620036300203710ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_RESULT_HPP_INCLUDED #define GUARD_SQLITE_RESULT_HPP_INCLUDED #include #include namespace sqlite{ struct query; struct result_construct_params_private; /** \brief result can only be created by a query object. * An object of this class is not copyable. * */ struct result : boost::noncopyable{ private: typedef boost::shared_ptr construct_params; friend struct query; result(construct_params); public: /** \brief destructor * */ ~result(); /** \brief Increases the row index * \return returns false if there is no more row, otherwise it returns * true */ bool next_row(); /** \brief Returns the number of rows in the result * \return an integer */ int get_row_count(); /** \brief Returns the number of columns * \return an integer */ int get_column_count(); /** \brief Returns the type of the column * \param idx column index of the current row in the results * \return the column type */ type get_column_type(int idx); /** \brief Returns the type of the column * \param idx column index of the current row in the results * \return a string */ std::string get_column_decltype(int idx); /** \brief Retrieves a the current typ into variant_t * \param idx column index of the current row in the results * \return a value of variant_t */ variant_t get_variant(int index); /** \brief Returns the data at the given index as 32-Bit Integer * \return a 32-Bit Integer */ int get_int(int idx); /** \brief Returns the data at the given index as 64-Bit Integer * \param idx column index of the current row in the results * \return a 64-Bit Integer */ boost::int64_t get_int64(int idx); /** \brief Returns the data at the given index as String * \param idx column index of the current row in the results * \return a std::string object */ std::string get_string(int idx); /** \brief Returns the data at the given index as double * \param idx column index of the current row in the results * \return a double */ double get_double(int idx); /** \brief Returns the size of the data at the given index in bytes * \param idx column index of the current row in the results * \return a size_t value which represents the number of bytes needed * for the binary data at idx */ size_t get_binary_size(int idx); /** \brief Used to retrieve a binary value * \param idx column index of the current row in the results * \param buf pointer to the buffer which should be filled * \param buf_size size in bytes of the buffer */ void get_binary(int idx, void * buf, size_t buf_size); /** \brief Used to retrieve a binary value * \param idx column index of the current row in the results * \param vec a std::vector which will be filled * the method will increase the allocated buffer if needed */ void get_binary(int idx, std::vector & vec); /** \brief Returns the column name at the given index * \param idx column index of the current row in the results * \return a std::string object containing the name of the column */ std::string get_column_name(int idx); private: void access_check(int); private: construct_params m_params; int m_columns; int m_row_count; }; typedef boost::shared_ptr result_type; } #endif //GUARD_SQLITE_RESULT_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/savepoint.hpp000066400000000000000000000072641232620036300210720ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2014 mickey mickey.mouse-1985@libero.it All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_SAVEPOINT_HPP_INCLUDED #define GUARD_SQLITE_SAVEPOINT_HPP_INCLUDED #include namespace sqlite{ struct connection; /** \brief this is a helper class to handle transaction savepoints * within SQLite */ struct savepoint{ public: /** \brief constructor * \param con a reference to the connection object where the * transaction should be started/ended/committed or rolled back * \param name alias for the savepoint */ savepoint(connection & con, std::string const & name); /** \brief destructor * */ ~savepoint(); /** \brief Releases a previously created savepoint * */ void release(); /** \brief Roll the database status back to the position of the current * saveopint. */ void rollback(); /** \brief Allow to check if savepoint handled by this object is * currently active. * \note This dues not make any checks inside SQlite's internal data * so if a previously-made savepoint is alredy released or rollbacked * (committing or rollbacking also this one) this method will continue * to say that the savepoint is active. * \return \c true if savepoint is still active, \c false otherwise */ bool isActive() const { return m_isActive; } /** \brief Returns a string containing the current savepoint name * \return The alias of savepoint handled by this object */ std::string getName() const { return m_name; } private: void exec(std::string const &); connection & m_con; ///< SQlite connection handler std::string m_name; ///< The alias for the savepoint bool m_isActive; ///< if \c true the savepoint with alias \c m_name is still active (not currently released) }; } #endif //GUARD_SQLITE_SAVEPOINT_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/transaction.hpp000066400000000000000000000100051232620036300213720ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com Copyright (c) 2014 mickey mickey.mouse-1985@libero.it All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_TRANSACTION_HPP_INCLUDED #define GUARD_SQLITE_TRANSACTION_HPP_INCLUDED namespace sqlite{ struct connection; /** \brief Defines the kind of transaction to begin. * * \see http://www.sqlite.org/lang_transaction.html for documentation * about transaction kind. * * When no transaction type is defined (\c undefined) the default behaviour * is to create a deferred transaction, but the \c undefined constant is * because maybe in future the default behaviour may change. * * Note that for more type safety this needs Strongly Typed enums C++11 * feature: * http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf */ enum class transaction_type { undefined, deferred, immediate, exclusive }; /** \brief transaction is a helper class to start transactions within SQLite * */ struct transaction{ public: /** \brief constructor * \param con a reference to the connection object where the * transaction should be started/ended/committed or rolled back * \param type define the transaction type */ transaction(connection & con, transaction_type type = transaction_type::undefined); /** \brief destructor * */ ~transaction(); /** \brief Starts a transaction * \param type define the transaction type */ void begin(transaction_type type = transaction_type::undefined); /** \brief Ends an transaction * */ void end(); /** \brief Commits a transaction * */ void commit(); /** \brief Rolls back a transaction * */ void rollback(); /** \brief Allow to check if transaction handled by this object is * currently active * \return \c true if transaction is still active, \c false otherwise */ bool isActive() const { return m_isActive; } private: void exec(std::string const &); connection & m_con; bool m_isActive; ///< if \c true there is a transaction currently opened }; } #endif //GUARD_SQLITE_TRANSACTION_HPP_INCLUDED vsqlite---0.3.13/include/sqlite/view.hpp000066400000000000000000000074511232620036300200320ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_VIEW_HPP_INCLUDED #define GUARD_SQLITE_VIEW_HPP_INCLUDED namespace sqlite{ struct connection; /** \brief view is used to create views. In SQLite a view can only be * queried. INSERT, DELETE and UPDATE will fail on a view */ struct view { public: /** \brief constructor * \param con a reference to the connection object which should be used */ view(connection & con); /** \brief destructor * */ ~view(); /** \brief creates a view * \param temporary if this parameter is true the view will be present * until drop will be called or the database was closed * \param alias the name of this view which should be used * \param sql_query the SQL statement which represents the view */ void create(bool temporary, std::string const & alias, std::string const & sql_query); /** \brief creates a view * \param temporary if this parameter is true the view will be present * until drop will be called or the database was closed * \param database name of the database where the view should be * created in * \param alias the name of this view which should be used * \param sql_query the SQL statement which represents the view */ void create(bool temporary, std::string const & database, std::string const & alias, std::string const & sql_query); /** \brief drops a view * \param alias name of the view which should be dropped */ void drop(std::string const & alias); /** \brief drops a view * \param database name of the database where the view was created in * \param alias name of the view which should be dropped */ void drop(std::string const & database, std::string const & alias); private: connection & m_con; }; } #endif //GUARD_SQLITE_VIEW_HPP_INCLUDED vsqlite---0.3.13/m4/000077500000000000000000000000001232620036300137345ustar00rootroot00000000000000vsqlite---0.3.13/m4/.gitkeep000066400000000000000000000000001232620036300153530ustar00rootroot00000000000000vsqlite---0.3.13/misc/000077500000000000000000000000001232620036300143475ustar00rootroot00000000000000vsqlite---0.3.13/misc/coverity/000077500000000000000000000000001232620036300162135ustar00rootroot00000000000000vsqlite---0.3.13/misc/coverity/coverity_model.cpp000066400000000000000000000013111232620036300217370ustar00rootroot00000000000000/* Coverity Scan model * * This is a modeling file for Coverity Scan. Modeling helps to avoid false * positives. * * - A model file can't import any header files. * - Therefore only some built-in primitives like int, char and void are * available but not wchar_t, NULL etc. * - Modeling doesn't need full structs and typedefs. Rudimentary structs * and similar types are sufficient. * - An uninitialized local pointer is not an error. It signifies that the * variable could be either NULL or have some data. * * Coverity Scan doesn't pick up modifications automatically. The model file * must be uploaded by an admin in the analysis settings of * http://scan.coverity.com/projects/1976 */ vsqlite---0.3.13/scripts/000077500000000000000000000000001232620036300151035ustar00rootroot00000000000000vsqlite---0.3.13/scripts/distribute.sh000077500000000000000000000011471232620036300176230ustar00rootroot00000000000000#!/bin/sh DIST_VERSION=`cat VERSION` DIST_NAME='vsqlite++' DIST_FULL=$DIST_NAME-$DIST_VERSION echo "Generating $DIST_FULL..." git clean -d -f #git archive tags/$DIST_VERSION --format=tar --prefix="$DIST_FULL/" | bzip2 > $DIST_FULL.tar.bz2 #git archive tags/$DIST_VERSION --format=tar --prefix="$DIST_FULL/" | gzip > $DIST_FULL.tar.gz #git archive tags/$DIST_VERSION --format=tar --prefix="$DIST_FULL/" | xz -c > $DIST_FULL.tar.xz #git archive tags/$DIST_VERSION --format=zip --prefix="$DIST_FULL/" > $DIST_FULL.zip ./autogen.sh ./configure --prefix=/usr make dist-gzip make dist-bzip2 make dist-xz make dist-zip vsqlite---0.3.13/src/000077500000000000000000000000001232620036300142035ustar00rootroot00000000000000vsqlite---0.3.13/src/sqlite/000077500000000000000000000000001232620036300155045ustar00rootroot00000000000000vsqlite---0.3.13/src/sqlite/command.cpp000066400000000000000000000132251232620036300176310ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ null_type nil = null_type(); command::command(connection & con, std::string const & sql) : m_con(con),m_sql(sql),stmt(0),last_arg_idx(0){ private_accessor::acccess_check(con); prepare(); } command::~command(){ try{ finalize(); } catch(...){ } } void command::finalize(){ access_check(); if(sqlite3_finalize(stmt) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); stmt = 0; } void command::clear(){ sqlite3_reset(stmt); last_arg_idx = 0; sqlite3_reset(stmt); } void command::prepare(){ private_accessor::acccess_check(m_con); if(stmt) finalize(); const char * tail = 0; if(sqlite3_prepare(get_handle(),m_sql.c_str(),-1,&stmt,&tail) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } bool command::emit(){ return step(); } bool command::step(){ access_check(); switch(sqlite3_step(stmt)){ case SQLITE_ROW: return true; case SQLITE_DONE: return false; case SQLITE_MISUSE: throw database_misuse_exception(sqlite3_errmsg(get_handle())); default: throw database_exception(sqlite3_errmsg(get_handle())); } return false; } bool command::operator()(){ return step(); } void command::bind(int idx){ access_check(); if(sqlite3_bind_null(stmt,idx) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, int v){ access_check(); if(sqlite3_bind_int(stmt,idx,v) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, boost::int64_t v){ access_check(); if(sqlite3_bind_int64(stmt,idx,v) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, double v){ access_check(); if(sqlite3_bind_double(stmt,idx,v) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, std::string const & v){ access_check(); if(sqlite3_bind_text(stmt,idx,v.c_str(),int(v.size()),SQLITE_TRANSIENT) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, void const * v , size_t vn){ access_check(); if(sqlite3_bind_blob(stmt,idx,v,int(vn),SQLITE_TRANSIENT) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, std::vector const & v) { bind(idx,&v.at(0),v.size()); } void command::access_check(){ private_accessor::acccess_check(m_con); if(!stmt) throw database_exception("command was not prepared or is invalid"); } command & command::operator % (null_type const &){ bind(++last_arg_idx); return *this; } command & command::operator % (int v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (boost::int64_t v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (double v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (std::string const & v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (std::vector const & v) { bind(++last_arg_idx,v); return *this; } struct sqlite3 * command::get_handle(){ return private_accessor::get_handle(m_con); } } vsqlite---0.3.13/src/sqlite/connection.cpp000066400000000000000000000057151232620036300203570ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include #include namespace sqlite{ connection::connection(std::string const & db) : handle(0){ open(db); } connection::~connection(){ try{ close(); } catch(...){ } } void connection::open(const std::string &db){ if(sqlite3_open(db.c_str(),&handle) != SQLITE_OK) throw database_exception("Could not open database"); } void connection::close(){ access_check(); if(sqlite3_close(handle) != SQLITE_OK) throw database_exception(sqlite3_errmsg(handle)); handle = 0; } void connection::access_check(){ if(!handle) throw database_exception("Database is not open."); } void connection::attach(std::string const & db, std::string const & alias){ boost::format fmt("ATTACH DATABASE %1% AS %2%;"); fmt % db % alias; execute(*this,fmt.str(),true); } void connection::detach(std::string const & alias){ boost::format fmt("DETACH DATABASE %1%;"); fmt % alias; execute(*this,fmt.str(),true); } } vsqlite---0.3.13/src/sqlite/execute.cpp000066400000000000000000000037111232620036300176540ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include namespace sqlite{ execute::execute(connection & con, std::string const & sql, bool immediately) : command(con,sql){ if(immediately) emit(); } execute::~execute(){ } } vsqlite---0.3.13/src/sqlite/query.cpp000066400000000000000000000053301232620036300173560ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ query::query(connection & con, std::string const & sql) : command(con,sql) { } query::~query(){ } boost::shared_ptr query::emit_result(){ step(); return get_result(); } boost::shared_ptr query::get_result(){ access_check(); result_construct_params_private * p = new result_construct_params_private(); p->access_check = boost::bind(&query::access_check,this); p->step = boost::bind(&query::step,this); p->db = sqlite3_db_handle(stmt); p->row_count = sqlite3_changes(p->db); p->statement = stmt; return boost::shared_ptr(new result(result::construct_params(p))); } void query::access_check(){ command::access_check(); } bool query::step(){ return command::step(); } } vsqlite---0.3.13/src/sqlite/result.cpp000066400000000000000000000150751232620036300175360ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include #include #include #include namespace sqlite{ result::result(construct_params p) : m_params(p) { m_params->access_check(); m_columns = sqlite3_column_count(m_params->statement); m_row_count = m_params->row_count; } result::~result(){ } bool result::next_row(){ return m_params->step(); } std::string result::get_column_decltype(int idx) { access_check(idx); return sqlite3_column_decltype(m_params->statement,idx); } type result::get_column_type(int idx) { access_check(idx); switch(sqlite3_column_type(m_params->statement,idx)) { case SQLITE_BLOB: return sqlite::blob; case SQLITE_NULL: return sqlite::null; case SQLITE_FLOAT: return sqlite::real; case SQLITE_INTEGER: return sqlite::integer; case SQLITE_TEXT: return sqlite::text; default: break; } return sqlite::unknown; } variant_t result::get_variant(int idx) { variant_t v; switch( get_column_type(idx) ) { case sqlite::integer: { boost::int64_t i = get_int64(idx); if( i > std::numeric_limits::max() || i < std::numeric_limits::min() ) { v = i; } else { v = int(i); } } break; case sqlite::blob: v = boost::make_shared(); get_binary(idx, *boost::get(v)); break; case sqlite::real: { long double x = get_double(idx); v = x; } break; case sqlite::null: v = null_t(); break; default: case sqlite::text: v = get_string(idx); break; } return v; } int result::get_int(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0; return sqlite3_column_int(m_params->statement,idx); } boost::int64_t result::get_int64(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0; return sqlite3_column_int64(m_params->statement,idx); } std::string result::get_string(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return std::string("NULL"); char const * v = reinterpret_cast (sqlite3_column_text(m_params->statement,idx)); size_t length = get_binary_size(idx); return std::string(v, v+length); } double result::get_double(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0.0; return sqlite3_column_double(m_params->statement,idx); } size_t result::get_binary_size(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0; return sqlite3_column_bytes(m_params->statement,idx); } void result::get_binary(int idx, void * buf, size_t buf_size){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return; size_t size = sqlite3_column_bytes(m_params->statement,idx); if(size > buf_size) throw buffer_too_small_exception("buffer too small"); memcpy(buf,sqlite3_column_blob(m_params->statement,idx),size); } void result::get_binary(int idx, std::vector & v){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return; size_t size = sqlite3_column_bytes(m_params->statement,idx); v.resize(size,0); memcpy(&v[0],sqlite3_column_blob(m_params->statement,idx),size); } std::string result::get_column_name(int idx){ access_check(idx); return sqlite3_column_name(m_params->statement,idx); } void result::access_check(int idx){ m_params->access_check(); if(idx < 0 || idx >= m_columns) throw std::out_of_range("no such column index"); } int result::get_row_count(){ return m_params->row_count; } int result::get_column_count(){ return m_columns; } } vsqlite---0.3.13/src/sqlite/savepoint.cpp000066400000000000000000000045611232620036300202260ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2014 mickey mickey.mouse-1985@libero.it All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include namespace sqlite{ savepoint::savepoint(connection & con, std::string const & name) : m_con(con) , m_name(name){ exec("SAVEPOINT " + m_name); m_isActive = true; } savepoint::~savepoint(){ if (m_isActive) release(); } void savepoint::release(){ exec("RELEASE SAVEPOINT " + m_name); m_isActive = false; } void savepoint::rollback() { exec("ROLLBACK TRANSACTION TO SAVEPOINT " + m_name); } void savepoint::exec(std::string const & cmd){ execute(m_con,cmd,true); } } vsqlite---0.3.13/src/sqlite/transaction.cpp000066400000000000000000000057061232620036300205450ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com Copyright (c) 2014 mickey mickey.mouse-1985@libero.it All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ transaction::transaction(connection & con, transaction_type type) : m_con(con){ begin(type); } transaction::~transaction(){ if (m_isActive) commit(); } void transaction::begin(transaction_type type){ std::string sql("BEGIN "); switch (type) { case transaction_type::deferred: sql += "DEFERRED " ; break; case transaction_type::immediate: sql += "IMMEDIATE "; break; case transaction_type::exclusive: sql += "EXCLUSIVE "; break; case transaction_type::undefined: ; /* noop */ } sql += "TRANSACTION"; exec(sql); m_isActive = true; } void transaction::end(){ exec("END TRANSACTION"); m_isActive = false; } void transaction::commit(){ exec("COMMIT TRANSACTION"); m_isActive = false; } void transaction::rollback(){ exec("ROLLBACK TRANSACTION"); m_isActive = false; } void transaction::exec(std::string const & cmd){ execute(m_con,cmd,true); } } vsqlite---0.3.13/src/sqlite/view.cpp000066400000000000000000000057301232620036300171670ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ view::view(connection & con) :m_con(con){ } view::~view(){ } void view::create(bool temporary, std::string const & database, std::string const & alias, std::string const & sql_query){ boost::format fmt("CREATE %1% VIEW %2%.%3% AS %4%;"); fmt % (temporary ? "TEMPORARY" : "") % database % alias % sql_query; execute(m_con,fmt.str(),true); } void view::create(bool temporary, std::string const & alias, std::string const & sql_query){ boost::format fmt("CREATE %1% VIEW %2% AS %3%;"); fmt % (temporary ? "TEMPORARY" : "") % alias % sql_query; execute(m_con,fmt.str(),true); } void view::drop(std::string const & alias){ boost::format fmt("DROP VIEW %1%;"); fmt % alias; execute(m_con,fmt.str(),true); } void view::drop(std::string const & database, std::string const & alias){ boost::format fmt("DROP VIEW %1%.%2%;"); fmt % database % alias; execute(m_con,fmt.str(),true); } }