Skip to content

Commit

Permalink
[fix] execution of queries
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehristov committed Oct 30, 2020
1 parent dbd22ee commit b413fd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Persistence/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public function lastInsertId(Model $model): string
$query = $this->connection->dsql()->table($model->table);
$query->field($query->expr('max({id_col})', ['id_col' => $model->id_field]), 'max_id');

return $query->getOne();
return (string) $query->getOne();
}

return $this->connection->lastInsertId($this->getIdSequenceName($model));
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/Sql/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function initLimit(): void

protected function doExecute()
{
return $this->dsql->execute();
return $this->dsql->getIterator();
}

protected function doGet(): array
Expand Down
2 changes: 1 addition & 1 deletion tests/ExpressionSqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function testExpressions()
} elseif ($this->getDatabasePlatform() instanceof OraclePlatform) {
$this->assertSame(
'select "id","name","surname","cached_name",("name" || \' \' || "surname") "full_name" from "user" where (("name" || \' \' || "surname") != "cached_name")',
$m->action('select')->render()
$m->toQuery()->select()->render()
);
} elseif ($this->getDatabasePlatform() instanceof MySQLPlatform) {
$this->assertSame(
Expand Down

0 comments on commit b413fd1

Please sign in to comment.