squirrel
squirrel copied to clipboard
Named and positional placeholder support
I only see documentation for using '?' as a placeholder. This is a request for more robust placeholder syntax, so the following would work:
Desired behavior:
keyBytes := req.GetKey().GetKeyBytes()
valueBytes := req.GetValue().GetValueBytes()
insertBuilder := psq.Insert("keyvals(key, value)").Values(keyBytes, valueBytes)
if req.GetOverwrite() {
insertBuilder = insertBuilder.Suffix("ON CONFLICT DO UPDATE SET value = ?{2}")
}
Possible today:
keyBytes := req.GetKey().GetKeyBytes()
valueBytes := req.GetValue().GetValueBytes()
insertBuilder := psq.Insert("keyvals(key, value)").Values(keyBytes, valueBytes)
if req.GetOverwrite() {
insertBuilder = insertBuilder.Suffix("ON CONFLICT DO UPDATE SET value = ?", valueBytes)
}
Long ago I considered adding support for other parameter syntax, but it would be a ton of work with squirrel's existing design. I don't think it is going to happen in this project.