mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Create gh-pages branch via GitHub
This commit is contained in:
parent
058e0ea3fc
commit
b0737c55bf
37
index.html
37
index.html
@ -16,15 +16,15 @@
|
||||
<!-- HEADER -->
|
||||
<div id="header_wrap" class="outer">
|
||||
<header class="inner">
|
||||
<a id="forkme_banner" href="https://github.com/SRombauts/SQLiteCpp">Fork Me on GitHub</a>
|
||||
<a id="forkme_banner" href="https://github.com/SRombauts/SQLiteCpp">View on GitHub</a>
|
||||
|
||||
<h1 id="project_title">SQLiteC++</h1>
|
||||
<h2 id="project_tagline">SQLiteC++ is a smart and easy to use C++ SQLite3 wrapper.</h2>
|
||||
|
||||
<section id="downloads">
|
||||
<a class="zip_download_link" href="https://github.com/SRombauts/SQLiteCpp/zipball/master">Download this project as a .zip file</a>
|
||||
<a class="tar_download_link" href="https://github.com/SRombauts/SQLiteCpp/tarball/master">Download this project as a tar.gz file</a>
|
||||
</section>
|
||||
<section id="downloads">
|
||||
<a class="zip_download_link" href="https://github.com/SRombauts/SQLiteCpp/zipball/master">Download this project as a .zip file</a>
|
||||
<a class="tar_download_link" href="https://github.com/SRombauts/SQLiteCpp/tarball/master">Download this project as a tar.gz file</a>
|
||||
</section>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<section id="main_content" class="inner">
|
||||
<h3>License</h3>
|
||||
|
||||
<p>Copyright (c) 2012 Sébastien Rombauts (sebastien.rombauts@gmail.com)</p>
|
||||
<p>Copyright (c) 2012-2013 Sébastien Rombauts (<a href="mailto:sebastien.rombauts@gmail.com">sebastien.rombauts@gmail.com</a>)</p>
|
||||
|
||||
<p>Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||
or copy at <a href="http://opensource.org/licenses/MIT">http://opensource.org/licenses/MIT</a>)</p>
|
||||
@ -41,19 +41,20 @@ or copy at <a href="http://opensource.org/licenses/MIT">http://opensource.org/li
|
||||
<h3>The goals of SQLiteC++ are:</h3>
|
||||
|
||||
<ul>
|
||||
<li>to use a permissive MIT license, similar to BSD or Boost, for proprietary/commercial usage</li>
|
||||
<li>to offer the best of existing simple wrappers</li>
|
||||
<li>to use a permissive license like MIT or BSD</li>
|
||||
<li>to be elegantly written with good C++ design, STL, exceptions and RAII idiom</li>
|
||||
<li>to keep dependencies to a minimum (STL and SQLite3)</li>
|
||||
<li>to be well documented, in code with Doxygen, and online with some good examples</li>
|
||||
<li>to be portable</li>
|
||||
<li>to be light and fast</li>
|
||||
<li>to be monothreaded</li>
|
||||
<li>to be monothreaded (not thread-safe)</li>
|
||||
<li>to use API names sticking with those of the SQLite library</li>
|
||||
<li>to be well documented in code with Doxygen, and online with some good examples</li>
|
||||
<li>to be well maintained</li>
|
||||
</ul><p>It is designed with the Resource Acquisition Is Initialization (RAII) idom
|
||||
</ul><p>It is designed using the Resource Acquisition Is Initialization (RAII) idom
|
||||
(see <a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization">http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization</a>),
|
||||
and throw exceptions in case of SQLite errors.
|
||||
and throwing exceptions in case of SQLite errors (exept in destructors,
|
||||
where assert() are used instead).
|
||||
Each SQLiteC++ object must be constructed with a valid SQLite database connection,
|
||||
and then is always valid until destroyed.</p>
|
||||
|
||||
@ -74,8 +75,7 @@ in your project code base (not the main.cpp example file).</p>
|
||||
|
||||
<h3>First sample demonstrates how to query a database and get results:</h3>
|
||||
|
||||
<div class="highlight">
|
||||
<pre><span class="k">try</span>
|
||||
<div class="highlight"><pre><span class="n">try</span>
|
||||
<span class="p">{</span>
|
||||
<span class="c1">// Open a database file</span>
|
||||
<span class="n">SQLite</span><span class="o">::</span><span class="n">Database</span> <span class="n">db</span><span class="p">(</span><span class="s">"example.db3"</span><span class="p">);</span>
|
||||
@ -101,14 +101,11 @@ in your project code base (not the main.cpp example file).</p>
|
||||
<span class="p">{</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="s">"exception: "</span> <span class="o"><<</span> <span class="n">e</span><span class="p">.</span><span class="n">what</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</pre></div>
|
||||
|
||||
<h3>Second sample shows how to manage a transaction:</h3>
|
||||
|
||||
<div class="highlight">
|
||||
<pre><span class="k">try</span>
|
||||
<div class="highlight"><pre><span class="n">try</span>
|
||||
<span class="p">{</span>
|
||||
<span class="n">SQLite</span><span class="o">::</span><span class="n">Database</span> <span class="n">db</span><span class="p">(</span><span class="s">"transaction.db3"</span><span class="p">,</span> <span class="n">SQLITE_OPEN_READWRITE</span><span class="o">|</span>
|
||||
<span class="n">SQLITE_OPEN_CREATE</span><span class="p">);</span>
|
||||
@ -130,9 +127,7 @@ in your project code base (not the main.cpp example file).</p>
|
||||
<span class="p">{</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o"><<</span> <span class="s">"exception: "</span> <span class="o"><<</span> <span class="n">e</span><span class="p">.</span><span class="n">what</span><span class="p">()</span> <span class="o"><<</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</pre></div>
|
||||
|
||||
<h3>Some other simple C++ SQLite wrappers:</h3>
|
||||
|
||||
|
@ -1 +1 @@
|
||||
{"name":"SQLiteC++","body":"### License\r\n\r\nCopyright (c) 2012 Sébastien Rombauts (sebastien.rombauts@gmail.com)\r\n\r\nDistributed under the MIT License (MIT) (See accompanying file LICENSE.txt\r\nor copy at http://opensource.org/licenses/MIT)\r\n\r\n### The goals of SQLiteC++ are:\r\n\r\n- to offer the best of existing simple wrappers\r\n- to use a permissive license like MIT or BSD\r\n- to be elegantly written with good C++ design, STL, exceptions and RAII idiom\r\n- to keep dependencies to a minimum (STL and SQLite3)\r\n- to be well documented, in code with Doxygen, and online with some good examples\r\n- to be portable\r\n- to be light and fast\r\n- to be monothreaded\r\n- to use API names sticking with those of the SQLite library\r\n- to be well maintained\r\n\r\nIt is designed with the Resource Acquisition Is Initialization (RAII) idom\r\n(see http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization),\r\nand throw exceptions in case of SQLite errors.\r\nEach SQLiteC++ object must be constructed with a valid SQLite database connection,\r\nand then is always valid until destroyed.\r\n\r\n### Depandancies:\r\n\r\n - a STL implementation (even an old one like VC6/eVC4 should work)\r\n - exception support (the class Exception inherite from std::runtime_error)\r\n - the SQLite library, either by linking to it dynamicaly or staticaly,\r\n or by adding its source file in your project code base.\r\n\r\nTo use it in your project, you only need to add the 6 SQLiteC++ source files\r\nin your project code base (not the main.cpp example file).\r\n\r\n### About SQLite:\r\nSQLite is a library that implements a serverless transactional SQL database engine.\r\nhttp://www.sqlite.org/about.html\r\n\r\n### First sample demonstrates how to query a database and get results: \r\n\r\n```C++\r\ntry\r\n{\r\n // Open a database file\r\n SQLite::Database db(\"example.db3\");\r\n \r\n // Compile a SQL query, containing one parameter (index 1)\r\n SQLite::Statement query(db, \"SELECT * FROM test WHERE size > ?\");\r\n \r\n // Bind the integer value 6 to the first parameter of the SQL query\r\n query.bind(1, 6);\r\n \r\n // Loop to execute the query step by step, to get rows of result\r\n while (query.executeStep())\r\n {\r\n // Demonstrate how to get some typed column value\r\n int id = query.getColumn(0);\r\n const char* value = query.getColumn(1);\r\n int size = query.getColumn(2);\r\n \r\n std::cout << \"row: \" << id << \",\" << value << \",\" << size << std::endl;\r\n }\r\n}\r\ncatch (std::exception& e)\r\n{\r\n std::cout << \"exception: \" << e.what() << std::endl;\r\n}\r\n```\r\n\r\n### Second sample shows how to manage a transaction:\r\n\r\n```C++\r\ntry\r\n{\r\n SQLite::Database db(\"transaction.db3\", SQLITE_OPEN_READWRITE|\r\n SQLITE_OPEN_CREATE);\r\n\r\n db.exec(\"DROP TABLE IF EXISTS test\");\r\n\r\n // Begin transaction\r\n SQLite::Transaction transaction(db);\r\n\r\n db.exec(\"CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)\");\r\n\r\n int nb = db.exec(\"INSERT INTO test VALUES (NULL, \\\"test\\\")\");\r\n std::cout << \"INSERT INTO test returned \" << nb << std::endl;\r\n\r\n // Commit transaction\r\n transaction.commit();\r\n}\r\ncatch (std::exception& e)\r\n{\r\n std::cout << \"exception: \" << e.what() << std::endl;\r\n}\r\n```\r\n\r\n### Some other simple C++ SQLite wrappers:\r\n\r\n - [sqdbcpp](http://code.google.com/p/sqdbcpp/): RAII design, simple, no depandencies, UTF-8/UTF-16, new BSD license\r\n - [sqlite3cc](http://ed.am/dev/sqlite3cc): uses boost, modern design, LPGPL\r\n - [sqlite3pp](http://code.google.com/p/sqlite3pp/): uses boost, MIT License \r\n - [SQLite++](http://sqlitepp.berlios.de/): uses boost build system, Boost License 1.0 \r\n - [CppSQLite](http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/): famous Code Project but old design, BSD License \r\n - [easySQLite](http://code.google.com/p/easysqlite/): manages table as structured objects, complex ","tagline":"SQLiteC++ is a smart and easy to use C++ SQLite3 wrapper.","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
|
||||
{"name":"SQLiteC++","tagline":"SQLiteC++ is a smart and easy to use C++ SQLite3 wrapper.","body":"### License\r\n\r\nCopyright (c) 2012-2013 Sébastien Rombauts (sebastien.rombauts@gmail.com)\r\n\r\nDistributed under the MIT License (MIT) (See accompanying file LICENSE.txt\r\nor copy at http://opensource.org/licenses/MIT)\r\n\r\n### The goals of SQLiteC++ are:\r\n\r\n- to use a permissive MIT license, similar to BSD or Boost, for proprietary/commercial usage\r\n- to offer the best of existing simple wrappers\r\n- to be elegantly written with good C++ design, STL, exceptions and RAII idiom\r\n- to keep dependencies to a minimum (STL and SQLite3)\r\n- to be portable\r\n- to be light and fast\r\n- to be monothreaded (not thread-safe)\r\n- to use API names sticking with those of the SQLite library\r\n- to be well documented in code with Doxygen, and online with some good examples\r\n- to be well maintained\r\n\r\nIt is designed using the Resource Acquisition Is Initialization (RAII) idom\r\n(see http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization),\r\nand throwing exceptions in case of SQLite errors (exept in destructors,\r\nwhere assert() are used instead).\r\nEach SQLiteC++ object must be constructed with a valid SQLite database connection,\r\nand then is always valid until destroyed.\r\n\r\n### Depandancies:\r\n\r\n - a STL implementation (even an old one like VC6/eVC4 should work)\r\n - exception support (the class Exception inherite from std::runtime_error)\r\n - the SQLite library, either by linking to it dynamicaly or staticaly,\r\n or by adding its source file in your project code base.\r\n\r\nTo use it in your project, you only need to add the 6 SQLiteC++ source files\r\nin your project code base (not the main.cpp example file).\r\n\r\n### About SQLite:\r\nSQLite is a library that implements a serverless transactional SQL database engine.\r\nhttp://www.sqlite.org/about.html\r\n\r\n### First sample demonstrates how to query a database and get results: \r\n\r\n```C++\r\ntry\r\n{\r\n // Open a database file\r\n SQLite::Database db(\"example.db3\");\r\n \r\n // Compile a SQL query, containing one parameter (index 1)\r\n SQLite::Statement query(db, \"SELECT * FROM test WHERE size > ?\");\r\n \r\n // Bind the integer value 6 to the first parameter of the SQL query\r\n query.bind(1, 6);\r\n \r\n // Loop to execute the query step by step, to get rows of result\r\n while (query.executeStep())\r\n {\r\n // Demonstrate how to get some typed column value\r\n int id = query.getColumn(0);\r\n const char* value = query.getColumn(1);\r\n int size = query.getColumn(2);\r\n \r\n std::cout << \"row: \" << id << \",\" << value << \",\" << size << std::endl;\r\n }\r\n}\r\ncatch (std::exception& e)\r\n{\r\n std::cout << \"exception: \" << e.what() << std::endl;\r\n}\r\n```\r\n\r\n### Second sample shows how to manage a transaction:\r\n\r\n```C++\r\ntry\r\n{\r\n SQLite::Database db(\"transaction.db3\", SQLITE_OPEN_READWRITE|\r\n SQLITE_OPEN_CREATE);\r\n\r\n db.exec(\"DROP TABLE IF EXISTS test\");\r\n\r\n // Begin transaction\r\n SQLite::Transaction transaction(db);\r\n\r\n db.exec(\"CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)\");\r\n\r\n int nb = db.exec(\"INSERT INTO test VALUES (NULL, \\\"test\\\")\");\r\n std::cout << \"INSERT INTO test returned \" << nb << std::endl;\r\n\r\n // Commit transaction\r\n transaction.commit();\r\n}\r\ncatch (std::exception& e)\r\n{\r\n std::cout << \"exception: \" << e.what() << std::endl;\r\n}\r\n```\r\n\r\n### Some other simple C++ SQLite wrappers:\r\n\r\n - [sqdbcpp](http://code.google.com/p/sqdbcpp/): RAII design, simple, no depandencies, UTF-8/UTF-16, new BSD license\r\n - [sqlite3cc](http://ed.am/dev/sqlite3cc): uses boost, modern design, LPGPL\r\n - [sqlite3pp](http://code.google.com/p/sqlite3pp/): uses boost, MIT License \r\n - [SQLite++](http://sqlitepp.berlios.de/): uses boost build system, Boost License 1.0 \r\n - [CppSQLite](http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/): famous Code Project but old design, BSD License \r\n - [easySQLite](http://code.google.com/p/easysqlite/): manages table as structured objects, complex ","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
|
@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
Slate Theme for Github Pages
|
||||
Slate Theme for GitHub Pages
|
||||
by Jason Costello, @jsncostello
|
||||
*******************************************************************************/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user