Something like this?

```
sql_subquery <- function(con = NULL, name = NULL, ...) {
  UseMethod("sql_subquery")
}

#' @export
sql_subquery.DBIConnection <- function(con = NULL, name = NULL, ...) {
  sql(paste0(..., " AS ", name))
}
 
#' @export
sql_subquery.OraConnection <- function(con = NULL, name = NULL, ...) {
  sql(paste0(..., name))
}
```

So that it can be called like this:

`build_sql(sql_subquery("(", sql, ") ", name = "master", con = con))`