Skip to content

Convert common DDL types and syntax to Spanner equivalents for better compatibility #109

Description

@O1O1O1O

I tried to use the driver with Scala Play Framework but to support the "evolutions" (aka "migrations") feature Play creates tables with DDL using types incompatible with Spanner's eg.

      create table ${schema}play_evolutions (
          id int not null primary key,
          hash varchar(255) not null,
          applied_at timestamp not null,
          apply_script text,
          revert_script text,
          state varchar(255),
          last_problem text
      )

from the source in Github

Although Play specifically could be updated to support Spanner DDL directly (as for Oracle, SQL Server etc.) it occurs to me that if there was a way to map types like int to int64, varchar(x) to string(x), text to string, and collate primary key attributes into a primary key (...) declaration then we'd get wider compatibility beyond Play.

This may not be in the spirit of what JDBC drivers are supposed to do but if possible perhaps it could be turned on only via xxxSQLCompatability=true driver flag?

Alternatively I can create a PR for Play Framework to add Spanner support but given you have the only DDL supporting JDBC driver so far they may not want to do that being such a niche case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions