DB Entities, SQL Update

This commit is contained in:
2022-06-17 20:53:35 +02:00
parent 6bbf517196
commit 6d600d4004
17 changed files with 443 additions and 70 deletions

View File

@@ -1,8 +1,6 @@
<?php
namespace Driver\SQL\Query;
use Driver\SQL\Column\IntColumn;
namespace Driver\SQL\Column;
class BigIntColumn extends IntColumn {

View File

@@ -0,0 +1,10 @@
<?php
namespace Driver\SQL\Column;
class DoubleColumn extends NumericColumn {
public function __construct(string $name, bool $nullable, $defaultValue = NULL, ?int $totalDigits = null, ?int $decimalDigits = null) {
parent::__construct($name, $nullable, $defaultValue, $totalDigits, $decimalDigits);
$this->type = "DOUBLE";
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Driver\SQL\Column;
class FloatColumn extends NumericColumn {
public function __construct(string $name, bool $nullable, $defaultValue = NULL, ?int $totalDigits = null, ?int $decimalDigits = null) {
parent::__construct($name, $nullable, $defaultValue, $totalDigits, $decimalDigits);
$this->type = "FLOAT";
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Driver\SQL\Column;
use Driver\SQL\Column\Column;
class NumericColumn extends Column {
protected string $type;
private ?int $totalDigits;
private ?int $decimalDigits;
public function __construct(string $name, bool $nullable, $defaultValue = NULL, ?int $totalDigits = null, ?int $decimalDigits = null) {
parent::__construct($name, $nullable, $defaultValue);
$this->totalDigits = $totalDigits;
$this->decimalDigits = $decimalDigits;
$this->type = "NUMERIC";
}
public function getDecimalDigits(): ?int {
return $this->decimalDigits;
}
public function getTotalDigits(): ?int {
return $this->totalDigits;
}
public function getTypeName(): string {
return $this->type;
}
}