10#include <sys/socket.h>
11#include <netinet/in.h>
25static bool probe_postgresql(
int sock) {
42 size_t total = 8 + payload;
47 return (
n == 1 &&
resp ==
'R');
64 for (
size_t i = 5;
i + 6 < len; ++
i) {
134 if (probe_postgresql(
sock)) {
156 if (!app)
return false;
Memory allocation wrappers backed by libttak.
void * cwist_alloc_array(size_t count, size_t elem_size)
Allocate zeroed memory for count elements.
Lightweight macro-based internal logging for CWIST.
#define CWIST_LOG_ERROR(fmt,...)
#define CWIST_LOG_INFO(fmt,...)
cwist_rdbms_provider_t cwist_rdbms_probe_port(int port)
Probe a TCP port on 127.0.0.1 to detect the RDBMS provider.
bool cwist_app_auto_rdbms(cwist_app *app, int port)
Auto-detect an RDBMS on a local port and mount its runtime on an app.
bool cwist_rdbms_mount_runtime(cwist_app *app, cwist_rdbms_provider_t provider, int port)
Allocate and attach an RDBMS runtime record to an app.
Main Application Context.
struct cwist_rdbms_runtime * rdbms
Mounted RDBMS runtime (auto-detected PostgreSQL/MySQL/MariaDB)
Mounted RDBMS runtime state.
cwist_rdbms_provider_t provider
Core Application Structure and Lifecycle Management.
enum cwist_rdbms_provider cwist_rdbms_provider_t
RDBMS provider auto-detection result.