Closed brizzbuzz closed 12 months ago
Thanks for the report! Yeah this is an annonying problem. We have discussed and are planning for a proper name annotation support (no link for the new design yet, pls see https://github.com/edgedb/edgedb/pull/4325 for now). But this would need server changes (before we have language servers!), so please kindly expect a fix in EdgeDB 3.0.
Alternatively and theoretically, we could also add support for custom name annotations for codegen, design proposals are welcome!
(btw it's actually not a Pydantic model but a basic Python dataclass, it's just optimized and compatible when Pydantic is present)
We have discussed and are planning for a proper name annotation support
Now tracking: https://github.com/edgedb/edgedb/pull/5334
@fantix -- seems that you fixed it here https://github.com/edgedb/edgedb/pull/5334.
Close this issue out ?
Right, codegens are now preferring the server names.
Hey, it seems like you guys do an optimization where if a Pydantic model already exists with the same signature for a query, new queries will leverage the existing model. While this makes sense at a bits and bytes level, I think it is confusing from a user perspective. For example, say I have two queries
When I generate the code with
edgedb-py --file
, it results in the the followingI think it is not ideal to have the method
delete_author_by_id
have a return type ofCreateAuthorResult | None
Since this is generated code, I would much rather just have two duplicate models, one called
CreateAuthorResult
and the other calledDeleteAuthorResult