-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Currently in order to use arguments with SQL queries I'm using question marks ?. I wonder, how difficult it would to add support for named parameters to be able to write queries like this:
updateUploadHistory :: UTCTime -> m ()
updateUploadHistory curTime = executeNamed_ [sql|
INSERT INTO file_upload_history
(file_name, uploader_id, timestamp, data_type, remarks)
VALUES
(:file, :uploader, :time, :type, :remarks)
|] [ ":file" := duFileName
, ":uploader" := adminId
, ":time" := curTime
, ":type" := duDataType
, ":remarks" := duRemarks
]It's much more convenient to write with named arguments (as any other query) because we don't need to care about order in which arguments are passed.
Metadata
Metadata
Assignees
Labels
No labels