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

Database: placeholder for column name #1324

Closed
hrach opened this issue Dec 30, 2013 · 1 comment
Closed

Database: placeholder for column name #1324

hrach opened this issue Dec 30, 2013 · 1 comment

Comments

@hrach
Copy link
Contributor

hrach commented Dec 30, 2013

Would be nice to have some placeholder for column (table names). In dibi there is %n modifier. This is really needed for security reasons. Have you any sugestions, what it could be?

Some char combinations? Or appending some letter to ?


Example what people do and they do it bad:

$updateStatement[$key] = "VALUES($key)";

Bad proposed solution

$updateStatement[$key] = new Nette\Database\SqlLiteral("VALUES($key)");

Current correct solution

$delimitedKey = $context->connection->supplementalDriver->delimite($key);
$updateStatement[$key] = $context::literal('VALUES(' . $delimitedKey . ')');

Possible solution after implementing this:

$updateStatement[$key] = $context::literal('VALUES(?n)', $key);
@JanTvrdik
Copy link
Contributor

👍 I miss this feature even though I don't use NDB.

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

2 participants