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

Usability improvements for migrations with addSql and parameters #186

Closed
gbirke opened this issue Sep 23, 2014 · 5 comments
Closed

Usability improvements for migrations with addSql and parameters #186

gbirke opened this issue Sep 23, 2014 · 5 comments

Comments

@gbirke
Copy link

gbirke commented Sep 23, 2014

The addSqlmethod accepts parameters for creating inserting in a query. This is very useful for data migrations. However, the usability could be improved:

  1. By adding an example to the docs that uses placeholders and a parameters array (or links to http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html where the placeholder syntax is explained)

  2. By including them in the output of --dry-run

@stof
Copy link
Member

stof commented Oct 4, 2014

Can you send a PR addign a link to the DBAL documentation in the relevant place ?

@metalmini
Copy link

+1 on the "By including them in the output of --dry-run" comment

@mikeSimonson
Copy link
Contributor

@gbirke @metalmini
Can you explain what you mean by adding them in the output of --dry-run ?

@aaa2000
Copy link
Contributor

aaa2000 commented Jul 4, 2016

I think that adding them in the output of --dry-run means:

$this->addSql('INSERT INTO FOO VALUES(?)', [10]);

migrations:migrate --dry-run should not only display like that

INSERT INTO FOO VALUES(?)

but rather

INSERT INTO FOO VALUES(?) with parameters [10]

But there will be problems with big parameters array. (With long text, binary value)

@mikeSimonson
Copy link
Contributor

mikeSimonson commented Jul 5, 2016

@aaa2000 Well I would accept both the PR on the doc and the dry run improvements.

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

No branches or pull requests

5 participants