Skip to content

Add is_extended_promotional column to components (from data source) - #399

Open
cyrillical00 wants to merge 1 commit into
tscircuit:mainfrom
cyrillical00:bounty-bot/bounty-github-tscircuit-jlcsearch-92-f5e9f8
Open

cyrillical00 wants to merge 1 commit into
tscircuit:mainfrom
cyrillical00:bounty-bot/bounty-github-tscircuit-jlcsearch-92-f5e9f8

Conversation

@cyrillical00

Copy link
Copy Markdown

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_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

Test commands

  • bun run scripts/setup-db-optimizations.ts
  • bun run generate:db-types
  • bun run format:check

Submitted via bounty-bot. Confidence: medium.

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
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