How can I create an ERD by reverse engineering and exisitng DB

Hi Folks,
I want to create an ERD for our existing Singlestore DB. Can anyone recommend a tool that will help me do this? I tried Sql Workbench --> Database --> Reverse Engineer but it bombs when I try to select tables.
I understand there are no FK so I will have to highlight the joins myself but it would be a great help if I could at least extract the tables into a diagram.
Thanks,
Claire

Hi @claire.moore – welcome to the SingleStore forums. I don’t have a great answer for you. A roundabout way to do it would be to export your schema as CREATE TABLE statements using sdb-admin dump and work with that.

You could edit the file so it runs the CREATE TABLE statements successfully on MySQL, then import them from MySQL with Sql Workbench, then add the edges.

What error did you get with Sql Workbench, and what’s the full name and version of the product you were using? MySQL workbench might work better, perhaps. Our catalogs do have basic backward compatibility with MySQL.

1 Like

Hi,
Thank you for the reply !
I am using Mysql Workbench 6.3 Community edition.
I go to Database --> Reverse Engineer
It goes through steps of connecting and retrieving fine bringing back my tables and views.
When I deselect everything, select a couple of tables at random then use the right arrow to bring them across I get Workbench has encountered a problem, external component exception and please report bug.
I can log a bug but I am not sure if Mysql Workbench is supposed to offer this feature for Singlestore.

Hi @hanson

I’m getting the same kind of error messages— it could be because we’ve used GORM to create our tables and haven’t tuned them to take advantage of SS capabilities

ERROR: (3, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (3, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (21, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (21, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (37, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (37, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (73, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (73, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (108, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (108, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (141, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (141, 10) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (141, 14) Extraneous input “(” found, expecting ‘)’
ERROR: (141, 0) “)” is not valid at this position, expecting EOF, ‘;’
ERROR: (155, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (155, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (155, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (170, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (170, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (191, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (191, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (213, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (213, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (250, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (250, 10) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (250, 14) Extraneous input “(” found, expecting ‘)’
ERROR: (250, 0) “)” is not valid at this position, expecting EOF, ‘;’
ERROR: (273, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (273, 10) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (273, 14) Extraneous input “(” found, expecting ‘)’
ERROR: (273, 0) “)” is not valid at this position, expecting EOF, ‘;’
ERROR: (305, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (305, 10) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (305, 14) Extraneous input “(” found, expecting ‘)’
ERROR: (305, 0) “)” is not valid at this position, expecting EOF, ‘;’
ERROR: (342, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (342, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (342, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (382, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (382, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (401, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (401, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (401, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (422, 24) “CLUSTERED” is not valid at this position, expecting BTREE, HASH, RTREE
ERROR: (422, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (422, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (500, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (500, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (538, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (538, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (547, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (547, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (556, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (556, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (565, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (565, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (574, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (574, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (583, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (583, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (592, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (592, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (601, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (601, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (610, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (610, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (619, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (619, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (649, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (649, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (674, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (674, 12) __SHARDKEY is not valid at this position, expecting ‘)’
ERROR: (698, 8) “KEY” is not valid at this position, expecting BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOL, …
ERROR: (698, 12) __SHARDKEY is not valid at this position, expecting ‘)’

Hi @claire.moore

It looks like GORM is trying to parse the output of show create table and does not know our extensions so it is failing. I’d recommend not using GORM with SingleStoreDB until an official extension is developed for GORM to be able to work with SingleStoreDB.

2 Likes