Skip to content

Commit 5be4a3e

Browse files
committed
Expose ColumnDescription.typeId
1 parent 5b52fb7 commit 5be4a3e

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.3.2
4+
5+
- Expose `ColumnDescription.typeId`.
6+
37
## 2.3.1
48

59
- Added support for types `varchar`, `point`, `integerArray`, `doubleArray`, `textArray` and `jsonArray`.

lib/src/execution_context.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ abstract class ColumnDescription {
9494

9595
/// The resolved name of the referenced table.
9696
String get tableName;
97+
98+
/// The Object Identifier of the column type.
99+
int get typeId;
97100
}
98101

99102
/// A single row of a query result.

lib/src/query.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ class FieldDescription implements ColumnDescription {
238238
final String columnName;
239239
final int tableID;
240240
final int columnID;
241-
final int typeID;
241+
@override
242+
final int typeId;
242243
final int dataTypeSize;
243244
final int typeModifier;
244245
final int formatCode;
@@ -251,7 +252,7 @@ class FieldDescription implements ColumnDescription {
251252
this.columnName,
252253
this.tableID,
253254
this.columnID,
254-
this.typeID,
255+
this.typeId,
255256
this.dataTypeSize,
256257
this.typeModifier,
257258
this.formatCode,
@@ -272,27 +273,27 @@ class FieldDescription implements ColumnDescription {
272273

273274
final tableID = reader.readUint32();
274275
final columnID = reader.readUint16();
275-
final typeID = reader.readUint32();
276+
final typeOid = reader.readUint32();
276277
final dataTypeSize = reader.readUint16();
277278
final typeModifier = reader.readInt32();
278279
final formatCode = reader.readUint16();
279280

280-
final converter = PostgresBinaryDecoder(typeID);
281+
final converter = PostgresBinaryDecoder(typeOid);
281282
return FieldDescription._(
282-
converter, fieldName, tableID, columnID, typeID,
283+
converter, fieldName, tableID, columnID, typeOid,
283284
dataTypeSize, typeModifier, formatCode,
284285
'', // tableName
285286
);
286287
}
287288

288289
FieldDescription change({String? tableName}) {
289-
return FieldDescription._(converter, columnName, tableID, columnID, typeID,
290+
return FieldDescription._(converter, columnName, tableID, columnID, typeId,
290291
dataTypeSize, typeModifier, formatCode, tableName ?? this.tableName);
291292
}
292293

293294
@override
294295
String toString() {
295-
return '$columnName $tableID $columnID $typeID $dataTypeSize $typeModifier $formatCode';
296+
return '$columnName $tableID $columnID $typeId $dataTypeSize $typeModifier $formatCode';
296297
}
297298
}
298299

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: postgres
22
description: PostgreSQL database driver. Supports statement reuse and binary protocol.
3-
version: 2.3.1
3+
version: 2.3.2
44
homepage: https://github.com/isoos/postgresql-dart
55

66
environment:

0 commit comments

Comments
 (0)