Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: do primary key check on server side #177

Merged
merged 4 commits into from
Feb 1, 2024

Conversation

taka-oyama
Copy link
Collaborator

There is no need to do it on the client side. Server will throw a more precise error anyway.

Before:

LogicException: Cloud Spanner require a primary key!

After:

Google\Cloud\Core\Exception\BadRequestException: {
    "message": "Error parsing Spanner DDL statement: create table `Temp_20240126_054222_000` (`id` string(36) not null)  : Syntax error on line 1, column 67: Expecting 'PRIMARY' but found 'EOF'",
    "code": 3,
    "status": "INVALID_ARGUMENT",
    "details": [
        {
            "@type": "grpc-status-details-bin",
            "data": "<Unknown Binary Data>"
        }
    ]
}

@taka-oyama taka-oyama added the enhancement New feature or request label Jan 26, 2024
@taka-oyama taka-oyama self-assigned this Jan 26, 2024
@taka-oyama taka-oyama merged commit 675aa8d into master Feb 1, 2024
1 check passed
@taka-oyama taka-oyama deleted the feature/primary-key-check branch February 1, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants