spantype

command
v0.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 10 Imported by: 0

README

$ ./spantype --help
Usage of spantype:
  -mode string
        format mode (simplest|simple|normal|verbose|more) (default "verbose")
  -type-annotation string
        how to render TypeAnnotation: suffix|omit|primary (default "suffix")

$ gcloud spanner databases execute-sql ${SPANNER_DATABASE} \
    --format="json" --query-mode=PLAN \
    --sql 'SELECT 1 AS n, ARRAY(SELECT AS STRUCT 1 AS n, ARRAY(SELECT AS STRUCT 1 AS n) AS `inner`) AS `outer`' \
    | jq .metadata.rowType | ./spantype 
n INT64, outer ARRAY<STRUCT<n INT64, inner ARRAY<STRUCT<n INT64>>>>

# with --mode
$ gcloud spanner databases execute-sql ${SPANNER_DATABASE} \
    --format="json" --query-mode=PLAN \
    --sql 'SELECT 1 AS n, ARRAY(SELECT AS STRUCT 1 AS n, ARRAY(SELECT AS STRUCT 1 AS n) AS `inner`) AS `outer`' \
    | jq .metadata.rowType | ./spantype --mode=simplest
INT64, ARRAY

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL