3 namespace Wikimedia\Rdbms
;
7 class SQLiteField
implements Field
{
8 private stdClass
$info;
9 private string $tableName;
11 public function __construct( stdClass
$info, string $tableName ) {
13 $this->tableName
= $tableName;
16 public function name() {
17 return $this->info
->name
;
20 public function tableName() {
21 return $this->tableName
;
24 public function defaultValue() {
25 if ( is_string( $this->info
->dflt_value
) ) {
27 if ( preg_match( '/^\'(.*)\'$/', $this->info
->dflt_value
, $matches ) ) {
28 return str_replace( "''", "'", $matches[1] );
32 return $this->info
->dflt_value
;
38 public function isNullable() {
39 return !$this->info
->notnull
;
42 public function type() {
43 return $this->info
->type
;