Skip to content

Conversation

cloutiertyler
Copy link
Contributor

@cloutiertyler cloutiertyler commented Aug 28, 2025

Description of Changes

This is a purely additive change to introduce, TypeBuilders, ColumnBuilders, and a t factory export that has methods for creating TypeBuilders.

There are derived types from TypeBuilders for each variant of AlgebraicType. TypeBuilders can be converted into a ColumnBuilder which supports creating additional metadata specifying whether a column is a primary key or should be unique. ColumnBuilders are not allowed within TypeBuilders, but the opposite is allowed (for composite types).

ColumnBuilders can only be used at the top level and contain a TypeBuilder.

TypeBuilder stores three pieces of information:

  1. A phantom typescript type that the SATS type should be interpreted as in TS
  2. A phantom typescript type which is the type of the SATS type
  3. A runtime AlgebraicType which stores the information to be reported to host.

ColumnBuilder stores three pieces of information:

  1. A TypeBuilder
  2. A phantom typescript type with the column metadata
  3. A runtime ColumnMetadata which stores the information to be reported to the host.

API and ABI breaking changes

None

Expected complexity level and risk

2

Testing

NOTE: Testing is not yet working because of vitest issues. The fix may require changing codegen.

@cloutiertyler cloutiertyler changed the base branch from master to tyler/unify-ts-projects August 28, 2025 16:25
@cloutiertyler cloutiertyler requested review from jsdt, gefjon and coolreader18 and removed request for jsdt August 28, 2025 16:33
@cloutiertyler cloutiertyler force-pushed the tyler/unify-ts-projects branch from a6d938e to 79c7589 Compare September 2, 2025 14:58
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.

2 participants