{"id":19492769,"url":"https://github.com/oatpp/oatpp-sqlite","last_synced_at":"2025-04-25T20:30:27.891Z","repository":{"id":41833145,"uuid":"276774929","full_name":"oatpp/oatpp-sqlite","owner":"oatpp","description":"SQLite adapter for oatpp ORM.","archived":false,"fork":false,"pushed_at":"2024-05-19T23:11:25.000Z","size":2797,"stargazers_count":25,"open_issues_count":7,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T03:27:09.841Z","etag":null,"topics":["cpp","oatpp","orm","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oatpp.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":"2020-07-03T00:58:14.000Z","updated_at":"2025-04-08T07:24:02.000Z","dependencies_parsed_at":"2024-11-07T00:32:33.259Z","dependency_job_id":"53b4d111-784a-4f31-bfd6-6268ba441d12","html_url":"https://github.com/oatpp/oatpp-sqlite","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":"0.10204081632653061","last_synced_commit":"b84df87f1119660f27ccc7aa1ae7fa9f240c5377"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/oatpp-sqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250822970,"owners_count":21492979,"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","oatpp","orm","sqlite","sqlite3"],"created_at":"2024-11-10T21:22:58.069Z","updated_at":"2025-04-25T20:30:27.856Z","avatar_url":"https://github.com/oatpp.png","language":"C","readme":"# oatpp-sqlite [![Build Status](https://dev.azure.com/lganzzzo/lganzzzo/_apis/build/status/oatpp.oatpp-sqlite?branchName=master)](https://dev.azure.com/lganzzzo/lganzzzo/_build/latest?definitionId=30\u0026branchName=master)\n\nSQLite adapter for Oat++ ORM.\n\nMore about Oat++:\n\n- [Oat++ Website](https://oatpp.io/)\n- [Oat++ GitHub Repository](https://github.com/oatpp/oatpp)\n- [Oat++ ORM](https://oatpp.io/docs/components/orm/)\n\n## Build And Install\n\n### Pre Requirements\n\n- Install the main [oatpp](https://github.com/oatpp/oatpp) module.\n- Install SQLite.  \n   *Note: You can also use `-DOATPP_SQLITE_AMALGAMATION=ON` to install oatpp-sqlite together with [SQLite amalgamation](https://www.sqlite.org/amalgamation.html) \n   in which case you don't need to install SQLite*  \n  (Current version `3.45.3`)\n\n### Install module\n\n- Clone this repository.\n- In the root of the repository run:\n   ```bash\n   mkdir build \u0026\u0026 cd build\n   cmake ..\n   make install\n   ```\n   \n## API\n\nDetailed documentation on Oat++ ORM you can find [here](https://oatpp.io/docs/components/orm/).\n\n### Connect to Database\n\nAll you need to start using oatpp ORM with SQLite is to create `oatpp::sqlite::Executor` and provide it to your `DbClient`.\n\n```cpp\n#include \"db/MyClient.hpp\"\n#include \"oatpp-sqlite/orm.hpp\"\n\nclass AppComponent {\npublic:\n  \n  /**\n   * Create DbClient component.\n   * SQLite is used as an example here. For other databases declaration is similar.\n   */\n  OATPP_CREATE_COMPONENT(std::shared_ptr\u003cdb::MyClient\u003e, myDatabaseClient)([] {\n    /* Create database-specific ConnectionProvider */\n    auto connectionProvider = std::make_shared\u003coatpp::sqlite::ConnectionProvider\u003e(\"/path/to/database.sqlite\");    \n  \n    /* Create database-specific ConnectionPool */\n    auto connectionPool = oatpp::sqlite::ConnectionPool::createShared(connectionProvider, \n                                                                      10 /* max-connections */, \n                                                                      std::chrono::seconds(5) /* connection TTL */);\n    \n    /* Create database-specific Executor */\n    auto executor = std::make_shared\u003coatpp::sqlite::Executor\u003e(connectionPool);\n  \n    /* Create MyClient database client */\n    return std::make_shared\u003cMyClient\u003e(executor);\n  }());\n\n};\n```\n\n## License\n\n- [Apache License 2.0](https://github.com/oatpp/oatpp-sqlite/blob/master/LICENSE) applies to all files of this module except [SQLite amalgamation](https://www.sqlite.org/amalgamation.html).\n- [SQLite License](https://www.sqlite.org/copyright.html) applies to [SQLite amalgamation](https://www.sqlite.org/amalgamation.html) files:\n   - [/src/sqlite/sqlite3.c](https://github.com/oatpp/oatpp-sqlite/blob/master/src/sqlite/sqlite3.c)\n   - [/src/sqlite/sqlite3.h](https://github.com/oatpp/oatpp-sqlite/blob/master/src/sqlite/sqlite3.h)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Foatpp-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-sqlite/lists"}