Add is_extended_promotional column to components (from data source) - #399
Open
cyrillical00 wants to merge 1 commit into
Open
cyrillical00 wants to merge 1 commit into
cyrillical00 wants to merge 1 commit into
Conversation
Summary: Add is_extended_promotional column to components table via a new DB optimization that reads extended_type from the extra JSON field Reasoning: The issue asks for an `is_extended_promotional` column on the components table so extended promotional parts (which act as basic for a limited time) can be filtered. Following the existing pattern in `lib/db/optimizations/`, a new `extendedPromotionalColumn` optimization is created that adds an INTEGER column and populates it by reading the `extended_type` field from the `extra` JSON blob stored per component (which is how jlcparts encodes this data). An index is added for fast filtering. The optimization is registered in `scripts/setup-db-optimizations.ts` alongside the existing optimizations so it runs during `bun run setup:optimize-db`. Top blockers: scripts/setup-db-optimizations.ts was not shown so the exact import/array structure is inferred from the README and optimization file patterns; the search strings may not match exactly Drafted by bounty-bot for tscircuit#92
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.
Closes the bounty.
Summary
Summary: Add is_extended_promotional column to components table via a new DB optimization that reads extended_type from the extra JSON field
Reasoning: The issue asks for an
is_extended_promotionalcolumn on the components table so extended promotional parts (which act as basic for a limited time) can be filtered. Following the existing pattern inlib/db/optimizations/, a newextendedPromotionalColumnoptimization is created that adds an INTEGER column and populates it by reading theextended_typefield from theextraJSON blob stored per component (which is how jlcparts encodes this data). An index is added for fast filtering. The optimization is registered inscripts/setup-db-optimizations.tsalongside the existing optimizations so it runs duringbun run setup:optimize-db.Top blockers: scripts/setup-db-optimizations.ts was not shown so the exact import/array structure is inferred from the README and optimization file patterns; the search strings may not match exactly
Test commands
bun run scripts/setup-db-optimizations.tsbun run generate:db-typesbun run format:checkSubmitted via bounty-bot. Confidence: medium.