MCPcopy Index your code
hub / github.com/cameri/nostream / runDevDbClean

Function runDevDbClean

src/cli/commands/dev.ts:53–68  ·  view source on GitHub ↗
(rawArgs: string[], options: DevOptions = {})

Source from the content-addressed store, hash-verified

51}
52
53export const runDevDbClean = async (rawArgs: string[], options: DevOptions = {}): Promise<number> => {
54 if (rawArgs.length === 0) {
55 const confirmed = await ensureConfirmed('Delete all events from the database?', options.yes)
56 if (!confirmed) {
57 return 1
58 }
59
60 return runWithSpinner('Cleaning database...', 'Database clean completed', 'Database clean failed', () =>
61 runCleanDb(['--all', '--force']),
62 )
63 }
64
65 return runWithSpinner('Cleaning database...', 'Database clean completed', 'Database clean failed', () =>
66 runCleanDb(rawArgs),
67 )
68}
69
70export const runDevDbReset = async (options: DevOptions): Promise<number> => {
71 const confirmed = await ensureConfirmed('Reset database and rerun migrations?', options.yes)

Callers 2

index.tsFile · 0.90
runDevMenuFunction · 0.90

Calls 3

runCleanDbFunction · 0.90
ensureConfirmedFunction · 0.85
runWithSpinnerFunction · 0.85

Tested by

no test coverage detected