!!top!! — Postgresql-odbc
// In connection.h typedef struct // ... existing fields char my_new_param[256]; // new parameter int my_new_feature_enabled; ConnectionInfo_; // In connection.c - parse connection string static int parse_connection_string(ConnectionInfo_ *ci, const char *conn_str) // ... existing parsing code
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; postgresql-odbc
// Your implementation here // ...
// Add new parameter handling if (strcasecmp(keyword, "MyNewFeature") == 0) strncpy(ci->my_new_param, value, sizeof(ci->my_new_param) - 1); ci->my_new_feature_enabled = atoi(value); // In connection
I'll help you develop a feature for the PostgreSQL ODBC driver ( psqlodbc ). Since you haven't specified the exact feature, I'll provide a comprehensive guide for implementing a common feature, and you can let me know if you need something specific. 1. Adding a New Connection Parameter Here's how to add a new ODBC connection parameter: Adding a New Connection Parameter Here's how to
// In prepared.c typedef struct StatementCacheEntry char *statement_name; char *sql; PGresult *prepared_result; time_t last_used; int use_count; struct StatementCacheEntry *next; StatementCacheEntry; static StatementCacheEntry *statement_cache = NULL;
int cache_prepared_statement(ConnectionInfo_ *ci, const char *name, const char *sql) StatementCacheEntry *entry = malloc(sizeof(StatementCacheEntry)); if (!entry) return -1;