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

Function run

pkg/cli/database/schema/main.go:49–61  ·  view source on GitHub ↗
(tmpDir, outputPath string)

Source from the content-addressed store, hash-verified

47}
48
49func run(tmpDir, outputPath string) error {
50 schema, err := generateSchema(tmpDir)
51 if err != nil {
52 return err
53 }
54
55 if err := os.WriteFile(outputPath, []byte(schema), 0644); err != nil {
56 return fmt.Errorf("writing schema file: %w", err)
57 }
58
59 fmt.Printf("Schema generated successfully at %s\n", outputPath)
60 return nil
61}
62
63// generateSchema creates a fresh database, runs all migrations, and extracts the schema
64func generateSchema(tmpDir string) (string, error) {

Callers 2

TestRunFunction · 0.85
mainFunction · 0.85

Calls 1

generateSchemaFunction · 0.85

Tested by 1

TestRunFunction · 0.68