|
StormByte C++ Library: Database module 1.1.0
StormByte-Database is the SQL module of the StormByte C++ suite.
|
This repository is StormByte Database: the C++26 SQL layer of the StormByte suite.
One API covers SQLite, PostgreSQL and MariaDB. You do not construct those backends as generic objects. They are base classes: derive your schema, call the backend constructor, prepare statements and hook connect/disconnect there.
The suite is split on purpose. Base, Buffer, Config, Crypto, Logger, Multimedia, Network and System are other repositories.
StormByte::Database::Database with Connect / Disconnect, Query / SilentQuery, named prepared statements and RAII transactions.Value (NULL, integers, double, text, blob, bool) with safe numeric Get<T>().ColumnNotFound / OutOfBounds).nullptr is SQL NULL, ExpectedRows on execute.BeginTransaction(IsolationLevel) returns a Transaction that rolls back if you forget Commit.SslMode for MariaDB and PostgreSQL. SQLite ignores it.| Module | Role | API |
|---|---|---|
| Base | Exceptions, Expected, serialization, strings, UUID, concepts | /StormByte |
| Buffer | FIFO, SharedFIFO, Ring, Producer/Consumer and multi-stage pipelines | /StormByte-Buffer |
| Config | Human-readable text and versioned binary documents (groups, lists, raw bytes) | /StormByte-Config |
| Crypto | Hash, compress, encrypt, sign and key agreement — Crypto++ never leaves the private tree | /StormByte-Crypto |
| Database | This repository | /StormByte-Database |
| Logger | Stream logger with levels, headers, human-readable sizes and redaction (ThreadedLog) | /StormByte-Logger |
| Multimedia | Decode, encode and containers without raw FFmpeg types; codecs enabled only if present | /StormByte-Multimedia |
| Network | Framed packets, Client/Server, IPv4/IPv6 TCP and Buffer pipelines (compress/encrypt) | /StormByte-Network |
| System | Processes, pipes and environment variables across Linux, Windows and macOS | /StormByte-System |
Needs a C++26 compiler, CMake 3.28 or newer, StormByte Base 1.1.0 and StormByte-Logger 1.1.0. Database exceptions use the component-aware exception API introduced in Base 1.1.0. Enable the backends you want (WITH_SQLITE, WITH_POSTGRES, WITH_MARIADB: OFF, SYSTEM or BUNDLED); SYSTEM discovers installed connectors and BUNDLED builds them.
Headers are #include <StormByte/database/….hxx>. Namespace root is StormByte::Database. Moving a connected backend transfers ownership of its connection; the moved-from backend is disconnected.
MariaDB / Postgres follow the same pattern: subclass, pass host / user / password / database (and port on MariaDB), optionally SetSslMode before Connect(). PostgreSQL connection parameters are passed separately, so credentials may contain quotes and backslashes.
Malformed or out-of-range numeric values returned by a backend are reported through ExpectedRows as query errors.
nullptr binds SQL NULL. Missing statement names raise UnknownSTMT through ExpectedRows.
Issues only on this repository. Fork and open a pull request against master.
GNU Lesser General Public License version 3 or later. See [LICENSE](LICENSE) and https://www.gnu.org/licenses/lgpl-3.0.html.