src/PDO/CommandPDOSqlite.php
/**
     * Executes the SQL statement.
     *
     * This method should only be used for executing non-query SQL statement, such as `INSERT`, `DELETE`, `UPDATE` SQLs.
     * No result set will be returned.
     *
     * @throws Exception|Throwable execution failed.
     *
     * @return int number of rows affected by the execution.
     */
Executes the SQL statement.

@throws Exception|Throwable execution failed.

@return int number of rows affected by the execution.
Executes the SQL statement . @throws Exception|Throwable execution failed . @return int number of rows affected by the execution .
public function execute(): int
    {
        $sql = $this->getSql() ?? '';
        $params = $this->params;
        $statements = $this->splitStatements($sql, $params);
        if ($statements === false) {
            return parent::execute();
        }
        $result = 0;
        foreach ($statements as $statement) {
            [$statementSql, $statementParams] = $statement;
            $statementSql = is_string($statementSql) ? $statementSql : '';
            $statementParams = is_array($statementParams) ? $statementParams : [];
            $this->setSql($statementSql)->bindValues($statementParams);
            $result = parent::execute();
        }
        $this->setSql($sql)->bindValues($params);
        return $result;
    }
public function execute ( ) : int { $ sql = $ this -> getSql ( ) ?? '' ; $ params = $ this -> params ; $ statements = $ this -> splitStatements ( $ sql , $ params ) ; if ( $ statements === false ) { return parent :: execute ( ) ; } $ result = 0 ; foreach ( $ statements as $ statement ) { [ $ statementSql , $ statementParams ] = $ statement ; $ statementSql = is_string ( $ statementSql ) ? $ statementSql : '' ; $ statementParams = is_array ( $ statementParams ) ? $ statementParams : [ ] ; $ this -> setSql ( $ statementSql ) -> bindValues ( $ statementParams ) ; $ result = parent :: execute ( ) ; } $ this -> setSql ( $ sql ) -> bindValues ( $ params ) ; return $ result ; }
Executes the SQL statement.
Executes the SQL statement .
/** @var array<string, string> */ /** @psalm-var array<array-key, array<array-key, string|array>> $statements */