question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for splats in shapes

See original GitHub issue

Is there a way to get all the attributes of an object, maybe on the first level.

these statements do not work, (not explained in the documentation).

SELECT User {};
SELECT User {*};

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
1st1commented, May 17, 2018

We’re now considering adding support for splats in shapes:

SELECT User { ...User };

  # or

SELECT User { ...UserFragmentView };

  # or

SELECT User {
  name,
  ...UserFragment1,
  ...UserFragment2
}

Using ... makes more sense than * since it’s more readable to a non-Python programmer and is similar to the corresponding GraphQL syntax.

3reactions
MarcusCemescommented, Apr 24, 2022

That sounds like a really good idea @haikyuu . I imagine introducing something like into the query builder would have lower development cost and lower misstep cost than introducing it into the core EdgeQL syntax. Good way to test out the concept.

Just a suggestion from a new user, I was looking for a way to quickly inspect objects inside of the egdedb interactive REPL and found my way to this issue.

I find it useful during development to be able to poke around the database and play with objects, modify them, delete them, before the application is completely working. People who have tried Elixir and iex will understand how amazing solid introspection can be. At the moment it’s a lot of typing to select properties, even if autocomplete is outstanding.

edgedb> select User filter .username = "Alice";
{default::User {id: d5ceabf2-c252-11ec-8820-9bb3eb36643f}}

This is not very useful when the cardinality is one, especially if a User has a lot of table properties to keep them localised in memory/on disk.

It would be a lot more ergonomic to either have a wildcard operator or just be a lot more verbose in the REPL, possibly run a count on links, …

edgedb> select User filter .username = "Alice";
{default::User {
    id: d5ceabf2-c252-11ec-8820-9bb3eb36643f,
    username: 'Alice',
    sessions: <12 default::Session>
}}

I also understand the wish to keep EdgeQL as “unpolluted” as possible, perhaps this could be an extension of the REPL, or a GUI browser such as Prisma Studio (even if I find REPL more ergonomic)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Splat ® - Design a playground - YouTube
Splats can be purchased via our website or US Amazon. Please see the links below.Freebies - https://splat3d.com/resources/What is a Splat ?
Read more >
Splat Shape - Etsy
Check out our splat shape selection for the very best in unique or custom, handmade pieces from our shops.
Read more >
6 Point Stretch Shape (Splat) Stretchy Screens
Our premium 6-point stretch shapes can be used to project images and scenic elements using front or rear projection. They're also excellent for...
Read more >
Create an Ink Splat Composite Effect - An Awesome Guide
Watch this episode of Final Cut Pro Help Live for steps to create an ink splat effect.
Read more >
TickiT-72397 Splats - Set of 10 - Color Mixing and Matching ...
Unique shape for color mixing. The extended arms on these splat shapes are perfect for overlapping on each other to create new colors....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found