Skip to content

Conversation

@crutchcorn
Copy link
Member

@crutchcorn crutchcorn commented Nov 24, 2025

Closes #32

Needs a review to address code // TODOs, since it will impact how we handle the code from here out

Other TODOs

  • Add test

.values(result)
.onConflictDoUpdate({ target: [collectionData.slug, collectionData.locale], set: result });

// TODO: How to handle authors?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From @fennifith:

You can assume the author profile should already exist in the db (if they don't, the task should fail) - so it's just a matter of adding to the collection_authors table.

@crutchcorn crutchcorn changed the title [WIP] Sync collection Sync collection Dec 10, 2025
@crutchcorn crutchcorn marked this pull request as ready for review December 10, 2025 02:46
slug: text("slug").primaryKey(),
});

// TODO: This is missing a ton of fields that are in the Collections task type, what do?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what type you're referencing here? What fields are missing?

The collection_data table does not need to contain every value that's in the frontmatter IMO - it should all be available in the meta column regardless.

],
);

// TODO: Do we need this in the DB or can it just be in the meta JSON?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to support queries like "list posts by collection". These can't be added until the post is created, though - sync-post will need to additionally fetch the collection data to create this record.

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.

Task: Sync collection data

3 participants