Skip to content

Commit

Permalink
Fix method resetSequence(). (#369)
Browse files Browse the repository at this point in the history
* Fix method `resetSequence()`.
  • Loading branch information
terabytesoftw committed Oct 14, 2022
1 parent cec7b63 commit eb6f754
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Command/Command.php
Expand Up @@ -326,7 +326,7 @@ public function dropView(string $viewName): static
/**
* @throws Exception|NotSupportedException
*/
public function executeResetSequence(string $table, array|int|string $value = null): static
public function executeResetSequence(string $table, int|string $value = null): static
{
return $this->resetSequence($table, $value);
}
Expand Down Expand Up @@ -524,7 +524,7 @@ public function renameTable(string $table, string $newName): static
/**
* @throws Exception|NotSupportedException
*/
public function resetSequence(string $table, array|int|string $value = null): static
public function resetSequence(string $table, int|string $value = null): static
{
$sql = $this->queryBuilder()->resetSequence($table, $value);
return $this->setSql($sql);
Expand Down
10 changes: 5 additions & 5 deletions src/Command/CommandInterface.php
Expand Up @@ -496,12 +496,12 @@ public function execute(): int;
* maximum existing value +1.
*
* @param string $table The name of the table whose primary key sequence is reset.
* @param array|int|string|null $value The value for the primary key of the next new row inserted. If this is not
* set, the next new row's primary key will have the maximum existing value +1.
* @param int|string|null $value The value for the primary key of the next new row inserted. If this is not set, the
* next new row's primary key will have the maximum existing value +1.
*
* @return static
*/
public function executeResetSequence(string $table, array|int|string $value = null): static;
public function executeResetSequence(string $table, int|string $value = null): static;

/**
* Return the params used in the last query.
Expand Down Expand Up @@ -677,12 +677,12 @@ public function renameTable(string $table, string $newName): static;
* or 1.
*
* @param string $table The name of the table whose primary key sequence will be reset.
* @param array|int|string|null $value The value for the primary key of the next new row inserted. If this is not
* @param int|string|null $value The value for the primary key of the next new row inserted. If this is not
* set, the next new row's primary key will have a value 1.
*
* @return static
*/
public function resetSequence(string $table, array|int|string $value = null): static;
public function resetSequence(string $table, int|string $value = null): static;

/**
* Specifies the SQL statement to be executed. The SQL statement will not be modified in any way.
Expand Down
2 changes: 1 addition & 1 deletion src/QueryBuilder/DMLQueryBuilder.php
Expand Up @@ -130,7 +130,7 @@ public function insertEx(string $table, QueryInterface|array $columns, array &$p
/**
* @throws NotSupportedException
*/
public function resetSequence(string $tableName, array|int|string|null $value = null): string
public function resetSequence(string $tableName, int|string|null $value = null): string
{
throw new NotSupportedException(static::class . ' does not support resetting sequence.');
}
Expand Down
4 changes: 2 additions & 2 deletions src/QueryBuilder/DMLQueryBuilderInterface.php
Expand Up @@ -109,14 +109,14 @@ public function insertEx(string $table, QueryInterface|array $columns, array &$p
* or 1.
*
* @param string $tableName the name of the table whose primary key sequence will be reset.
* @param array|int|string|null $value the value for the primary key of the next new row inserted. If this is not
* @param int|string|null $value the value for the primary key of the next new row inserted. If this is not
* set, the next new row's primary key will have a value 1.
*
* @throws Exception|NotSupportedException if this is not supported by the underlying DBMS.
*
* @return string the SQL statement for resetting sequence.
*/
public function resetSequence(string $tableName, array|int|string|null $value = null): string;
public function resetSequence(string $tableName, int|string|null $value = null): string;

/**
* Builds a SQL statement for truncating a DB table.
Expand Down
2 changes: 1 addition & 1 deletion src/QueryBuilder/QueryBuilder.php
Expand Up @@ -373,7 +373,7 @@ public function renameTable(string $oldName, string $newName): string
return $this->ddlBuilder->renameTable($oldName, $newName);
}

public function resetSequence(string $tableName, array|int|string|null $value = null): string
public function resetSequence(string $tableName, int|string|null $value = null): string
{
return $this->dmlBuilder->resetSequence($tableName, $value);
}
Expand Down

0 comments on commit eb6f754

Please sign in to comment.