I just realized both works slightly differently as below. Please confirm my understanding.
- frappe.get_value/set_value REQUIRES the docname to look up the value.
- frappe.db.get_value/set_value allows you to define the filter clause (like SQL WHERE with/without index) to lookup/set the value.
Pretty useful when you don’t know the name of the doc and want to lookup/set the fields.
e.g. parent doctype = bill, child doctype = bill tax. I wanted to set value of specific bill tax of a known bill.
It helped me to lookup name of the child table row (bill tax) by a second column (tax name) for which I only knew the parent name of the doc (bill).