Postgresql-odbc _top_ Info

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);

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; postgresql-odbc

return 0; // In odbcapi.c - implement new ODBC function SQLRETURN SQL_API SQLMyNewFunction( SQLHENV EnvironmentHandle, SQLCHAR *Parameter, SQLSMALLINT ParameterLen) ParameterLen < 0) return SQL_ERROR; Build Environment # Clone the repository git clone

// In convert.c SQLRETURN convert_jsonb_to_c( const char *value, SQLSMALLINT target_type, void *target_value, SQLLEN *target_len) void end_query_trace(StatementInfo_ *stmt) if (stmt-&gt

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;

return NULL;

// 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);