feat(59): Add Notion database destination support#60
Merged
Conversation
Owner
Author
|
👋 Hi, Myastr0! Thanks for opening a PR. We will review it soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Notion Database Synchronization Support
Related to #59
Summary
This PR introduces support for synchronizing markdown files to Notion Databases in addition to Notion Pages. Users can now leverage Notion's powerful database features like filtering, sorting, and custom views for their synchronized content.
All Submissions:
New Feature Submissions:
Changes to Core Features:
What's New
🗄️ Notion Database Support
You can now sync markdown files directly to Notion databases, enabling:
📝 New Frontmatter Properties
idPropertyA unique identifier for your page, used for clean sync operations when targeting databases:
When clean sync is enabled with a database destination, MK Notes uses this
idto find and delete existing pages with matchingmk-notes-idproperty before creating new ones.propertiesArrayPopulate additional database properties directly from your markdown frontmatter:
🔄 Clean Sync Behavior
The
--cleanflag now behaves differently based on destination type:mk-notes-idbefore creating new onesTechnical Changes
Core Domain Changes
Element,PageElement,TextElement,CodeElement, etc.) with dedicated files for each element typePageElementenhancements: AddedmkNotesInternalIdandpropertiesfields to support database sync featuresDestinationRepositoryinterface updates:getPageIdFromPageUrl→getObjectIdFromObjectUrlparentPageId→parentObjectIdwith newparentObjectTypeparametergetObjectType()to detect if destination is a page or databasegetObjectIdInDatabaseByMkNotesInternalId()for clean sync lookupsgetDataSourceIdFromDatabaseId()for database operationsdeleteObjectById()for removing database entriesInfrastructure Changes
mk-notes-idproperty lookup for clean syncidandpropertiesfrom frontmatterDependencies
@notionhq/clientfrom5.1.0to5.4.0to access the latest Notion API features (data sources API)Documentation Updates
idfrontmatter propertyTesting
idandpropertiesBreaking Changes
None - existing page synchronization continues to work as before. Database sync is an additive feature.
Related Issue
Closes #59