{"id":26500347,"url":"https://github.com/rbock/sqlpp23","last_synced_at":"2025-10-09T13:37:53.807Z","repository":{"id":283157197,"uuid":"950866479","full_name":"rbock/sqlpp23","owner":"rbock","description":" A type safe SQL library for C++ ","archived":false,"fork":false,"pushed_at":"2025-10-08T09:33:15.000Z","size":7182,"stargazers_count":74,"open_issues_count":6,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-09T13:37:52.626Z","etag":null,"topics":["cpp23","header-only-library","sql"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbock.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-18T19:58:17.000Z","updated_at":"2025-10-08T09:33:20.000Z","dependencies_parsed_at":"2025-04-20T14:35:43.875Z","dependency_job_id":"13e63798-7c04-44f7-9448-b7a8ac5730f9","html_url":"https://github.com/rbock/sqlpp23","commit_stats":null,"previous_names":["rbock/sqlpp23"],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/rbock/sqlpp23","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbock%2Fsqlpp23","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbock%2Fsqlpp23/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbock%2Fsqlpp23/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbock%2Fsqlpp23/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbock","download_url":"https://codeload.github.com/rbock/sqlpp23/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbock%2Fsqlpp23/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001489,"owners_count":26083102,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cpp23","header-only-library","sql"],"created_at":"2025-03-20T15:29:56.919Z","updated_at":"2025-10-09T13:37:53.802Z","avatar_url":"https://github.com/rbock.png","language":"C++","readme":"# sqlpp23\n\nsqlpp23 is a type-safe embedded domain specific language for SQL queries and results in C++.\nIt allows you to write SQL in the form of C++ expressions:\n\n  * Tables, columns, result fields are represented as structs or data members\n  * Statements and clauses are constructed by functions\n  * Your IDE can help you write SQL in C++\n  * Your compiler will find a lot of typical mistakes long before they hit integration tests or even production, e.g.\n    * typos\n    * comparing apples to oranges\n    * a missing table in `from()`\n    * missing a non-default column in `insert_into()`\n    * selecting a mix of aggregates and non-aggregates\n    * differences in SQL dialects from one database backend to the next, see below\n\nsqlpp23’s core is vendor-neutral.\n\nSpecific traits of databases (e.g. unsupported or non-standard features) are handled by connector libraries.\nConnector libraries can inform you and your IDE of missing features at compile time.\nThey also interpret expressions specifically where needed.\nFor example, the connector could use the `operator||` or the `concat` method for string concatenation without your being required to change the statement.\n\nConnectors for MariaDB, MySQL, PostgreSQL, sqlite3, sqlcipher are included in this repository.\n\nDocumentation is found in [docs](/docs/README.md).\n\nIf you are coming from [sqlpp11](https://github.com/rbock/sqlpp11), you might be interested in [differences](docs/differences_to_sqlpp11.md).\n\n## Examples:\n\nLet's assume we have a database connection object `db` and a table object `foo` representing something like\n\n```SQL\nCREATE TABLE foo (\n    id bigint NOT NULL,\n    name varchar(50),\n    hasFun bool NOT NULL\n);\n```\n\n[insert](/docs/insert.md)\n```C++\ndb(insert_into(foo).set(foo.id = 17, foo.name = \"bar\", foo.hasFun = true));\n```\n\n[update](/docs/update.md)\n```C++\ndb(update(foo).set(foo.name = std::nullopt).where(foo.name != \"nobody\"));\n```\n\n[delete](/docs/delete.md)\n```C++\ndb(delete_from(foo).where(not foo.hasFun));\n```\n\n[select](/docs/select.md)\n```C++\n// selecting zero or more results, iterating over the results\nfor (const auto\u0026 row : db(select(foo.id, foo.name, foo.hasFun)\n                          .from(foo)\n                          .where(foo.id \u003e 17 and foo.name.like(\"%bar%\"))))\n{\n  std::cout \u003c\u003c row.id \u003c\u003c '\\n';                    // int64_t\n  std::cout \u003c\u003c row.name.value_or(\"NULL\") \u003c\u003c '\\n'; // std::optional\u003cstd::string_view\u003e\n  std::cout \u003c\u003c row.hasFun() \u003c\u003c '\\n';              // bool\n}\n```\n\n[database specific](/docs/connectors.md)\n```C++\n  for (const auto \u0026row : db(sql::insert_into(foo)\n                                .set(foo.id = 7, foo.name = std::nullopt, foo.hasFun = false)\n                                .on_conflict(foo.id)\n                                .do_update(foo.name = \"updated\")\n                                .where(foo.id \u003e 17)\n                                .returning(foo.name))) {\n    std::cout \u003c\u003c row.name.value_or(\"NULL\") \u003c\u003c '\\n';\n  }\n```\n\n## Requirements:\n\n__Compiler:__\nsqlpp23 makes use of C++23 and requires a recent compiler and standard library.\n\nLicense:\n\nsqlpp23 is distributed under the [BSD 2-Clause License](https://github.com/rbock/sqlpp23/blob/main/LICENSE).\n\n## Status:\n[![Build status](https://ci.appveyor.com/api/projects/status/9kyafm5p1xq5j0ax/branch/main?svg=true)](https://ci.appveyor.com/project/rbock/sqlpp23/branch/main)\n\n## Getting involved:\n\nFeature requests, bug reports, contributions to code or documentation are most welcome.\n\n  * Issues at https://github.com/rbock/sqlpp23/issues\n  * email at rbock at eudoxos dot de\n\n","funding_links":[],"categories":["Database"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbock%2Fsqlpp23","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbock%2Fsqlpp23","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbock%2Fsqlpp23/lists"}