I am wondering if there is some way to retrieve a hash from the database instead of a list. (I realize that this probably makes streaming data a little bit harder)
Instead of this:
{ . // result set val 1
"id": 1,
"me": 1,
"you": 2,
"contactTime": 1540794446465220000
},
{ // result set val 2
"id": 2,
"me": 2,
"you": 1,
"contactTime": 1540794446465223000
}
I am looking to get a hash from the DB, pre-constructed
{
"1": {
"id": 1,
"me": 1,
"you": 2,
"contactTime": 1540794446465220000
},
"2": {
"id": 2,
"me": 2,
"you": 1,
"contactTime": 1540794446465223000
}
}
in Golang and Postgres (or similar RDBMs) is this possible somehow?