I find SQL very confusing and archaic that's why I want a safer abstraction layer.
Saying this it becomes even more confusing because of different dialects and differently implemented DB drivers.
> Therefore, you need to determine whether the placeholder needs to be 42 or "42".
This is up to the user of the layer, that's why I need to know if he passed a literal string or number. And to be able to warn him if necessary.
| [reply] |
This is up to the user of the layer, that's why I need to know if he passed a literal string or number. And to be able to warn him if necessary.
Ok ... so you firstly need to know which option the user has chosen.
Having determined that, I would have thought you could just pass on that user-supplied argument as "$x" (if string was chosen) or "$x"+0 (if integer was chosen) without any need to analyse just what that argument was.
But I've never worked with databases so you should probably simply ignore me (and perhaps even be envious ;-)
Cheers, Rob
| [reply] |
query {
package t_table;
WHERE
col < "42"
}
needs to distinguish if the literal was string "42" or 42
Of course I could think about overloading lt too, to have a more Perlish way to get the type (and crosscheck against the table's definition), but the more information I have to catch errors, the better.
I hope my approach is clearer now! :)
| [reply] [d/l] [select] |