- Added some SearchRequest attributes ; now it's even simpler to add searchable fields
- Began decoupling of QueryBuilder from native MySQL method ; some works needs to be done on for the Repository object splitting also.
This commit is contained in:
1 parent
15be1597b8
commit
4571517dc8
30 files changed
+1007
-615
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\QueryBuilder\Sql;
|
||||
|
||||
use Ulmus\Query;
|
||||
use Ulmus\QueryBuilder\SqlQueryBuilder;
|
||||
|
||||
# Soon to extends SqlQueryBuilder
|
||||
class SqliteQueryBuilder extends MysqlQueryBuilder implements Query\QueryBuilderInterface
|
||||
{
|
||||
public function pragma(/*object|Stringable*/ $name, $value = null, bool $callable = false) : self
|
||||
{
|
||||
if ( null !== ( $pragma = $this->getFragment(Query\Sqlite\Pragma::class) ) ) {
|
||||
$pragma->set($name, $value, $callable);
|
||||
}
|
||||
else {
|
||||
$pragma = new Query\Sqlite\Pragma();
|
||||
$pragma->set($name, $value, $callable);
|
||||
$this->push($pragma);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function showColumns(string $table) : self
|
||||
{
|
||||
$this->pragma('table_info', $table, true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function showTables(? string $database = null) : self
|
||||
{
|
||||
$show = new Query\Show();
|
||||
|
||||
$this->push($show);
|
||||
|
||||
$show->set(Query\Show::SQL_SHOW_TABLES, $database);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user