25 lines
496 B
Go
25 lines
496 B
Go
package neo4jAPI
|
|
|
|
import (
|
|
"context"
|
|
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
|
|
)
|
|
|
|
func CreateTagNode(ctx context.Context, driver neo4j.DriverWithContext, name string, tagType string) error {
|
|
query := `
|
|
MERGE (u:e621Tag {e621Tag: $name, e621TagType: $tagType})
|
|
RETURN u
|
|
`
|
|
params := map[string]interface{}{
|
|
"name": name,
|
|
"tagType": tagType,
|
|
}
|
|
|
|
_, err := neo4j.ExecuteQuery(ctx, driver, query, params, neo4j.EagerResultTransformer)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|