MCPcopy Create free account
hub / github.com/bytebase/bytebase / formatTblProperties

Function formatTblProperties

backend/plugin/db/databricks/dump.go:196–215  ·  view source on GitHub ↗
(tblAddInfo *tableAdditionalInfo)

Source from the content-addressed store, hash-verified

194}
195
196func formatTblProperties(tblAddInfo *tableAdditionalInfo) (string, error) {
197 if tblAddInfo == nil || tblAddInfo.tblProps == nil {
198 return "", errors.New("properties cannot be nil value")
199 }
200
201 builder := strings.Builder{}
202 idx := 0
203 for key, val := range tblAddInfo.tblProps {
204 comma := ","
205 if idx == len(tblAddInfo.tblProps)-1 {
206 comma = ""
207 }
208 if _, err := fmt.Fprintf(&builder, "%s = %s%s\n", key, val, comma); err != nil {
209 return "", err
210 }
211 idx++
212 }
213
214 return builder.String(), nil
215}

Callers 1

DumpMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected