Pass Parameter in the SQL Statement

Parameters can be passed either as tuple (ordered parameters) or as dictionary (named parameters, preferred way to do it.)

named parameter example is present in docs:
https://frappeframework.com/docs/v13/user/en/api/database#frappedbsql

btw this isn’t frappe specific, it’s python DB-API spec: PEP 249 – Python Database API Specification v2.0 | peps.python.org