Skip to content

Commit d7d299c

Browse files
committed
PgColumn name as it is from select
1 parent 71e761c commit d7d299c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ target/
55
.idea
66
*.iml
77
src/test/java/com/github/pgasync/impl/Heroku.java
8+
.repository/

src/main/java/com/github/pgasync/impl/PgColumn.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616

1717
/**
1818
* Column index/type pair.
19-
*
19+
*
2020
* @author Antti Laisi
2121
*/
22-
class PgColumn {
22+
class PgColumn{
2323

2424
final int index;
25+
final String name;
2526
final Oid type;
2627

27-
public PgColumn(int index, Oid type) {
28+
public PgColumn(int index, String name, Oid type){
2829
this.index = index;
30+
this.name = name;
2931
this.type = type;
3032
}
3133
}

src/main/java/com/github/pgasync/impl/PgConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void onCompleted() {
186186
static Map<String,PgColumn> getColumns(ColumnDescription[] descriptions) {
187187
Map<String,PgColumn> columns = new HashMap<>();
188188
for (int i = 0; i < descriptions.length; i++) {
189-
columns.put(descriptions[i].getName().toUpperCase(), new PgColumn(i, descriptions[i].getType()));
189+
columns.put(descriptions[i].getName().toUpperCase(), new PgColumn(i, descriptions[i].getName(), descriptions[i].getType()));
190190
}
191191
return columns;
192192
}

0 commit comments

Comments
 (0)