Open manuelzander opened 3 years ago
@manuelzander Thank you for creating the Issue and the Pull Request!
I released version v1.9.0
, includes PR #62 and #64.
ARRAY<>
, STRUCT<>
is not yet supported.
Because I have to consider how to implement it.
Please wait a little longer.
Thanks.
Several Spanner data types are currently not supported: https://cloud.google.com/spanner/docs/data-types
In particular,
STRING
(see https://github.com/shinichi-takii/ddlparse/pull/62),BYTES
(see https://github.com/shinichi-takii/ddlparse/pull/64) andARRAY
.ARRAY seems to be more difficult to add, see https://cloud.google.com/spanner/docs/data-types#array_type
I managed to solve the array issue by using
Optional(Regex(r"\<(.*?)\>"))("array_brackets")
within_CREATE_TABLE_STATEMENT
Additionally, Spanner DDLs can contain something like
STRING(MAX)
,MAX
needs to be supported in addition to numerical lengths.Todos: Add spanner to
DdlParse.DATABASE
options._CREATE_TABLE_STATEMENT
needs to be adapted for Spanner. For arrays, Spanner uses something likeARRAY<BOOL>
, but we also need to account for lengths indicated as string, for exampleBYTES(MAX)
)I've tested with this DDL: