picodb(mssql): teach picodb to use TOP for limits on MSSQL

This commit is contained in:
Joe Nahmias
2022-07-08 15:32:29 -04:00
committed by Frédéric Guillot
parent 5493c2997e
commit 37bc859df5
3 changed files with 38 additions and 2 deletions

View File

@@ -30,6 +30,14 @@ abstract class Base
*/
protected $pdo = null;
/**
* use TOP or LIMIT for returning a subset of rows
*
* @access public
* @var bool
*/
public bool $useTop;
/**
* Create a new PDO connection
*
@@ -128,6 +136,7 @@ abstract class Base
$this->createConnection($settings);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->useTop = false;
}
/**
@@ -231,4 +240,5 @@ abstract class Base
{
return $this->getConnection()->query('SELECT VERSION()')->fetchColumn();
}
}