feat: Add bulk insert with ON CONFLICT handling for relations · basicmachines-co/basic-memory@0818bda · GitHub
Skip to content

Commit 0818bda

Browse files
phernandezclaude
andcommitted
feat: Add bulk insert with ON CONFLICT handling for relations
Add add_all_ignore_duplicates() method to RelationRepository for bulk inserting relations with ON CONFLICT DO NOTHING. This handles cases where the same [[wiki link]] appears multiple times in a document, silently ignoring duplicates based on the (from_id, to_name, relation_type) unique constraint. Works with both SQLite and PostgreSQL dialects. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 6f99d2e commit 0818bda

2 files changed

Lines changed: 206 additions & 0 deletions

File tree

src/basic_memory/repository/relation_repository.py

Lines changed: 53 additions & 0 deletions

tests/repository/test_relation_repository.py

Lines changed: 153 additions & 0 deletions

0 commit comments

Comments
 (0)