Skip to content

bug: --clean has no effect without --update-graph #436

@dj0nes

Description

@dj0nes

Problem

`--clean` is documented as wiping the database, but it silently does nothing unless `--update-graph` is also passed.

The implementation gates `clean_database()` inside `if update_graph:`:

```python
if update_graph:
...
with connect_memgraph(...) as ingestor:
if clean:
ingestor.clean_database()
```

So `cgr start --clean --repo-path /some/repo` connects to nothing and exits successfully, giving the user no indication that the database was not wiped.

Expected behaviour

Either:

  1. `--clean` works independently of `--update-graph` (wipe the database without re-indexing), or
  2. A clear error/warning is emitted when `--clean` is passed without `--update-graph`

Option 1 is more useful and allows separating the "wipe" step from the "index" step in scripts.

Workaround

Always combine the flags: `cgr start --clean --update-graph --repo-path ...`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions