Automattic\WooCommerce\Database\Migrations

TableMigrator::db_query()protectedWC 1.0

Run $wpdb->query and add the error, if any, to the errors list.

{} It's a method of the class: TableMigrator{}

No Hooks.

Return

Mixed. Whatever $wpdb->query returns.

Usage

// protected - for code of main (parent) or child class
$result = $this->db_query( $query );
$query(string) (required)
The SQL query to run.

Code of TableMigrator::db_query() WC 7.1.0

protected function db_query( string $query ) {
	$wpdb = WC()->get_global( 'wpdb' );

	// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
	$result = $wpdb->query( $query );

	if ( '' !== $wpdb->last_error ) {
		$this->add_error( $wpdb->last_error );
	}

	return $result;
}