Node: merge to_sql and node_to_sql