laravel-spanner: Syntax error with simple table

I am trying to create a simple table with a single column (‘id’), like so

Schema::create('test', function (Blueprint $table) {
	$table->uuid('id');
	$table->primary('id');
});

When I run this (just testing it in a console command for now), I get the following error:

   Google\Cloud\Core\Exception\BadRequestException 

  {
    "message": "[ERROR] syntax error at or near \"`\"; failed to parse the DDL statements.",
    "code": 3,
    "status": "INVALID_ARGUMENT",
    "details": []
}

  at vendor/google/cloud-core/src/GrpcRequestWrapper.php:263

No idea why, its not exactly very helpful

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

The docs should really make it clearer that this library only works if the instance is in Google SQL mode.

We would really appreciate a PR!

Here’s a PR https://github.com/colopl/laravel-spanner/pull/137