package db import "axolotl/models" func (db *DB) GetRelNames(n *models.Node, r models.RelType) ([]string, error) { ids := n.Relations[string(r)] if len(ids) == 0 { return nil, nil } result := make([]string, 0, len(ids)) for _, id := range ids { var title string if err := db.QueryRow("SELECT title FROM nodes WHERE id = ?", id).Scan(&title); err != nil { return nil, err } result = append(result, title) } return result, nil }