public function insertGetId(array $row, string $sequence = null)
    {
        try {
            $query = (clone $this)->addInsert([$row])->apply($this->database->getTablePrefixer());
            $statements = $this->database->getGrammar()->compileInsert($query);

            $id = null;
            foreach ($statements as $statement) {
                $id = $this->database->insertGetId($statement->getSQL(), $statement->getBindings(), $sequence);
            }

            return $id;
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }