Reorder and new queries, also change to Query/Builder
This commit is contained in:
14
src/Concept/Database/Query/Builder.php
Normal file
14
src/Concept/Database/Query/Builder.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
interface Builder
|
||||
{
|
||||
public function select(array|string $columns = '*'): Select;
|
||||
public function insert(?string $table = null): Insert;
|
||||
public function update(?string $table = null): Update;
|
||||
public function delete(?string $table = null): Delete;
|
||||
|
||||
public function create(?string $table = null): Create;
|
||||
public function truncate(?string $table = null): Truncate;
|
||||
public function drop(?string $table = null): Drop;
|
||||
}
|
10
src/Concept/Database/Query/Create.php
Normal file
10
src/Concept/Database/Query/Create.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Create extends Query
|
||||
{
|
||||
public function table(string $table): Create;
|
||||
public function columns(array|string $columns): Create;
|
||||
}
|
@ -6,5 +6,5 @@ use ProVM\Concept\Database\Query;
|
||||
interface Delete extends Query
|
||||
{
|
||||
public function from(string $table): Delete;
|
||||
public function where(array $conditions): Delete;
|
||||
public function where(array|string $conditions): Delete;
|
||||
}
|
||||
|
9
src/Concept/Database/Query/Drop.php
Normal file
9
src/Concept/Database/Query/Drop.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Drop extends Query
|
||||
{
|
||||
public function table(string $table): Drop;
|
||||
}
|
@ -6,7 +6,7 @@ use ProVM\Concept\Database\Query;
|
||||
interface Insert extends Query
|
||||
{
|
||||
public function into(string $table): Insert;
|
||||
public function columns(array $columns): Insert;
|
||||
public function values(array $values): Insert;
|
||||
public function select(Select $select): Insert;
|
||||
public function columns(array|string $columns): Insert;
|
||||
public function values(array|string $values): Insert;
|
||||
public function select(Select|string $select): Insert;
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Select extends Query
|
||||
{
|
||||
public function select(array $columns = ['*']): Select;
|
||||
public function columns(array|string $columns = '*'): Select;
|
||||
public function from(string $table): Select;
|
||||
public function joins(array $joins): Select;
|
||||
public function where(array $conditions): Select;
|
||||
public function groupBy(array $grouping): Select;
|
||||
public function having(array $having): Select;
|
||||
public function orderBy(array $ordering): Select;
|
||||
public function joined(array|string $joins): Select;
|
||||
public function where(array|string $conditions): Select;
|
||||
public function groupBy(array|string $grouping): Select;
|
||||
public function having(array|string $having): Select;
|
||||
public function orderBy(array|string $ordering): Select;
|
||||
}
|
||||
|
9
src/Concept/Database/Query/Truncate.php
Normal file
9
src/Concept/Database/Query/Truncate.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Truncate extends Query
|
||||
{
|
||||
public function table(string $table): Truncate;
|
||||
}
|
@ -6,6 +6,6 @@ use ProVM\Concept\Database\Query;
|
||||
interface Update extends Query
|
||||
{
|
||||
public function table(string $table): Update;
|
||||
public function set(array $value_pairs): Update;
|
||||
public function where(array $conditions): Update;
|
||||
public function set(array|string $value_pairs): Update;
|
||||
public function where(array|string $conditions): Update;
|
||||
}
|
||||
|
Reference in New Issue
Block a user