{"action":"created","issue":{"url":"https://api.github.com/repos/twittner/cql-io/issues/4","labels_url":"https://api.github.com/repos/twittner/cql-io/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/twittner/cql-io/issues/4/comments","events_url":"https://api.github.com/repos/twittner/cql-io/issues/4/events","html_url":"https://github.com/twittner/cql-io/issues/4","id":60236691,"number":4,"title":"Prepared statements","user":{"login":"rjmac","id":753700,"avatar_url":"https://avatars.githubusercontent.com/u/753700?v=3","gravatar_id":"","url":"https://api.github.com/users/rjmac","html_url":"https://github.com/rjmac","followers_url":"https://api.github.com/users/rjmac/followers","following_url":"https://api.github.com/users/rjmac/following{/other_user}","gists_url":"https://api.github.com/users/rjmac/gists{/gist_id}","starred_url":"https://api.github.com/users/rjmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjmac/subscriptions","organizations_url":"https://api.github.com/users/rjmac/orgs","repos_url":"https://api.github.com/users/rjmac/repos","events_url":"https://api.github.com/users/rjmac/events{/privacy}","received_events_url":"https://api.github.com/users/rjmac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-08T02:07:56Z","updated_at":"2015-04-05T18:45:09Z","closed_at":null,"body":"I've implemented on [a branch of my fork](https://github.com/rjmac/cql-io/tree/prepared-queries) some prepared statement support for cql-io, adding a `prepare` function and changing the various \"execute query\" functions to take values whose types are instances of `QueryLike` instead of only `QueryString`s.  If you're interested in this, I can send a pull request, but I  thought I'd get your opinion on the approach first, since it does change the signatures (though not the use) of basically everything public in the `IO` package."},"comment":{"url":"https://api.github.com/repos/twittner/cql-io/issues/comments/89831362","html_url":"https://github.com/twittner/cql-io/issues/4#issuecomment-89831362","issue_url":"https://api.github.com/repos/twittner/cql-io/issues/4","id":89831362,"user":{"login":"rjmac","id":753700,"avatar_url":"https://avatars.githubusercontent.com/u/753700?v=3","gravatar_id":"","url":"https://api.github.com/users/rjmac","html_url":"https://github.com/rjmac","followers_url":"https://api.github.com/users/rjmac/followers","following_url":"https://api.github.com/users/rjmac/following{/other_user}","gists_url":"https://api.github.com/users/rjmac/gists{/gist_id}","starred_url":"https://api.github.com/users/rjmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjmac/subscriptions","organizations_url":"https://api.github.com/users/rjmac/orgs","repos_url":"https://api.github.com/users/rjmac/repos","events_url":"https://api.github.com/users/rjmac/events{/privacy}","received_events_url":"https://api.github.com/users/rjmac/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T18:45:09Z","updated_at":"2015-04-05T18:45:09Z","body":"I've converted my prepared-statement-using code to use this branch; it was very straightforward to do.  In writing my branch, (1) had bothered me too (I also looked at the official driver and the Cassandra source code -- the queryid is basically `md5(currentKeyspace ++ query)`) and it would be nice to have a documented guarantee that query IDs are predictable, though at least with the Java driver assuming the same thing it'll require a major protocol version bump to change it.  Having \"create a prepared statement\" be a MonadClient action had also bothered me.  I am mildly nervous about the approach taken in PrepQuery.  It seems like using a non-cryptographic hash of the query text as a key risks rare but hard-to-diagnose bugs."}}