MCPcopy Index your code
hub / github.com/dnote/dnote / readSchema

Function readSchema

pkg/cli/migrate/legacy.go:226–242  ·  view source on GitHub ↗
(ctx context.DnoteCtx)

Source from the content-addressed store, hash-verified

224}
225
226func readSchema(ctx context.DnoteCtx) (schema, error) {
227 var ret schema
228
229 path := getSchemaPath(ctx)
230
231 b, err := os.ReadFile(path)
232 if err != nil {
233 return ret, errors.Wrap(err, "Failed to read schema file")
234 }
235
236 err = yaml.Unmarshal(b, &ret)
237 if err != nil {
238 return ret, errors.Wrap(err, "Failed to unmarshal the schema JSON")
239 }
240
241 return ret, nil
242}
243
244func writeSchema(ctx context.DnoteCtx, s schema) error {
245 path := getSchemaPath(ctx)

Callers 2

getUnrunMigrationsFunction · 0.85
updateSchemaVersionFunction · 0.85

Calls 1

getSchemaPathFunction · 0.85

Tested by

no test coverage detected