{"id":18547671,"url":"https://github.com/vincentlaucsb/sqlite-cpp","last_synced_at":"2025-04-09T21:31:49.994Z","repository":{"id":102274953,"uuid":"114714352","full_name":"vincentlaucsb/sqlite-cpp","owner":"vincentlaucsb","description":"A simple and robust SQLite wrapper for C++","archived":false,"fork":false,"pushed_at":"2018-07-03T05:47:30.000Z","size":2214,"stargazers_count":15,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:21:35.893Z","etag":null,"topics":["cpp","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vincentlaucsb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-19T03:24:10.000Z","updated_at":"2025-02-21T02:15:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"822da8f0-bc52-4001-bcc4-afe1329a7f0e","html_url":"https://github.com/vincentlaucsb/sqlite-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlaucsb%2Fsqlite-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlaucsb%2Fsqlite-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlaucsb%2Fsqlite-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentlaucsb%2Fsqlite-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vincentlaucsb","download_url":"https://codeload.github.com/vincentlaucsb/sqlite-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114742,"owners_count":21050102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","sqlite","sqlite3"],"created_at":"2024-11-06T20:30:34.858Z","updated_at":"2025-04-09T21:31:49.979Z","avatar_url":"https://github.com/vincentlaucsb.png","language":"C","readme":"## SQLite for C++\n\n[![Build Status](https://travis-ci.org/vincentlaucsb/sqlite-cpp.svg?branch=master)](https://travis-ci.org/vincentlaucsb/sqlite-cpp) [![codecov](https://codecov.io/gh/vincentlaucsb/sqlite-cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/vincentlaucsb/sqlite-cpp) [(Documentation)](https://vincentlaucsb.github.io/sqlite-cpp/)\n\nSQLite for C++ is a wrapper around the SQLite C API which makes it easier and safer to use.\nKey features of this library are:\n\n * No manual memory management needed\n * Easy to use interface, inspired by the JDBC (but with less verbose names)\n * Memory safe\n\n## A Small Example\nHere's a small snippet demonstrating this API. Notice how it involves no manual \nwrangling with pointers? That's because this library does it all behind the scenes\nin a memory-safe, low overhead way using C++ features such as RAII and smart pointers.\n\n```\ninclude \u003cvector\u003e\ninclude \"sqlite_cpp.h\"\n\nint main() {\n    SQLite::Conn db(\"database.sqlite\");\n    db.exec(\"CREATE TABLE dillydilly (Player TEXT, Touchdown int, Interception int)\");\n\n    auto stmt = db.prepare(\"INSERT INTO dillydilly VALUES (?,?,?)\");\n    stmt.bind(\"Tom Brady\", 28, 7);\n    stmt.bind(\"Ben Roethlisberger\", 26, 14);\n    stmt.bind(\"Matthew Stafford\", 25, 9);\n    stmt.bind(\"Drew Brees\", 21, 7);\n    stmt.bind(\"Philip Rivers\", 24, 10);\n    stmt.commit(); // PreparedStatements implicitly begin transactions\n                   // Errors lead to an automatic rollback\n\n    auto results = db.query(\"SELECT * FROM dillydilly\");\n    std::vector\u003cstd::string\u003e row;\n    while (results.next()) {\n        row = results.get_row();\n        // Do stuff with row here\n    }\n\n    return 0;\n}   // Destructors for db, stmt, results, are automatically called\n```\n \n## Basics\nMost basic tasks can be executed with the methods and classes listed below\n\n### Connecting to a Database\n * SQLite::Conn: To connect to a database\n * SQLite::Conn.exec(): To execute a query that doesn't return anything\n \n### Preparing Statements\n * SQLite::Conn::prepare(): To prepare a statement\n * SQLite::Conn::PreparedStatement\n * SQLite::Conn::PreparedStatement::bind: To bind values to the statement\n \n### Querying the Database\n * SQLite::Conn::query(): To prepare/execute a query\n * SQLite::Conn::ResultSet\n * SQLite::Conn::ResultSet::next: To advance to the next row\n \n \n## Dependencies\nThe library itself has no dependencies aside from a C++11 capable compiler and the SQLite library. However, a few great third-party tools were used to ensure the library's correctness.\n\n### Test Suite\n * [Catch](https://github.com/catchorg/Catch2) for unit-testing\n * Valgrind for memory-leak checking","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentlaucsb%2Fsqlite-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincentlaucsb%2Fsqlite-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentlaucsb%2Fsqlite-cpp/lists"}