Day 1: Database "join" scenario was difficult until I found the trick! Plus other thoughts

My Day 1 feedback: Awesome alpha, team! :smiley:
But there is one basic Notion/Airtable use case that I struggled to find and enable… a simple DB/table join, or relational lookup. Take a simple scenario where I want to create a sports team list view showing Players and Teams. Because I use Notion and Airtable I’m accustomed to having two separate tables or databases, one with players and one with teams. Then I join them with a relational field that sets up the join/lookup function. This makes it easy for me to select named objects across the tables, and also lets me create new objects through that relation when I don’t find the one I want.

So… it took me a few hours in Anytype to figure out that I needed to create a “limited relation” for the type I wanted to join, and then I was able to get that same basic “join/lookup” functionality. I would recommend making that A LOT easier for users wanting to create database scenarios.
It seemed that Anytype wanted me to put all object attributes into Relations, which works up until a point (as with Tag relations), but that doesn’t give the clean lookup/select functionality Notion users will expect. And I knew Tags wouldn’t put those values in a type or object list that I could easily manage.

Suggestion #2:
Please create a way to apply a Template (with all relations/attributes) to pre-existing objects. For example, if I created a human and had a few relations/attributes attached to that human but then created a new relation that I wanted to apply to all my humans, I have no way to do that without going into each human object and adding or featuring the relation, right? There is no way to bulk modify all my humans, is there? I don’t even need to populate the new field, I just want it exposed when I view all human objects. Any ideas?

One possible bug/issue I can raise in the bug forum…
:unamused: I have some links (not relations) that I cannot delete or break… any idea why? They show up in both the Navigation and Graph Views. The relations are easy to edit/delete but not the plain hard links. Not sure how they even got there :interrobang: … and I’m not referring to the “Home” links which I believe are auto-generated bc they’re recent.

:heart: One thing I love in Anytype which isn’t featured well is the ability create a true graph database with bi-directional relationships. You might want to make it easier for people to set up the unique one-way relations, preferably with a drawing or connecting tool! That would be awesome.

5 Likes

Hi @daves, welcome to the forum!
First of all thanks for the feedback.
I’m not really sure what you mean with “relational lookup”, would you please explain that with some examples?

About your second point, I personally agree that it’s a needed feature, but luckily we’re not alone, there is this feature request that already has many likes, you can go and add one to make it even more visible to the dev team :wink:

For the bug, any link you create from page to page, by mentioning or explicit linking, will be shown in the graph, do you think you are seeing links where you shouldn’t?

For anything else, feel free to search for the forum or make a bug report/feature request, we always value good feedback!

1 Like

Thanks, @kerbless - here is a simple demo from a Notion perspective.

1 Like

Hello,

I was just browsing through the forum because I wanted to see if there is already any discussion about adding more advanced database queries to Anytype, which allows me to pull in more information from related objects when viewing sets. Maybe something like a Join operation in SQL. Or something like the Rollup-feature in Notion. (I have never used Notion, but the way the rollup is explained on their website sounds like a useful feature. Although even Notion’s rollups are still a bit limiting because you cannot do rollups of rollups. So you can navigate only one step from the current object.) Now I have stumbled over this thread and I am a bit confused. Does this mean that there is actually already more functionality available in Anytype, that I am just not aware of because it is poorly documented?

why is there a feature request for rollups, if this feature is already available?

How did you do this relational lookup? Is this “relational lookup” something like this “rollup” that notion explains on their website? Or have I misunderstood this?

I think I can clear things up a bit. What @daves wanted was something like this: “This makes it easy for me to select named objects across the tables, and also lets me create new objects through that relation when I don’t find the one I want.”

So if he had three types Book, Person, and Building, then he wanted a way to set up the Book type with an Author relation that could only be set to Persons and not Buildings.

This is possible in Anytype. It looks like this:

image

That’s what @daves calls a join, but which we call an Object relation (and which I personally, with my CS background, prefer to call an Object reference relation). But it’s not what database people call a join, which is about dynamically constructing a table of results rather than specifying the allowable values in a column. I believe what @daves calls a join a database person would call a foreign key.

As for rollups, which I understand to be a specific kind of computed value, Anytype doesn’t have those yet. They are hotly anticipated.

Thanks @MrsBasilEFrankweiler
I think that clarifies it for me. I also have a computer science background. Although computer science is a big field and I am not an expert in databases specifically. So I honestly do not know exactly what a Object reference relation is. But it does not matter. Because I think I do understand the concept of a foreign key. So what @daves reffered to was similar to a foreign key in SQL-kind-of terminology. But not a SQL-join-operation. (That is, anytype cannot compute the result table of an SQL-join query as shown here at 1:50 https://youtu.be/9yeOJ0ZMUYw?si=sMRxehb1sEwBJkEA&t=110 ) That is, I guess, where I misunderstood. I thought @daves meant an actual SQL-join operation.
Rollups to me looks like something similar to a SQL-join operation, where we can only join one column of the right table at a time. But we could do multiple rollups to join more columns I guess. (Although SQL would still be superior to notions Rollups because in SQL we could probably do JOIN queries with more than two tables.)
And Rollups are not available yet either in anytype. That is why the feature request is still open.