|
|
|
|
|
by 7thaccount
886 days ago
|
|
I can't really understand this without seeing the equivalent SQL as I don't understand datalog. Is this SQL query similar to the first datalog query you listed? I apologize for how HN formatted the below and my lack of understanding for how to get around it. Select u.name, u.email, u.id
From Users u
Join Cookies c on u.name = c.name |
|
Most people wouldn't design their schema in a SQL database like this with a bunch of special-use relations/views, but datalog encourages you to do so since defining a new relation is the only means of abstraction. In effect, you've created an API endpoint similar to /api/auth/users and, what's more, you can use the LoggedInUserView in other rules to define new relations.