mattes/migrate — pull request #11 by mihasya (2014-09-09 06:00:50+00:00)
Title: Allow protocol and cql versions to be configured via driver path

> In order to be used with Cassandra 1.2.x, the `ProtocolVersion` value
has to be set to 1 (gocql defaults to 2). This patch makes the migrate
code parse additional options out of the url.

> Tests have been added for this new behavior, as well as to verify that
omitting the optional parameters preserves the defaults as is.

Upon getting through this part and actually trying to run a migration, I discovered the next issue: the driver uses `CREATE TABLE IF NOT EXISTS` syntax, which is only valid in CQL 3.1, that is Cassandra 2.x. In order to make it work with 1.x, I'd have to add a conditional around that statement and just do an old fashioned `SELECT` to see if the table exists before proceeding in case the `ProtocolVersion` is set to 1.

Upon coming to this juncture, I started to wonder - should I just add a `cassandra1.2` driver instead of adding the flexibility into the existing `cassandra` driver? I can see arguments both ways, so I figured I'd check in before I wrote a whole bunch more code. It does beg the question of what'll happen when Cassandra 3.x comes out and the `cassandra` driver as named does not work with it.