Postgresql-odbc
curr = curr->next;
StatementCacheEntry *find_cached_statement(const char *sql) StatementCacheEntry *curr = statement_cache; while (curr) if (strcmp(curr->sql, sql) == 0) curr->last_used = time(NULL); curr->use_count++; return curr; postgresql-odbc
// In convert.c SQLRETURN convert_jsonb_to_c( const char *value, SQLSMALLINT target_type, void *target_value, SQLLEN *target_len) curr = curr->
void end_query_trace(StatementInfo_ *stmt) if (stmt->perf_metrics) stmt->perf_metrics->query_end_time = get_current_time_ms(); uint64_t duration = stmt->perf_metrics->query_end_time - stmt->perf_metrics->query_start_time; while (curr) if (strcmp(curr->
statement_cache = entry; return 0;
Adding support for a PostgreSQL data type (e.g., JSONB with better handling):
switch (target_type) case SQL_C_CHAR: if (target_value) // Convert JSONB to string strncpy((char *)target_value, value, *target_len); *target_len = strlen(value); break; case SQL_C_BINARY: // Handle binary JSONB conversion if (target_value) memcpy(target_value, value, min(*target_len, strlen(value))); *target_len = strlen(value); break; default: return SQL_ERROR;