Skip to content

feat: add preserve duplicate paths option#9

Merged
andinux merged 1 commit into
mainfrom
feat/preserve-duplicate-paths-option
Jun 4, 2026
Merged

feat: add preserve duplicate paths option#9
andinux merged 1 commit into
mainfrom
feat/preserve-duplicate-paths-option

Conversation

@andinux
Copy link
Copy Markdown
Contributor

@andinux andinux commented Jun 4, 2026

Summary

  • add the preserve_duplicate_paths option for virtual-file/editor workflows
  • scope storage hashes by path when the option is enabled so identical or empty content can keep distinct dbmem_content rows
  • fix empty memory_add_content() and memory_add_file() handling so zero-length entries store without chunks
  • document the option and bump the extension version to 1.3.2

Configuration

SELECT memory_set_option('preserve_duplicate_paths', 1);

Tests

  • make test TEST_DEFINES='-DSQLITE_CORE -DTEST_SQLITE_EXTENSION'
  • make clean && make test

Add the preserve_duplicate_paths option for virtual-file/editor workflows that need distinct logical paths even when content is identical or empty.

When enabled with SELECT memory_set_option('preserve_duplicate_paths', 1), storage hashes are scoped by path so dbmem_content can keep separate rows while the embedding cache still reuses chunk embeddings by text.

Fix empty content handling so memory_add_content() and memory_add_file() can store zero-length entries without producing chunks, and keep default deduplication behavior unchanged when the option is 0.

Document the option, bump the extension version to 1.3.2, and cover default dedupe, duplicate preservation, and empty file/content behavior with unit tests.
@andinux andinux merged commit dd50ee5 into main Jun 4, 2026
79 of 80 checks passed
@andinux andinux deleted the feat/preserve-duplicate-paths-option branch June 4, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant