circuithub / rel8

Hey! Hey! Can u rel8?
https://rel8.readthedocs.io
Other
154 stars 39 forks source link

TableSchema to CREATE TABLE? #186

Open isovector opened 2 years ago

isovector commented 2 years ago

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?

ocharles commented 2 years ago

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.

isovector commented 2 years ago

I'm happy to add my own keys!

isovector commented 2 years ago

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.

ocharles commented 2 years ago

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