tree: 711a43dca1120538d5d809cda40370a22a0b3c68 [path history] [tgz]
  1. db.go
  2. db_eval.go
  3. db_query.go
  4. db_test.go
  5. funcs.go
  6. inmem.go
  7. integration_test.go
  8. INTERNALS.md
  9. README.md
spanner/spannertest/README.md

This directory contains spannertest, an in-memory fake Cloud Spanner. A sibling directory, spansql, contains types and parser for the Cloud Spanner SQL dialect.

spansql is reusable for anything that interacts with Cloud Spanner on a syntactic basis, such as tools for handling Spanner schema (DDL).

spannertest builds on spansql for testing code that uses Cloud Spanner client libraries.

Neither of these packages aims to be performant nor exact replicas of the production Cloud Spanner. They are reasonable for building tools, or writing unit or integration tests. Full-scale performance testing or serious workloads should use the production Cloud Spanner instead.

See INTERNALS.md for an explanation of the implementation.

Here's a list of features that are missing or incomplete. It is roughly ordered by ascending esotericism:

  • expression functions
  • NUMERIC
  • more aggregation functions
  • SELECT HAVING
  • more literal types
  • generated columns
  • expression type casting, coercion
  • multiple joins
  • subselects
  • case insensitivity of table and column names and query aliases
  • transaction simulation
  • FOREIGN KEY and CHECK constraints
  • INSERT DML statements
  • set operations (UNION, INTERSECT, EXCEPT)
  • STRUCT types
  • partition support
  • conditional expressions
  • table sampling (implementation)