Add ability to decrypt fields

Where is `sql_function` used?