edgedb-ui icon indicating copy to clipboard operation
edgedb-ui copied to clipboard

Feature request: UI schema builder

Open raddevon opened this issue 2 years ago • 2 comments

Similar to the upcoming query builder. This would make it easier for new users to build their schema. Users could select property types or link types via a dropdown menu for the property in question. We could expose other attributes like constraints and default values as well.

Here's a very rough wireframe of what a UI schema builder might look like: CleanShot 2023-02-08 at 13 48 01@2x

Ideally, we would write changes made here out to the user's ESDL files and maybe even generate and run the migration for them. If we wanted to build something short of that, we could just spit out ESDL the user could then copy to their schema.

raddevon avatar Feb 08 '23 21:02 raddevon

Great idea. I'd rather have the workflow integrated in the current graph. image

The user can then see the changes in the current migration highlighted with a red line in the text schema pane. Similar to git diff/ github PR, the user can see the changes, undo some and finally migrate in place.

haikyuu avatar Feb 09 '23 06:02 haikyuu

Just saw this and have an additional feature suggestion that talked about on Discord that would be 'out of this world'

It would be really out of this world if the UI could generate correct client code ( not the single query generated code from .ts in /queries by the generator ( i use the typescript one ) For example there could be a "client query builder" option that would allow to select the action:

  • select
  • insert
  • update
  • delete

Then it would create correct client code to do insert/update/etc the selected columns with a value or just show a placeholder but a working query none the less. It could also use a ...fields placeholder based on a ZOD schema that would be auto generated. But for starters it could be simple and just a minimal typescript/go/client example of how the 'in ui build query' would look like in typescript.

One could then easily copy the query code into the IDE for further modification.

.insert(e.Note, { ...fields, user: e.select(e.User, (user) => ({ filter_single: e.op(user.id, "=", e.uuid(userId)), })), })

Additional idea:

There could be a checkbox "Crud actions" which if selected would show all the correct client code based on the selected criteria to Create, Read(get),Update, Destroy for the selected criteria.

One would then have a 2000% DX speedup because one could easily copy those methods into the project.

Jarrodsz avatar Feb 15 '23 02:02 Jarrodsz