1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 05:07:36 +02:00

added JSON support [Closes #269]

This commit is contained in:
David Grudl
2018-03-23 13:45:24 +01:00
parent 7481c38759
commit 0a19ccbf80
3 changed files with 5 additions and 0 deletions

View File

@@ -189,6 +189,7 @@ class Helpers
'TIME' => Type::DATETIME, // DATETIME, TIMESTAMP
'DATE' => Type::DATE,
'BOOL' => Type::BOOL,
'JSON' => Type::JSON,
];
foreach ($patterns as $s => $val) {

View File

@@ -495,6 +495,9 @@ class Result implements IDataSource
} elseif ($type === Type::BINARY) {
$row[$key] = $this->getResultDriver()->unescapeBinary($value);
} elseif ($type === Type::JSON) {
$row[$key] = json_decode($value);
}
}
}

View File

@@ -18,6 +18,7 @@ class Type
public const
TEXT = 's', // as 'string'
BINARY = 'bin',
JSON = 'json',
BOOL = 'b',
INTEGER = 'i',
FLOAT = 'f',