php-docs-samples icon indicating copy to clipboard operation
php-docs-samples copied to clipboard

Spanner: Create Backup sample should have latest timestamp as a default.

Open saranshdhingra opened this issue 4 years ago • 0 comments

Currently, we can pass now for the parameter $versionTime to achieve the backup until the current timestamp. The simplest way to make it default can be to use the string now as a default for $versionTime.

This however still means that we pass a DateTime object to Spanner. Perhaps we can also use null as a default, in which case we don't pass the versionTime parameter to the $backup->create() method, thereby letting Spanner take the call which will be equivalent to unchecking Create backup from an earlier point in time in the Cloud Console UI.

saranshdhingra avatar Nov 09 '21 11:11 saranshdhingra