Skip to content

Repository files navigation

spanpg

Go Reference

Experimental, optional layer for PostgreSQL dialect ergonomics around Cloud Spanner — built on top of:

The module API is unstable until declared otherwise.

API (experimental)

  • FormatPostgreSQLType — render a google.spanner.v1.Type using PostgreSQL-dialect spellings (including STRUCT<…> and json / jsonb by annotation).
  • StatementParamKey / PostgreSQLPlaceholder — pair $n placeholders with spanner.Statement.Params keys (p1, p2, …), matching the client convention (see integration/pgtypeannotation).
  • PostgreSQLLiteralFormatConfig / FormatColumnPostgreSQLLiteral / FormatRowPostgreSQLLiteral — format GenericColumnValue / *spanner.Row values as PostgreSQL literal SQL and reject Spanner types the PostgreSQL interface does not support.
  • FormatColumnSimple — delegates to spanvalue.SimpleFormatConfig for readable column text.

Status

go.mod pins github.com/apstndb/spanvalue v0.2.1 and github.com/apstndb/spantype v0.3.11. The API remains unstable until declared otherwise.

Integration tests

The nested module integration/pgtypeannotation runs PostgreSQL-dialect Spanner client probes (emulator or real instance). It is not part of root go test ./...; use make test-integration (see Makefile and .github/workflows/go.yml).

Development

go test ./...
go vet ./...

License

MIT — see LICENSE.

About

Experimental PostgreSQL-oriented helpers for Cloud Spanner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages