Skip to content

Conversation

@louis-pre
Copy link
Member

Context

Lots of context here, I can't cover it all in a PR description. Will be discussed with the team.

High level explanation

This PR adds the generateTypes function, it reads a Zapatos schema file and generates a number of typescript type files from it.

Output:

  • A Kysely schema
  • A Knex schema (optional)
  • One type file per table organized in folders per schema
  • One customization file for each configured table (optional)
  • Pgtui bugs reproduction for each configured table (optional)

See this PR for an example of the output (with none of the optional stuff though)

Architecture

  • generateTypes takes a config as parameter that allows the user to customize the generated output.
  • The file-generators folder follows a Nextjs file-based routing style structure. In our case, each "route" is a file generator.
    Following this structure helps document where the generated files will be located and how they'll be named.

Related to seamapi/seam-pgm#6

@louis-pre louis-pre self-assigned this Apr 18, 2025
@louis-pre louis-pre merged commit a2b62c9 into main Apr 18, 2025
15 checks passed
@louis-pre louis-pre deleted the feat/type-gen branch April 18, 2025 21:53
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.

3 participants