Skip to content

Commit

Permalink
feature: deprecate runDdl and runDdls
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-oyama committed May 1, 2023
1 parent 3742d45 commit 63a4288
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v5.1.1

Added
- Added deprecation warnings to `Connection::runDdl` and `Connection::runDdls` (#98)

# v5.1.0

Added
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"google/cloud-spanner": "~1.58.2",
"grpc/grpc": "^1.42",
"symfony/cache": "~6",
"symfony/deprecation-contracts": "~2",
"symfony/lock": "~6"
},
"require-dev": {
Expand Down
5 changes: 5 additions & 0 deletions src/Concerns/ManagesDataDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,32 @@

use Google\Cloud\Core\LongRunning\LongRunningOperation;
use Google\Cloud\Spanner\Database;
use function trigger_deprecation;

/**
* @method Database getSpannerDatabase()
*/
trait ManagesDataDefinitions
{
/**
* @deprecated use runDdlBatch() instead
* @param string $ddl
* @return LongRunningOperation
*/
public function runDdl(string $ddl): LongRunningOperation
{
trigger_deprecation('colopl/laravel-spanner', '5.1.1', 'runDdl() is deprecated. Use runDdlBatch() instead.');
return $this->getSpannerDatabase()->updateDdl($ddl);
}

/**
* @deprecated use runDdlBatch() instead
* @param string[] $ddls
* @return LongRunningOperation
*/
public function runDdls(array $ddls): LongRunningOperation
{
trigger_deprecation('colopl/laravel-spanner', '5.1.1', 'runDdls() is deprecated. Use runDdlBatch() instead.');
return $this->getSpannerDatabase()->updateDdlBatch($ddls);
}

Expand Down

0 comments on commit 63a4288

Please sign in to comment.