24 lines
560 B
PHP
24 lines
560 B
PHP
<?php
|
|
|
|
namespace Nest\Database\PostgreSql\Columns;
|
|
|
|
use Stringable;
|
|
|
|
/**
|
|
* PostgreSQL numeric column type.
|
|
*/
|
|
class Numeric implements Stringable
|
|
{
|
|
/**
|
|
* @param int $precision Precision of the numeric column type.
|
|
* @param int $scale Scale of the numeric column type.
|
|
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL
|
|
*/
|
|
public function __construct(protected int $precision, protected int $scale = 0)
|
|
{}
|
|
|
|
public function __toString(): string
|
|
{
|
|
return "numeric($this->precision, $this->scale)";
|
|
}
|
|
}
|