bulkUpsert в PHP SDK нормально не записывает Timestamp
jumper423 opened this issue · 1 comments
jumper423 commented
bulkUpsert в PHP SDK нормально не записывает Timestamp
$this->ydb->beginTransaction();
$this->ydb->createTable('test', [
'id' => 'Uint64',
'datetime' => 'Timestamp',
], 'id');
$this->ydb->bulkUpsert('test', [
[
'id' => 1,
'datetime' => (new \DateTime())->format('c'),
],
], [
'id' => 'Uint64',
'datetime' => 'Timestamp',
]);
print_r($this->ydb->query('SELECT id, datetime FROM test'));
Выдаёт
YandexCloud\Ydb\QueryResult Object
(
[columns:protected] => Array
(
[0] => Array
(
[name] => id
[type] => UINT64
[options] =>
)
[1] => Array
(
[name] => datetime
[type] => TIMESTAMP
[options] =>
)
)
[rows:protected] => Array
(
[0] => Array
(
[id] => 1
[datetime] => 1970-01-01 00:00:00
)
)
[truncated:protected] =>
)
Как видно поле datetime равно 1970-01-01 00:00:00
jumper423 commented
up