-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.
Description
Client
Spanner
Go Environment
go version go1.20.4 darwin/arm64
Code
schema.sql file
CREATE VIEW ListDeployments
SQL SECURITY INVOKER AS
SELECT
user_id,
ARRAY_AGG(STRUCT<first_name STRING, last_name STRING>(first_name, last_name)) AS user_details
FROM Users;
func main() {
filename := "schema.sql"
bs, err := os.ReadFile(filename)
if err != nil {
log.Println("error reading schema file: %w", err)
}
ddl, err := spansql.ParseDDL(filename, string(bs))
if err != nil {
log.Printf("error parsing schema file: %v\n", err)
}
if ddl != nil {
log.Println(ddl.List)
}
}
Expected behavior
Should be able to parse the DDL
Actual behavior
2024/03/20 17:41:27 error parsing schema file: schema.sql:5: unexpected token "STRING"
Additional context
spanner client lib version: cloud.google.com/go/spanner v1.59.0
If I create the view with Spanner Studio no issue
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.