MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / migrateTypeSenseSchema

Function migrateTypeSenseSchema

cmd/server.go:95–107  ·  view source on GitHub ↗

* migrateTypeSenseSchema ensures that the necessary TypeSense schema is migrated for all required collections. It takes a TypesenseClient and a context as parameters. This function loops through the predefined collections and migrates their schema in TypeSense. */

(ctx context.Context, t *search.TypesenseClient)

Source from the content-addressed store, hash-verified

93This function loops through the predefined collections and migrates their schema in TypeSense.
94*/
95func migrateTypeSenseSchema(ctx context.Context, t *search.TypesenseClient) error {
96 // Define the collections to migrate schema for
97 collections := []string{"ledgers", "balances", "transactions", "identities", "reconciliations"}
98
99 // Migrate schema for each collection
100 for _, c := range collections {
101 err := t.MigrateTypeSenseSchema(ctx, c)
102 if err != nil {
103 return err // Return if an error occurs during migration
104 }
105 }
106 return nil
107}
108
109func getOrCreateHeartbeatID() string {
110 db, err := sql.Open("sqlite3", "./heartbeat.db")

Callers 1

initializeTypeSenseFunction · 0.85

Calls 1

Tested by

no test coverage detected