Update namespaces
This commit is contained in:
9
src/Define/Query.php
Normal file
9
src/Define/Query.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Database\Define;
|
||||
|
||||
use Stringable;
|
||||
|
||||
interface Query extends Stringable
|
||||
{
|
||||
public function build(): string;
|
||||
}
|
14
src/Define/Query/Builder.php
Normal file
14
src/Define/Query/Builder.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace Database\Define\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;
|
||||
}
|
11
src/Define/Query/Create.php
Normal file
11
src/Define/Query/Create.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Create extends Query
|
||||
{
|
||||
public function table(string $table): self;
|
||||
public function columns(array|string $columns): self;
|
||||
public function foreign(array|string $columnDefinition): self;
|
||||
}
|
10
src/Define/Query/Delete.php
Normal file
10
src/Define/Query/Delete.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Delete extends Query
|
||||
{
|
||||
public function from(string $table): self;
|
||||
public function where(array|string $conditions): self;
|
||||
}
|
9
src/Define/Query/Drop.php
Normal file
9
src/Define/Query/Drop.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Drop extends Query
|
||||
{
|
||||
public function table(string $table): self;
|
||||
}
|
12
src/Define/Query/Insert.php
Normal file
12
src/Define/Query/Insert.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Insert extends Query
|
||||
{
|
||||
public function into(string $table): self;
|
||||
public function columns(array|string $columns): self;
|
||||
public function values(array|string $values): self;
|
||||
public function select(Select|string $select): self;
|
||||
}
|
15
src/Define/Query/Select.php
Normal file
15
src/Define/Query/Select.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Select extends Query
|
||||
{
|
||||
public function columns(array|string $columns = '*'): self;
|
||||
public function from(string $table): self;
|
||||
public function joined(array|string $joins): self;
|
||||
public function where(array|string $conditions): self;
|
||||
public function groupBy(array|string $grouping): self;
|
||||
public function having(array|string $having): self;
|
||||
public function orderBy(array|string $ordering): self;
|
||||
}
|
9
src/Define/Query/Truncate.php
Normal file
9
src/Define/Query/Truncate.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Truncate extends Query
|
||||
{
|
||||
public function table(string $table): self;
|
||||
}
|
11
src/Define/Query/Update.php
Normal file
11
src/Define/Query/Update.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Database\Define\Query;
|
||||
|
||||
use Database\Define\Query;
|
||||
|
||||
interface Update extends Query
|
||||
{
|
||||
public function table(string $table): self;
|
||||
public function set(array|string $value_pairs): self;
|
||||
public function where(array|string $conditions): self;
|
||||
}
|
Reference in New Issue
Block a user