mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-02 19:41:57 +00:00
chore(resolvemcp): drop unused helpers, silence rangeValCopy
This commit is contained in:
@@ -1013,8 +1013,8 @@ func (h *Handler) validatePreloads(model interface{}, preloads []common.PreloadO
|
|||||||
for _, name := range buildModelInfo("", "", model).relationNames {
|
for _, name := range buildModelInfo("", "", model).relationNames {
|
||||||
relations[strings.ToLower(name)] = true
|
relations[strings.ToLower(name)] = true
|
||||||
}
|
}
|
||||||
for _, p := range preloads {
|
for i := range preloads {
|
||||||
segments := strings.Split(p.Relation, ".")
|
segments := strings.Split(preloads[i].Relation, ".")
|
||||||
if len(segments) > h.config.MaxPreloadDepth {
|
if len(segments) > h.config.MaxPreloadDepth {
|
||||||
return NewClientError(CodeLimitExceeded, fmt.Sprintf("preload depth exceeds the maximum of %d", h.config.MaxPreloadDepth))
|
return NewClientError(CodeLimitExceeded, fmt.Sprintf("preload depth exceeds the maximum of %d", h.config.MaxPreloadDepth))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,26 +201,6 @@ func buildSchemaDoc(info modelInfo) string {
|
|||||||
return sb.String()
|
return sb.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// columnNameList returns a comma-separated list of JSON column names (for descriptions).
|
|
||||||
func columnNameList(cols []columnInfo) string {
|
|
||||||
names := make([]string, len(cols))
|
|
||||||
for i, c := range cols {
|
|
||||||
names[i] = c.jsonName
|
|
||||||
}
|
|
||||||
return strings.Join(names, ", ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// writableColumnNames returns JSON names for all non-primary-key columns.
|
|
||||||
func writableColumnNames(cols []columnInfo) []string {
|
|
||||||
var names []string
|
|
||||||
for _, c := range cols {
|
|
||||||
if !c.isPrimary {
|
|
||||||
names = append(names, c.jsonName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return names
|
|
||||||
}
|
|
||||||
|
|
||||||
// parseRequestOptions reads the paging, filter, sort, column and preload arguments shared
|
// parseRequestOptions reads the paging, filter, sort, column and preload arguments shared
|
||||||
// by the read tools.
|
// by the read tools.
|
||||||
func parseRequestOptions(args map[string]interface{}) common.RequestOptions {
|
func parseRequestOptions(args map[string]interface{}) common.RequestOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user