-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create model from existing table #108
Comments
The only difficulty with this is that the mechanism to determine the structure of a table varies wildly between database engines, so there will be a lot of code. It might be worth starting with some abstract representation for a model that can generate the code. I made one for Informix years ago and it was a pain. |
I think we should create a AST for creating models, and each Driver could read its database and create the AST... than we would have only one code generating the model... Sent with GitHawk |
Sounds like a plan. |
Would it be a cli tool? Sent with GitHawk |
It's also possible to read the metadata from information_schema tables. Except that SQLite doesn't have information_schema. |
@federico-razzoli @jonathanstowe I'm starting implementing it with this commit 67eca7e it seems to be working good (still far from complete). |
It does! It's called sqlite_master! https://github.com/FCO/Red/blob/master/lib/Red/Driver/SQLite/SQLiteMaster.pm6 |
I guess that they've done that for the convenience of making a DB dump, but it's not very convenient for doing anything else with it. |
Red should be able to create a model from an existing table.
Motivations:
The text was updated successfully, but these errors were encountered: