Replies: 5 comments 7 replies
-
Hi Tiago, |
Beta Was this translation helpful? Give feedback.
-
Thank you @rolandf it will be truly appreciated. This will be merged with your collaboration 🙂 |
Beta Was this translation helpful? Give feedback.
-
Good to know @rolandf ! Great stuff! And about the rest? How do you feel? |
Beta Was this translation helpful? Give feedback.
-
@tarsil I received this error when running inspectDB pydantic_core._pydantic_core.ValidationError: 1 validation error for Index |
Beta Was this translation helpful? Give feedback.
-
@draew6 that that is the limit of the index name that is recommended but if you think we should increase that limit, by all means open a PR https://github.com/tarsil/edgy/blob/main/edgy/core/db/datastructures.py And let's make that change and I would be more than happy to accept that. The same for the unique constraint we also have in that file |
Beta Was this translation helpful? Give feedback.
-
@rolandf Im opening the conversation here as we can discuss it. So, I've developed the inspect dB feature that is not yet merged and I'm running tests but you could also give it a try if you don't mind.
If you could branch of "feature/inspect_db" that would be great.
How to run it, it is similar to what you did. For example:
edgy inspectdb --database "sqlite:///db.sqlite" > models.py
This should trigger the process and save the results inside a models.py. I've tested for different DBs and SQLite is actually one I haven't fully.
It is important to understand, like Django, this generates based on existing information from the database and differently from Django, edgy generates a ReflectModel which is basically the same as a normal model but does not manage migrations.
https://edgy.tarsild.io/reflection/
If this goes well, which I strongly believe it will, we can even extend this to also generate ReflectModel for existing views 🙂 but that can come later.
ReflectModels have the same permissions of read, write, delete, update as a normal model would with again, no DB migrations being managed.
Can you give it a try? There is room for improvements here and it we can collaborate until it gets to the way we want before merging and releasing it.
Beta Was this translation helpful? Give feedback.
All reactions