apstndb / gsqlsep

A Go implementation of Google SQL dialect statement separator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gsqlsep

A Go implementation of Google SQL(a.k.a. ZetaSQL) statement separator. Google SQL is the SQL dialect of Cloud Spanner, BigQuery, Apache Beam SQL ZetaSQL dialect, etc.

This is experimental and provided without warranty of any kind.

Features

  • Separate statements without syntax parsing.
  • Strip comments to support Cloud Spanner Admin API, which doesn't support comments in DDL.
    • (Experimental) Can preserve comments using SeparateInputPreserveComments, SeparateInputStringPreserveComments.
  • (Experimental) Alternative termination characters are customizable.
    • It is possible to support spanner-cli style command terminators \G.
      • Example: SELECT 1\G

Acknowledgements

The implementation of this package is almost a fork of spanner-cli which is derived from spansql.

References

Backgrounds

Statement separators tend to be reinvented because there are no reusable implementations.

Language Specifications

About

A Go implementation of Google SQL dialect statement separator

License:Apache License 2.0


Languages

Language:Go 100.0%