Port database queries from d6 to d7
The closest thing I know of to take a string db_query() value would be the Query Coder module.

Be aware of its known issues:

Known issues (taken from project page 01-29-2015):


INSERT queries must be specified in form "INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)"
Not support "->expression()" conditions for UPDATE queries.
All tables and fields in SELECT query must be specified with aliases, in other (UPDATE, INSERT, DELETE) queries without aliases
Example:
RIGHT: "SELECT * FROM users u"
NOT RIGHT: "SELECT * FROM users"
All combining conditions in SELECT queries must be specified with aliases.
Example:
RIGHT: "SELECT COUNT() AS user_count FROM users u"
NOT RIGHT: "SELECT COUNT() FROM users u".