{"id":13316338,"url":"https://github.com/viaduck/mariadbpp","last_synced_at":"2025-03-10T22:33:00.388Z","repository":{"id":33454226,"uuid":"126755432","full_name":"viaduck/mariadbpp","owner":"viaduck","description":"C++ client library for MariaDB.","archived":false,"fork":false,"pushed_at":"2024-04-01T02:00:19.000Z","size":399,"stargazers_count":95,"open_issues_count":2,"forks_count":40,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-01T03:22:42.139Z","etag":null,"topics":["client-library","cpp","database","mariadb"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viaduck.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}},"created_at":"2018-03-26T01:07:20.000Z","updated_at":"2024-02-07T08:33:14.000Z","dependencies_parsed_at":"2022-08-07T21:16:50.547Z","dependency_job_id":null,"html_url":"https://github.com/viaduck/mariadbpp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viaduck%2Fmariadbpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viaduck%2Fmariadbpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viaduck%2Fmariadbpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viaduck%2Fmariadbpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viaduck","download_url":"https://codeload.github.com/viaduck/mariadbpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242939425,"owners_count":20209874,"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":["client-library","cpp","database","mariadb"],"created_at":"2024-07-29T18:21:32.088Z","updated_at":"2025-03-10T22:33:00.136Z","avatar_url":"https://github.com/viaduck.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mariadb++\nC++ client library for MariaDB. Uses the C connector.\n\n## Features\n* Prepared statements\n* Transactions and savepoints\n* Concurrency allows connection sharing between threads\n* Data type support: blob, decimal, datetime, time, timespan, etc.\n* Exceptions\n\n## Dependencies\nInstall `mariadbclient` or `mysqlclient` libraries.\n\n## Usage (local)\n1. Initialize Git submodules: `git submodule update --init`\n2. Add `mariadbclientpp` as a subdirectory in your own `CMakeLists.txt`:\n\n```cmake\nadd_subdirectory(/path/to/mariadbpp)\n...\ntarget_link_libraries(target mariadbclientpp)\n```\n\n## Usage (global)\n### Build and install instructions\n1. Initialize Git submodules: `git submodule update --init`\n2. `mkdir build; cd build`\n3. `cmake ..`\n4. `make install`\n\n### Linking instructions\nAdd `mariadbclientpp` as a CMake package to your CMake project. Make sure\nthat the environment variable `CMAKE_PREFIX_PATH` includes the directory\nwhere the `mariadbclientpp-config.cmake` file was installed:\n\n```cmake\nfind_package(mariadbclientpp)\n...\ntarget_link_libraries(target mariadbclientpp::mariadbclientpp)\n```\n\n## Building tests\n1. Create database and user according to the information in\n[test/CMakeLists.txt](test/CMakeLists.txt) or adjust these values.\n2. Enable tests with `-DMARIADBPP_TEST=ON` and build the software.\n\n\n## Example\n```c++\n// set up the account\naccount_ref acc = account::create(...);\n\n// create connection\nconnection_ref con = connection::create(acc);\n\n// insert, update, select on the connection\nu64 id = con-\u003einsert(\"INSERT INTO table VALUES (1, 2, 3)\");\nu64 affected = con-\u003eexecute(\"UPDATE table SET a=1\");\nresult_set_ref result = con-\u003equery(\"SELECT * FROM table\");\n\n// create statement\nstatement_ref stmt = con-\u003ecreate_statement(...);\n\n// insert, update, select on the statement\nu64 id = stmt-\u003einsert();\nu64 affected = stmt-\u003eexecute();\nresult_set_ref result = stmt-\u003equery();\n\n// reading from a result set\nwhile (result-\u003enext()) {\n    int a = result-\u003eget_unsigned32(0);\n    int b = result-\u003eget_unsigned32(\"b\");\n}\n\n// insert using prepared statement\nstatement_ref stmt = con-\u003ecreate_statement(\"INSERT INTO table (?, ?, ?)\");\nstmt-\u003eset_unsigned32(0, 13);\nstmt-\u003eset_unsigned32(1, 37);\nstmt-\u003eset_unsigned32(2, 42);\nstmt-\u003einsert();\n\n```\nMore usage examples can be found in the `test/` directory.\n\n## History\nThis library was originally developed on [Launchpad](https://launchpad.net/mariadb++).\nIt has since been forked and is now being actively maintained [here](https://github.com/viaduck/mariadbpp).\n\n## License\nThis library is subject to the Boost Software License. See accompanying\n[LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviaduck%2Fmariadbpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviaduck%2Fmariadbpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviaduck%2Fmariadbpp/lists"}