return SQL_SUCCESS; Adding support for a PostgreSQL data type (e.g., JSONB with better handling):
// 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
return SQL_SUCCESS; // In performance.c - new file for performance features typedef struct uint64_t query_start_time; uint64_t query_end_time; char last_query[4096]; int slow_query_threshold_ms; PerformanceMetrics; void start_query_trace(StatementInfo_ *stmt, const char *query) if (stmt->perf_metrics) stmt->perf_metrics->query_start_time = get_current_time_ms(); strncpy(stmt->perf_metrics->last_query, query, sizeof(stmt->perf_metrics->last_query) - 1); postgresql-odbc
// Your implementation here // ...
Build Environment # Clone the repository git clone https://github.com/postgres/postgresql-odbc.git cd postgresql-odbc Configure with debug options ./configure --enable-debug --enable-unicode CFLAGS="-g -O0" Build make clean make make install Testing Your Feature // Add test in test/test_feature.c void test_new_connection_parameter() SQLHDBC hdbc; SQLRETURN ret; // Test connection with new parameter ret = SQLConnect(hdbc, (SQLCHAR*)"DSN=PostgreSQL;MyNewFeature=1", SQL_NTS, NULL, 0, NULL, 0); return SQL_SUCCESS; Adding support for a PostgreSQL data
return NULL;
int cache_prepared_statement(ConnectionInfo_ *ci, const char *name, const char *sql) StatementCacheEntry *entry = malloc(sizeof(StatementCacheEntry)); if (!entry) return -1; Build Environment # Clone the repository git clone
curr = curr->next;