{"id":19258375,"url":"https://github.com/maurodelazeri/memsql-cpp-connector","last_synced_at":"2026-05-16T00:07:27.054Z","repository":{"id":150738873,"uuid":"226182726","full_name":"maurodelazeri/memsql-cpp-connector","owner":"maurodelazeri","description":"MemSQL connector with pool of connections for c++","archived":false,"fork":false,"pushed_at":"2019-12-05T21:14:19.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T18:15:28.540Z","etag":null,"topics":["connector","mariadb","memsql","pool","sql"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maurodelazeri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-12-05T20:23:26.000Z","updated_at":"2023-03-14T03:46:12.000Z","dependencies_parsed_at":"2023-04-06T11:24:15.075Z","dependency_job_id":null,"html_url":"https://github.com/maurodelazeri/memsql-cpp-connector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maurodelazeri/memsql-cpp-connector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurodelazeri%2Fmemsql-cpp-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurodelazeri%2Fmemsql-cpp-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurodelazeri%2Fmemsql-cpp-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurodelazeri%2Fmemsql-cpp-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maurodelazeri","download_url":"https://codeload.github.com/maurodelazeri/memsql-cpp-connector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maurodelazeri%2Fmemsql-cpp-connector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33085111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["connector","mariadb","memsql","pool","sql"],"created_at":"2024-11-09T19:13:11.933Z","updated_at":"2026-05-16T00:07:27.038Z","avatar_url":"https://github.com/maurodelazeri.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memsql-cpp-connector\nSimple MemSQL connector with pool of connections for c++\n\n### Dependencies\n\nhttp://download.memsql.com/clients/mariadb-connector-c-3.0.9-linux-x86_64.tar.gz\n\n\n```c++\n#include \u003ciostream\u003e\n#include \u003csstream\u003e\n#include \"connection_pool.h\"\n#include \u003cboost/format.hpp\u003e\n\nusing namespace std;\n\nint main(int argc, char **argv) {\n\n    std::ostringstream sqlQuery;\n    std::shared_ptr\u003cconnection_pool\u003e m_pool;\n    m_pool = std::make_shared\u003cconnection_pool\u003e(\"x.x.x.x\", \"root\", \"pwd\", \"database\", 3306, 1, false);\n\n    sqlQuery \u003c\u003c boost::format(\"INSERT INTO xxxx (x,x,x, x) VALUES ('%1%', '%2%', '%3%', '%4%')\")\n                % \"a\"\n                % \"b\"\n                % \"c\";\n    shared_ptr\u003cMysqlConnection\u003e con = m_pool-\u003eget_connection();\n    if (con) {\n        try {\n            con-\u003eexecute(sqlQuery.str(), false, true);\n            m_pool-\u003erelease_connection(*con);\n        } catch (...) {\n            m_pool-\u003erelease_connection(*con);\n        }\n    }\n    return 0;\n}\n```\n\nIt's simple, ready to go...\n\nYou can for example check the affected rows using \n\n```c++\nstd::shared_ptr\u003cmy_ulonglong\u003e affectRowsPtr = std::make_shared\u003cmy_ulonglong\u003e();\ncon-\u003eexecute(sqlQuery.str(), false, true, affectRowsPtr.get());\nif (*affectRowsPtr == 0) {\n  cout \u003c\u003c \"No changes\" \u003c\u003c endl;\n}\n```\n\nor you can simple select data:\n\n```c++\n#include \u003ciostream\u003e\n#include \u003csstream\u003e\n#include \"connection_pool.h\"\n#include \u003cboost/format.hpp\u003e\n\nusing namespace std;\n\nint main(int argc, char **argv) {\n\n    std::ostringstream sqlQuery;\n    auto product_id = 2;\n    sqlQuery \u003c\u003c boost::format(\n            \"select * venue from products where product_id=%1%\")\n                % product_id;\n\n    shared_ptr\u003cMysqlConnection\u003e con = m_pool-\u003eget_connection();\n    if (con) {\n        auto data = con-\u003eopen(sqlQuery.str());\n        if (!data-\u003eis_valid()) {\n            return false;\n        }\n\n        auto row = data-\u003enext();\n        unsigned int row_idx = 0;\n        while (row) {\n            row_idx++;\n\n            cout \u003c\u003c row-\u003eget_value(0) \u003c\u003c endl;\n\n            row = data-\u003enext();\n        }\n        \n        m_pool-\u003erelease_connection(*con);\n    }\n    \n    return 0;\n}    \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaurodelazeri%2Fmemsql-cpp-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaurodelazeri%2Fmemsql-cpp-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaurodelazeri%2Fmemsql-cpp-connector/lists"}