Skip to content

[Cloud Spanner] Table relations are not visualized in generated ERD by @liam-hq/cli (>= 0.5.9). #2411

@KaoruMuta

Description

@KaoruMuta

Self Checks

Version Type

CLI Version (npm package)

Version (only for Self Hosted)

>= 0.5.9

Steps to reproduce

  1. Set up project with Cloud Spanner (emulator is fine)
  2. Run k1low/tbls to output schema.json which has schema information with relationships between tables.
    a. example command: SPANNER_EMULATOR_HOST=localhost:9010 tbls doc
  3. Run latest liam-hq/cli
    a. example command: npx @liam-hq/cli erd build --input schema.json --format tbls

Expected Behavior

Table relations are visualized.
As of liam-hq/[email protected], it works like the attached screenshot in my playground.

Image

Actual Behavior

Table relations are not visualized like the attached screenshot in my playground.

Image

Additional Context

As far as I investigated, #2156 (released as 0.5.9) tried to introduce the new mechanism to visualize relationship without schema.relationships by using foreign key relations.
But, Cloud Spanner mostly uses interleave to create parent and children relationships instead of foreign keys. (ref)

Therefore, I think table relations are not visualized for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions