Skip to content

Document ltree support in EFCore.PG - #76

Merged
roji merged 1 commit into
mainfrom
ltree
Jan 31, 2021
Merged

roji merged 1 commit into
mainfrom
ltree

Conversation

@roji

@roji roji commented Jan 31, 2021

Copy link
Copy Markdown
Member

@roji
roji merged commit aae88c7 into main Jan 31, 2021
@roji
roji deleted the ltree branch January 31, 2021 15:57
github-actions Bot pushed a commit that referenced this pull request Jan 31, 2021
@leonkosak

Copy link
Copy Markdown

@roji, so when .NET 6.0 (and EF Core 6.0) are released, querying hierarchy data via linq will be lik for SQL Server?
https://www.meziantou.net/using-hierarchyid-with-entity-framework-core.htm

@roji

roji commented Mar 16, 2021

Copy link
Copy Markdown
Member Author

@leonkosak no, ltree doesn't work exactly the same way as SQL Server's hierarchy ID - it's a different feature in a different database, even if it addresses some of the same needs. I'd recommend taking a look at the ltree documentation to see what it looks like - the EFCore.PG provider pretty much exposes what you see there.

On a side note, you should be able to test the ltree support right now, by using 6.0.0-preview2.

@ronnyek

ronnyek commented May 19, 2022

Copy link
Copy Markdown

Should this documentation include an example of this? I'm struggling to find a reference to what my entity itself should look like and how I'd simply set a path within a ltree column, let alone use the new functions to query them. Is this literally just mapping my object with a LTree type (instead of string etc) and then setting value with SomeRoot.SubNode.SubNode string?

I'd be more than happy to submit a PR to include something like that in the documentation so the initial dive doesn't feel as much of a mystery to the next guy

@roji

roji commented May 23, 2022

Copy link
Copy Markdown
Member Author

@ronnyek we have the following sentence in the LTree translations section of the docs:

Use the LTree type to represent ltree and invoke methods on it in EF Core LINQ queries.

We generally don't go into documenting how the PG feature works - that's the responsibility of the PG documentation (linked to from the above), and the above seems sufficient to me - can you explain what exactly you're having trouble with?

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.

5 participants