0.1.0 • Published 2 years ago

spanner-ddl-patch v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Spanner DDL patch file generator

Build Status License Version

A tool to generate ddl base on source ddl and destination ddl. It can calculate difference and generate ddl.

Usage

Prepare a src.sql

CREATE TABLE users (
    user_id STRING(32),
    name STRING(MAX),
    age INT64,
    sex STRING(8)
) PRIMARY KEY (user_id);

Prepare a dst.sql

CREATE TABLE users (
    user_id STRING(32),
    name STRING(1024),
    sex STRING(8),
    avatar STRING(MAX)
) PRIMARY KEY (user_id);

Then install and run the tool

yarn global add spanner-ddl-patch
spanner-ddl-patch --src ./src.sql --dst ./dst.sql

Output:

alter table users add column avatar string(max);
alter table users alter column name string(1024);
alter table users drop column age;

Known issues

  • Do not support to patch the options
0.1.0

2 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago