Update namespaces

This commit is contained in:
2025-09-29 16:40:43 -03:00
parent bc3421942f
commit f07ad79e75
66 changed files with 509 additions and 274 deletions

9
src/Define/Query.php Normal file
View File

@ -0,0 +1,9 @@
<?php
namespace Database\Define;
use Stringable;
interface Query extends Stringable
{
public function build(): string;
}

View 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;
}

View 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;
}

View 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;
}

View File

@ -0,0 +1,9 @@
<?php
namespace Database\Define\Query;
use Database\Define\Query;
interface Drop extends Query
{
public function table(string $table): self;
}

View 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;
}

View 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;
}

View File

@ -0,0 +1,9 @@
<?php
namespace Database\Define\Query;
use Database\Define\Query;
interface Truncate extends Query
{
public function table(string $table): self;
}

View 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;
}