{"action":"closed","issue":{"url":"https://api.github.com/repos/couchbaselabs/go_n1ql/issues/3","labels_url":"https://api.github.com/repos/couchbaselabs/go_n1ql/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/couchbaselabs/go_n1ql/issues/3/comments","events_url":"https://api.github.com/repos/couchbaselabs/go_n1ql/issues/3/events","html_url":"https://github.com/couchbaselabs/go_n1ql/issues/3","id":108333334,"number":3,"title":"unstable column order in rows.Scan() binding?","user":{"login":"jchris","id":253,"avatar_url":"https://avatars.githubusercontent.com/u/253?v=3","gravatar_id":"","url":"https://api.github.com/users/jchris","html_url":"https://github.com/jchris","followers_url":"https://api.github.com/users/jchris/followers","following_url":"https://api.github.com/users/jchris/following{/other_user}","gists_url":"https://api.github.com/users/jchris/gists{/gist_id}","starred_url":"https://api.github.com/users/jchris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchris/subscriptions","organizations_url":"https://api.github.com/users/jchris/orgs","repos_url":"https://api.github.com/users/jchris/repos","events_url":"https://api.github.com/users/jchris/events{/privacy}","received_events_url":"https://api.github.com/users/jchris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-25T14:05:38Z","updated_at":"2015-12-15T22:24:38Z","closed_at":"2015-12-15T22:24:37Z","body":"Apologies for the screenshots. I am wrapping up my experiments with this because I think the overhead in conforming to the sql.DB interface is unnecessary in my case. However I noticed odd behavior where the bindings in Scan don't seem to be stable. I can't really trace it down, maybe it's happening in the sql.DB standard library code?\r\n\r\nYou see the key and value being reversed across refreshes. I am calling `stmt, err := db.N1QLConnection.Prepare(query)` with each HTTP request to my server (not recommended but maybe part of reproducing what I see.) In the screenshots the JSON `key` should always correspond to the meta object, but it sometimes doesn't, and I can't figure out why.\r\n\r\nI am calling `rows.Scan(&meta, &value)` to get the results of a query like `SELECT META(default), beer from default WHERE beer IS NOT NULL` but my results vary across browser refresh. It's like sometimes `meta` is getting bound to the first result column and sometimes they are switched. I haven't tried with results with more than two columns yet.\r\n\r\n<img width=\"682\" alt=\"screen shot 2015-09-25 at 6 42 21 am\" src=\"https://cloud.githubusercontent.com/assets/253/10102092/7f82d29e-6351-11e5-9f81-3c6f6d0867d5.png\">\r\n\r\n<img width=\"676\" alt=\"screen shot 2015-09-25 at 6 42 45 am\" src=\"https://cloud.githubusercontent.com/assets/253/10102097/89a39cd6-6351-11e5-9d34-3a6718e5d6de.png\">\r\n\r\nHere is a screenshot of my code, and [a link to the branch.](https://github.com/couchbase/sync_gateway/tree/feature/n1ql)\r\n\r\n<img width=\"561\" alt=\"screen shot 2015-09-25 at 6 43 01 am\" src=\"https://cloud.githubusercontent.com/assets/253/10102131/a0cbefee-6351-11e5-9858-66a87514b729.png\">\r\n\r\nI was able to reproduce the screenshots from fresh material as gists https://gist.github.com/jchris/a921a72f102aa5210d04"}}