public function testPgSrvParseIfNull() { $dongle = new Dongle('pgsql'); $result = $dongle->parseIfNull("select ifnull(1,0) from table"); $this->assertEquals("select coalesce(1,0) from table", $result); $result = $dongle->parseIfNull("select IFNULL(1,0) from table"); $this->assertEquals("select coalesce(1,0) from table", $result); }
public function testSqliteParseGroupConcat() { $dongle = new Dongle('sqlite'); $result = $dongle->parseGroupConcat("group_concat(first_name separator ', ')"); $this->assertEquals("group_concat(first_name, ', ')", $result); $result = $dongle->parseGroupConcat("group_concat(sometable.first_name SEPARATOR ', ')"); $this->assertEquals("group_concat(sometable.first_name, ', ')", $result); }
public function testSqliteParseBooleanExpression() { $dongle = new Dongle('sqlite'); $result = $dongle->parseBooleanExpression("select * from table where is_true = true"); $this->assertEquals("select * from table where is_true = 1", $result); $result = $dongle->parseBooleanExpression("is_true = true and is_false <> true"); $this->assertEquals("is_true = 1 and is_false <> 1", $result); $result = $dongle->parseBooleanExpression("is_true = true and is_false = false or is_whatever = 2"); $this->assertEquals("is_true = 1 and is_false = 0 or is_whatever = 2", $result); $result = $dongle->parseBooleanExpression("select * from table where is_true = true"); $this->assertEquals("select * from table where is_true = 1", $result); }
/** * Get the table prefix. * * @return string * @static */ public static function getTablePrefix() { return \October\Rain\Database\Dongle::getTablePrefix(); }