Skip to content

feat!: Allow non-optional generation of params with optionalNullParams#582

Open
pnappa wants to merge 1 commit into
adelsz:masterfrom
pnappa:add-optional-null-override
Open

feat!: Allow non-optional generation of params with optionalNullParams#582
pnappa wants to merge 1 commit into
adelsz:masterfrom
pnappa:add-optional-null-override

Conversation

@pnappa

@pnappa pnappa commented Jun 11, 2024

Copy link
Copy Markdown
Contributor

This feature allows specifying whether nullable params should be generated as optional via the config.

The default behaviour stays the same, so this feature is backwards compatible.

Addresses #556

@vercel

vercel Bot commented Jun 11, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pgtyped ❌ Failed (Inspect) Mar 16, 2025 11:00pm

@pnappa

pnappa commented Jun 11, 2024

Copy link
Copy Markdown
Contributor Author

Fixed!: the correct command to run the test suite is npm run build && npm run 'lint!' && npm run test, as you need to build the lib (which needs to be fixed by the linter in place, as the build directory isn't ignored by the linter), then finally followed by the test command.

Note: I wasn't able to run the tests locally for some reason - npm install && npm run test failed with:

@pgtyped/runtime: > @pgtyped/runtime@2.3.0 test
@pgtyped/runtime: > NODE_OPTIONS='--experimental-vm-modules' jest
@pgtyped/runtime:  FAIL  src/preprocessor-ts.test.ts
@pgtyped/runtime:   ● Test suite failed to run
@pgtyped/runtime:     src/preprocessor-ts.test.ts:1:30 - error TS2307: Cannot find module '@pgtyped/parser' or its corresponding type declarations.
@pgtyped/runtime:     1 import { parseTSQuery } from '@pgtyped/parser';
@pgtyped/runtime:                                    ~~~~~~~~~~~~~~~~~
@pgtyped/runtime:  FAIL  src/preprocessor-sql.test.ts
@pgtyped/runtime:   ● Test suite failed to run
@pgtyped/runtime:     src/preprocessor-sql.test.ts:1:61 - error TS2307: Cannot find module '@pgtyped/parser' or its corresponding type declarations.
@pgtyped/runtime:     1 import { queryASTToIR, parseSQLFile as parseSQLQuery } from '@pgtyped/parser';
@pgtyped/runtime:                                                                   ~~~~~~~~~~~~~~~~~
@pgtyped/runtime: Test Suites: 2 failed, 2 total
@pgtyped/runtime: Tests:       0 total
@pgtyped/runtime: Snapshots:   0 total
@pgtyped/runtime: Time:        0.963 s
@pgtyped/runtime: Ran all test suites.
@pgtyped/runtime: npm ERR! Lifecycle script `test` failed with error:
@pgtyped/runtime: npm ERR! Error: command failed
@pgtyped/runtime: npm ERR!   in workspace: @pgtyped/runtime@2.3.0
@pgtyped/runtime: npm ERR!   at location: /Users/pnappa/github.com/pnappa/pgtyped/packages/runtime

Any ideas?

@pnappa

pnappa commented Aug 28, 2024

Copy link
Copy Markdown
Contributor Author

Hi @adelsz - is there any chance of getting this merged into mainline? Is there anything you'd like me to do?

Cheers!

@pnappa

pnappa commented Mar 7, 2025

Copy link
Copy Markdown
Contributor Author

Hi @adelsz , I've resolved any test failures in this branch. npm run build && npm run 'lint!' && npm run test returns zero errors locally for me.

Cheers!

Update 17 Mar - rebased to fix conflicts.

This feature allows specifying whether nullable params should be
generated as optional via the config.

The default behaviour stays the same, so this feature is backwards
compatible.
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