- WIP on Migration of MsSQL
This commit is contained in:
1 parent
c54de30069
commit
fb4985160a
17 files changed
+252
-175
No files matched your search
@@ -2,19 +2,35 @@
|
||||
|
||||
namespace Ulmus\Repository;
|
||||
|
||||
use Ulmus\{Repository, Query, Ulmus, Common};
|
||||
use Ulmus\{EntityCollection, Repository, Query, Entity, Ulmus, Common};
|
||||
|
||||
class MssqlRepository extends Repository {
|
||||
|
||||
protected function finalizeQuery() : void
|
||||
{
|
||||
if ( $this->queryBuilder->getFragment(Query\MsSQL\Offset::class) ) {
|
||||
if (null === $order = $this->queryBuilder->getFragment(Query\OrderBy::class)) {
|
||||
$delete = $this->queryBuilder->getFragment(Query\Delete::class);
|
||||
$offset = $this->queryBuilder->getFragment(Query\MsSQL\Offset::class);
|
||||
|
||||
if ($offset) {
|
||||
if ( $delete ) {
|
||||
$delete->top = $offset->limit;
|
||||
|
||||
$this->queryBuilder->removeFragment(Query\MsSQL\Offset::class);
|
||||
}
|
||||
elseif (null === $this->queryBuilder->getFragment(Query\OrderBy::class)) {
|
||||
$this->orderBy("(SELECT 0)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function listColumns(? string $table = null) : EntityCollection
|
||||
{
|
||||
$table ??= $this->entityResolver->tableName();
|
||||
$this->showColumnsSqlQuery($table);
|
||||
|
||||
return $this->collectionFromQuery(Entity\Mssql\Column::class)->iterate(fn($e) => $e->tableName = $table);
|
||||
}
|
||||
|
||||
protected function serverRequestCountRepository() : Repository
|
||||
{
|
||||
return new static($this->entityClass, $this->alias, $this->adapter);
|
||||
|
||||
Reference in new issue
Block a user