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

Method DropAllCollections

internal/search/reindex.go:408–425  ·  view source on GitHub ↗

DropAllCollections drops all known collections from Typesense.

(ctx context.Context)

Source from the content-addressed store, hash-verified

406
407// DropAllCollections drops all known collections from Typesense.
408func (t *TypesenseClient) DropAllCollections(ctx context.Context) error {
409 collections := []string{
410 CollectionLedgers,
411 CollectionIdentities,
412 CollectionBalances,
413 CollectionTransactions,
414 CollectionReconciliations,
415 }
416
417 for _, c := range collections {
418 logrus.WithField("collection", c).Debug("Dropping collection")
419 if err := t.DropCollection(ctx, c); err != nil {
420 return err
421 }
422 }
423
424 return nil
425}
426
427func dbHasData(ctx context.Context, ds database.IDataSource) bool {
428 ledgers, err := ds.GetAllLedgers(2, 0)

Callers 1

dropCollectionsMethod · 0.80

Calls 2

DropCollectionMethod · 0.95
DebugMethod · 0.45

Tested by

no test coverage detected