public function insertGetId(string $query, array $values = [], string $sequence = null)
    {
        try {
            $this->executeStatement($query, $values);
            $id = $this->pdo->lastInsertId($sequence);
            return is_numeric($id) ? (int)$id : $id;
        } catch (\Throwable $exception) {
            throw static::wrapException($exception, $query, $values);
        }
    }