Support parameterized statements in SQL migrations#115
Open
dryewo wants to merge 1 commit intoweavejester:masterfrom
Open
Support parameterized statements in SQL migrations#115dryewo wants to merge 1 commit intoweavejester:masterfrom
dryewo wants to merge 1 commit intoweavejester:masterfrom
Conversation
Owner
|
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: Since SQL migrations are not necessarily loaded from edn files, I don't think that part of your commit message makes sense. |
2d46c10 to
dcd9fc6
Compare
Author
|
Done. Another way might be using: But I don't see any pros/cons. |
Author
|
Oh, actually, there is an issue about this already: #112 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
:upand:downmigrations 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"and42are 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:
{:up ["CREATE TABLE foo (id int)" ["INSERT INTO foo(id) VALUES(?)" 1]] :down ["DROP TABLE foo"]}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.