cloudspannerecosystem / spanner-dump

Command line tool for exporting a Cloud Spanner database in text format
Apache License 2.0
39 stars 13 forks source link

Skip dumping generated columns #18

Closed r3nic1e closed 1 year ago

r3nic1e commented 1 year ago

Generated columns cannot be inserted or updated so there is no reason to dump them. So DML should not contain fields for these columns

https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#create_table

Direct writes to generated columns are not allowed.

CREATE TABLE (
  Name STRING(256) NOT NULL,
  NameLow STRING(256) AS (LOWER(Name)) STORED,
  ...
);

ERROR: spanner: code = "InvalidArgument", desc = "Cannot INSERT value on non-writable column: NameLow