tree: 565a70c83432e824c48dc113e3cc0ea35b675dea [path history] [tgz]
  1. INTERNALS.md
  2. README.md
  3. db.go
  4. db_eval.go
  5. db_query.go
  6. db_test.go
  7. funcs.go
  8. inmem.go
  9. integration_test.go
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
  • more aggregation functions
  • INSERT/UPDATE DML statements
  • SELECT HAVING
  • case insensitivity
  • FULL JOIN
  • alternate literal types (esp. strings)
  • STRUCT types
  • transaction simulation
  • expression type casting, coercion
  • subselects
  • FOREIGN KEY and CHECK constraints
  • set operations (UNION, INTERSECT, EXCEPT)
  • partition support
  • conditional expressions
  • table sampling (implementation)