code: function(query, dialect) {
    var sql = query.sql || (query.table && query.table.sql);
    var Dialect;
  
    if (dialect) {
      // dialect is specified
      Dialect = getDialect(dialect);
    } else if (sql && sql.dialect) {
      // dialect is not specified, use the dialect from the sql instance
      Dialect = sql.dialect;
    } else {
      // dialect is not specified, use the default dialect
      Dialect = require('../').dialect;
    }
    return Dialect;
  }
docs: Before the change that introduced parallel dialects, every node could be turned into a query. The parallel dialects change made it impossible to change some nodes into a query because not all nodes are constructed with the sql instance.