- A lot of work done on bug fixing. Added a new SQLite adapter
This commit is contained in:
1 parent
667df92e52
commit
c14644cdda
28 files changed
+727
-234
No files matched your search
@@ -5,7 +5,7 @@ namespace Ulmus\Repository;
|
||||
use Ulmus\{ Repository, Query };
|
||||
|
||||
class MssqlRepository extends Repository {
|
||||
|
||||
/*
|
||||
protected function finalizeQuery() : void
|
||||
{
|
||||
if ( null !== $offset = $this->queryBuilder->getFragment(Query\Offset::class) ) {
|
||||
@@ -39,5 +39,34 @@ class MssqlRepository extends Repository {
|
||||
$this->queryBuilder->removeFragment($limit);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
protected function finalizeQuery() : void
|
||||
{
|
||||
if ( null !== $offset = $this->queryBuilder->getFragment(Query\MsSQL\Offset::class) ) {
|
||||
# an order by is mandatory for mssql offset/limit
|
||||
if ( null === $order = $this->queryBuilder->getFragment(Query\OrderBy::class) ) {
|
||||
$this->orderBy("(SELECT 0)");
|
||||
}
|
||||
|
||||
if ( empty ($offset->offset ) ) {
|
||||
if ( null !== $select = $this->queryBuilder->getFragment(Query\Select::class) ) {
|
||||
$select->top = $offset->limit;
|
||||
}
|
||||
elseif ( null !== $delete = $this->queryBuilder->getFragment(Query\Delete::class) ) {
|
||||
$delete->top = $offset->limit;
|
||||
}
|
||||
|
||||
$this->queryBuilder->removeFragment($offset);
|
||||
}
|
||||
elseif ( empty($offset->limit) ) {
|
||||
throw new \Exception("Your offset query fragment is missing a LIMIT value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function serverRequestCountRepository() : Repository
|
||||
{
|
||||
return new static($this->entityClass, $this->alias, $this->adapter);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user