Skip to content
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

Document wrapping insert with select #6936

Merged
merged 3 commits into from Mar 1, 2024
Merged

Conversation

raddevon
Copy link
Contributor

I thought we already had this documented — and I believe it is in the book — but it's a pretty fundamental concept and should also be documented here.

Copy link
Contributor

@scotttrinh scotttrinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added some details about this to the edgedb-js docs (see edgedb/edgedb-js#838). To that end, makes sense to add this to the update docs as well, yeah?

Maybe we also need to update select in a way that makes this pattern intuitive?


.. code-block:: edgeql-repl

db> select (insert Hero {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also offer an example of a with style, which I personally prefer as a better-looking formulation:

with
   NewHero := (insert)
select
   NewHero {
      id,
      name,
   }

@raddevon
Copy link
Contributor Author

@scotttrinh Good idea. Maybe we just cover delete too while we're in there and complete the set…

@raddevon
Copy link
Contributor Author

raddevon commented Mar 1, 2024

@scotttrinh Added this to the update docs as well. It looks a little different because that page is surprisingly different in structure from the select one, but I tried to match the structure of the update page while keeping the new information in basically the same shape it has on the select page. (Turned out, delete already mentions this.)

Would you take a peek at the new stuff and make sure it looks reasonable before I merge?

Copy link
Contributor

@scotttrinh scotttrinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes look good!

@raddevon raddevon merged commit aa30a72 into master Mar 1, 2024
24 checks passed
@raddevon raddevon deleted the doc-wrap-insert-with-select branch March 1, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants