Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Iterable where comma separated lists are expected #17

Open
ryan-gustafson opened this issue Mar 23, 2016 · 1 comment
Open

Support Iterable where comma separated lists are expected #17

ryan-gustafson opened this issue Mar 23, 2016 · 1 comment

Comments

@ryan-gustafson
Copy link

It's not very DSL friendly, to have to do this:

addUniqueConstraint(columnNames: 'A,B') // Ugh, hard-coded column names with commas to boot
addUniqueConstraint(columnNames: ['A', 'B'].join(',')) // Data driven is better, but must convert to String with commas

When it would be more natural to do this:

addUniqueConstraint(columnNames: ['A', 'B']) //  Data driven, no need to mess with commas! But, doesn't work, seems to pass the toString() result '[A, B]' to Liquibase, which interprets as '[A' and 'B]'.

Only using columnNames and addUniqueConstraint as examples, there are numerous such places in the Liquibase DSL.

@stevesaliman
Copy link
Collaborator

I like the idea, it does feel more natural. Liquibase itself expects a single string to describe the list of columns, but I'm thinking the groovy parser could find arrays and do the join for us.

I hesitate to implement this yet because Liquibase 4 development is underway, and it is probably going to radically change how the groovy parser works, but in good ways. The parser would become much more version agnostic and it would handle things added by Liquibase extensions. At the moment, I'd like to avoid adding a feature that I couldn't carry forward into Liquibase 4.

I'll keep an eye on this as Liquibase 4 becomes more concrete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants