If you're looking for a higher level interface, GritQL[0] is built on top of tree-sitter and could handle the same refactor with this query:
language python `def $_($_): $_` as $func where $func <: contains `database` => `db`
If you're looking for a higher level interface, GritQL[0] is built on top of tree-sitter and could handle the same refactor with this query:
[0] https://github.com/getgrit/gritql