Native PostgreSQL driver / client for Zig
0

Configure Feed

Select the types of activity you want to include in your feed.

Revert "Accomodate latest (and somewhat confusing) change to Zig"

This reverts commit 8583e06d89ad6bfd719ff4eba217223483ab8974.

Karl Seguin (Dec 20, 2024, 9:25 AM +0800) 8eb33efa 8583e06d

+3 -11
+2 -10
src/result.zig
··· 11 11 number_of_columns: usize, 12 12 13 13 // will be empty unless the query was executed with the column_names = true option 14 - column_names: [][]u8, 14 + column_names: [][]const u8, 15 15 16 16 _conn: *Conn, 17 17 _arena: *ArenaAllocator, ··· 169 169 pub const State = struct { 170 170 // The name for each returned column, we only populate this if we're told 171 171 // to (since it requires us to dupe the data) 172 - names: [][]u8, 172 + names: [][]const u8, 173 173 174 174 // This is different than the above. The above are set once per query 175 175 // from the RowDescription response of our Describe message. This is set for ··· 377 377 const value = self.get(field.type, column_index); 378 378 const a = allocator orelse return value; 379 379 return mapValue(T, value, a); 380 - } 381 - 382 - pub fn columnCount(self: *const Row) usize { 383 - return self._result.number_of_columns; 384 - } 385 - 386 - pub fn columName(self: *const Row, col: usize) []const u8 { 387 - return self._result.column_names[col]; 388 380 } 389 381 }; 390 382
+1 -1
src/stmt.zig
··· 321 321 ._release_conn = opts.release_conn, 322 322 ._oids = state.oids[0..column_count], 323 323 ._values = state.values[0..column_count], 324 - .column_names = if (opts.column_names) state.names[0..column_count] else &[_][]u8{}, 324 + .column_names = if (opts.column_names) state.names[0..column_count] else &[_][]const u8{}, 325 325 .number_of_columns = column_count, 326 326 }; 327 327 return result;