rel8 icon indicating copy to clipboard operation
rel8 copied to clipboard

TableSchema to CREATE TABLE?

Open isovector opened this issue 3 years ago • 4 comments

I'd like to pretend I don't have a database at all because I don't understand SQL, and am hoping rel8 can give me the SQL necessary to create the db/table it will talk to. Is this possible given a TableSchema?

isovector avatar Jul 01 '22 10:07 isovector

I think this should be possible (though it won't be able to set up things like primary key and foreign key stuff), but we could probably whip something together to get the basics.

ocharles avatar Jul 01 '22 11:07 ocharles

I'm happy to add my own keys!

isovector avatar Jul 01 '22 14:07 isovector

I tried to implement this today (in library code), but AFAICT there simply isn't enough exposed by rel8. At the least, we'd need something equivalent to Rel8.Table.Name.showNames exported.

isovector avatar Sep 02 '22 07:09 isovector

If you want to expose more, I think we'd be happy to accept a PR if it makes this work possible

ocharles avatar Sep 04 '22 14:09 ocharles