Open dryewo opened 7 years ago
Let me consider this. There might be a better way of achieving the same result.
Also, can you fix the commit message and make sure it's capitalised? So something like:
Add support for parameters to SQL migrations
Since SQL migrations are not necessarily loaded from edn files, I don't think that part of your commit message makes sense.
Done.
Another way might be using:
(if (sequential? s) s [s])
But I don't see any pros/cons.
Oh, actually, there is an issue about this already: #112
Currently,
:up
and:down
migrations are vectors of strings. Each string is then wrapped in a vector and given tojdbc/execute!
However,jdbc/execute!
expects a vector in the format:?
are placeholders, where the"foo"
and42
are substituted in a safe way.Currently there is no possibility to make use of it when defining migrations in EDN.
Would be nice to be able to do something like:
For example, I needed this when I was generating migrations dynamically, inserting some user-defined value into the table.
This patch enables the described functionality.