public function run ($query, $bind=[]) {
        try {
            $this->handle = $this->prepare($query);
            $this->handle->execute($bind);

            // check what the query begins with
            if (preg_match('/^(select|describe|pragma)/i', $query)) {
                // return a result set
                return $this->handle->fetchAll();
            }

            if (preg_match('/^(delete|insert|update)/i', $query)) {
                // return the affected row count
                return $this->rowCount();
            }

            // default to simply indicating success
            return true;
        } catch (\PDOException $e) {
            $this->error = $e->getMessage();
            return false;
        }
    }