Thanks to visit codestin.com
Credit goes to github.com

Skip to content

naoina/spandoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spandoc

Spandoc is a tool to generate documentations from DDL of Cloud Spanner.

Installation

go get -u github.com/naoina/spandoc/cmd/spandoc

Usage

Write DDL of Cloud Spanner to a file (in this example, use schema.sql).

/* This is User table. */
CREATE TABLE User (
  ID STRING(MAX) NOT NULL,      -- This is PK
  Age INT64,                    -- Age of a user
  CreatedAt TIMESTAMP NOT NULL, -- Created time
  -- Updated time
  UpdatedAt TIMESTAMP NOT NULL OPTIONS (
    allow_commit_timestamp = true
  ),
) PRIMARY KEY(ID);

Then run command below.

spandoc schema.sql

Output:

# User
This is User table.

COLUMN | TYPE | NOT NULL | PRIMARY | OPTIONS | DESCRIPTION
------ | ---- | ---------| ------- | ------- | -----------
ID | STRING(MAX) | true | true |  | This is PK
Age | INT64 |  |  |  | Age of a user
CreatedAt | TIMESTAMP | true |  |  | Created time
UpdatedAt | TIMESTAMP | true |  | ALLOW_COMMIT_TIMESTAMP | Updated time

LICENSE

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published