C++ ORM Libraries

C++ ORM Libraries

C++ ORM libraries provide performance and low-level control. SOCI supports multiple database backends, ODB is a compiler-based ORM, and sqlpp11 provides type-safe interfaces leveraging modern C++ features. They are suitable for system programming and high-performance applications.

GitHub Star Comparison

C++ ORM Libraries GitHub Star Comparison
NoNameGitHub StarsDescriptionTrendLicenseTypeOfficial Site
1sqlpp11⭐ 2.6ksqlpp11 is developed as "A type safe embedded domain specific language for SQL queries and results in C++" - a type-safe SQL DSL (Domain Specific Language) library for C++. Leveraging C++11+ template features and compile-time computation, it allows writing SQL queries directly within C++ code and checks SQL syntax and type consistency at compile time rather than runtime. It auto-generates C++ code from database schemas, achieving SQL injection attack prevention, elimination of bugs from typos, and powerful auto-completion support in IDEs.stableBSD-2-ClauseLibraryOfficial
2SOCI⭐ 1.5kSOCI is a "Database Access Library for C++" that provides a lightweight and portable database access layer for C++ applications. It offers a unified API for multiple database engines (PostgreSQL, MySQL, SQLite, Oracle, DB2, Firebird, etc.) and achieves efficient database operations leveraging C++'s type safety and RAII (Resource Acquisition Is Initialization) pattern. It comprehensively supports features necessary for modern C++ development including natural integration with STL containers, prepared statements, and connection pooling.stableBSL-1.0LibraryOfficial
3Hiberlite⭐ 721Hiberlite is "a C++ ORM for SQLite" developed for developers who need reliable data storage, ACID transactions, simple random access to their data files, and don't like coding in SQL. Unlike traditional serialization libraries with SQL serializers, C++ objects mapped with Hiberlite behave similar to the Active Record pattern, freeing you from the "read all your data/modify some small part/write everything back" constraint. With an API inspired by Boost.Serialization, there's almost no API to learn, making it intuitive to use.stableBSD-3-ClauseLibraryOfficial
4LiteSQL⭐ 34LiteSQL is an ORM framework consisting of a code generator and C++ library. It provides an object persistence layer through tight integration of C++ objects with relational databases, supporting SQLite3, PostgreSQL, MySQL, and Oracle. It automatically generates C++ classes from XML schema definitions, achieving type-safe database access.stableMITLibrary-
5ODB⭐ 28ODB is a cross-platform, cross-database ORM library for C++. It enables persistence of C++ objects to relational databases without manual mapping code, allowing development without awareness of tables, columns, or SQL. Through compiler-based code generation, it achieves high-performance and type-safe database access.stableMITLibrary-
6CppDB⭐ 6CppDB is a lightweight SQL connectivity library for C++ that provides platform and database independent connectivity API similar to what JDBC, ODBC and other connectivity libraries do. Developed as part of the CppCMS Project, it simplifies database operations in C++ applications. Supporting major databases including MySQL, PostgreSQL, SQLite3, and Oracle, it achieves high security and performance through prepared statements as a lightweight database access library.stableBSD-3-ClauseLibraryOfficial