Skip to content

feat: add is_extended_promotional column to components#142

Open
CharlesWong wants to merge 3 commits intotscircuit:mainfrom
CharlesWong:feat/add-is-extended-promotional
Open

feat: add is_extended_promotional column to components#142
CharlesWong wants to merge 3 commits intotscircuit:mainfrom
CharlesWong:feat/add-is-extended-promotional

Conversation

@CharlesWong
Copy link

Summary

Adds the is_extended_promotional boolean column to components from the JLCPCB data source, as requested in #92.

Changes

Database

  • New optimization script lib/db/optimizations/component-extended-promotional-column.ts that adds the column and populates it from the raw component data
  • Registered in scripts/setup-db-optimizations.ts

Schema

  • Updated lib/db/generated/kysely.ts with the new column type
  • Updated lib/db/derivedtables/component-base.ts to include is_extended_promotional in derived table creation

API

  • routes/api/search.tsx now returns is_extended_promotional in search results
  • Component list routes (capacitors, resistors, resistor_arrays) expose the field in table display

Tests

  • Updated tests/routes/api/search.test.ts to verify the field is present in API responses

Notes

  • The components/list route was NOT updated because it queries v_components (an external view). The column is available on the derived table.

Fixes #92

- Added is_extended_promotional boolean column via DB optimization script
- Updated component-base derivedtable to include the field
- Updated Kysely types to reflect the new column
- Exposed in search API and component list routes (capacitors, resistors, resistor_arrays)
- Added test coverage for search API returning the field

Fixes tscircuit#92
- Added is_extended_promotional boolean column to all component list routes
- Updated Kysely generated types to include the new column
- Updated cf-proxy DB types with is_extended_promotional field
- Column populated from JLCPCB data source (Boolean conversion)
- Updated DB optimization scripts to include the new column

Fixes tscircuit#92
@CharlesWong
Copy link
Author

Hi! Just checking in — any chance this could get a review? Happy to make any adjustments needed. Thanks!

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.

Add is_extended_promotional column to components (from data source)

1 participant