Skip to content

Commit

Permalink
Tostring and min go version
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Aug 19, 2024
1 parent cac5ddc commit 73da75e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tentone/hierarchyid

go 1.22.2
go 1.20

require (
gorm.io/driver/sqlserver v1.5.3
Expand Down
7 changes: 7 additions & 0 deletions hierarchyid.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ func GetRoot() HierarchyId {
return HierarchyId{Data: []int64{}}
}

// Create a new hierarchyid from a string.
func (j *HierarchyId) FromString(data string) error {
var err error
j.Data, err = FromString(data)
return err
}

// Check if a hierarchyid is a descendant of another hierarchyid
func (j *HierarchyId) IsDescendantOf(parent HierarchyId) bool {
return IsDescendantOf(j.Data, parent.Data)
Expand Down

0 comments on commit 73da75e

Please sign in to comment.