Use orConditionGroup with query (non entity) I've used orConditionGroups with queries before. Specifically with entity queries. But now I have a custom sql table I created separate from drupal but still on the same database I have access to. I want to update a row if any of the fields are different but I'm having generating the or statement. Here was my attempt.

$connection = \Drupal::database();
$orConditionGroup = $connection-&gt;orConditionGroup()-&gt;condition('address', $fulladdress, '!=')-&gt;condition('full_name', $fullname, '!=')-&gt;condition('telephone', $workphone, '!=');
  $connection-&gt;update($table)-&gt;fields(['full_name' =&gt; $fullname, 'address' =&gt; $fulladdress, 'telephone' =&gt; $workphone, 'email' =&gt; $email])-&gt;condition('id', $id)-&gt;condition($orConditionGroup);


But I get the error


  undefined method
  Drupal\Core\Database\Driver\mysql\Connection::condition()


Which makes sense since the connection class isn't a query object on its own, but not sure how else to tackle this. How would I create an orConditionGroup for just a plain direct sql query that isn't a drupal entity or anything like that?
I was able to get it to work by added the select method to the connection object like so:

$orConditionGroup = $connection-&gt;select($table)
                    -&gt;orConditionGroup()
                    -&gt;condition('address', $fulladdress, '!=')
                    -&gt;condition('full_name', $fullname, '!=')
                    -&gt;condition('telephone', $workphone, '!=');