sky-uk / cqlmigrate

Cassandra schema migration library
BSD 3-Clause "New" or "Revised" License
47 stars 29 forks source link

Update CqlLoader logic to cope with strings containing semicolons #18

Closed SebDuff closed 8 years ago

SebDuff commented 8 years ago

Also added unit tests to cover escaped quotes inside of strings

chbatey commented 8 years ago

We've had to test string parsing logic by side effects to a database due to the coupling of working out what we want to do with the side effect of executing it in a database.

Can we separate out the gathering the cql statements to execute and executing them so that all the tests with semi colons in strings etc don't need to involve a database?

oliverlockwood commented 8 years ago

Good call, I'm working on splitting into two classes CqlLoader and CqlFileParser. Stand by.

oliverlockwood commented 8 years ago

@chbatey comments addressed, and I've split the logic out. Two of the tests still make sense in the overall DB-executing CqlMigratorImplTest, but one of them has been split into a test for the new isolated class. See what you think.