32 const char* db_path) {
34 if (!handle || !db_path) {
40 handle->
storage = std::make_unique<entropic::SqliteStorageBackend>(db_path);
41 if (!handle->
storage->initialize()) {
43 throw std::runtime_error(
"SQLite init failed");
45 logger->info(
"storage_open: path='{}'", db_path);
47 }
catch (
const std::exception& e) {
49 logger->error(
"storage_open: {}", handle->
last_error);
66 logger->info(
"storage_close");
Private definition of the entropic_engine struct.
Public C API for the Entropic inference engine.
ENTROPIC_EXPORT entropic_error_t entropic_storage_open(entropic_handle_t handle, const char *db_path)
Open or create a SQLite storage backend.
ENTROPIC_EXPORT entropic_error_t entropic_storage_close(entropic_handle_t handle)
Close the storage backend.
entropic_error_t
Error codes returned by all C API functions.
@ ENTROPIC_ERROR_INVALID_ARGUMENT
NULL pointer, empty string, out-of-range value.
@ ENTROPIC_ERROR_INVALID_HANDLE
NULL or destroyed handle (v1.8.9)
@ ENTROPIC_ERROR_STORAGE_FAILED
Storage operation failed (v1.8.9)
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
Engine handle struct — owns all subsystems.
std::unique_ptr< entropic::SqliteStorageBackend > storage
SQLite persistence.
std::string last_error
Per-handle error message.