Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Jan 21, 2026

Summary

Fixes backwards compatibility for code that imports model classes directly from the SDK:

import { DatabaseModel, TableModel, createMutationOperations } from '@constructive-db/constructive-sdk';

The generated index.ts was importing models but not re-exporting them, causing TypeScript errors like:

Module '"@constructive-db/constructive-sdk"' has no exported member 'DatabaseModel'.

This adds the following re-exports to the generated index.ts:

  • export * from './models' - all model classes
  • export { createQueryOperations } from './query' - when queries exist
  • export { createMutationOperations } from './mutation' - when mutations exist

Updates since last revision

  • Updated test snapshots in client-generator.test.ts.snap to reflect the new export statements

Review & Testing Checklist for Human

  • Regenerate the SDK in constructive-db (pnpm run generate:sdk) and verify the tests pass (pnpm test in application/app)
  • Verify no naming conflicts between model exports and existing exports from ./select-types or ./client
  • Check that the generated index.ts includes the new export statements

Notes

Link to Devin run: https://app.devin.ai/sessions/475ee077a17e4f02b2b71f5aeba11854
Requested by: Dan Lynch (@pyramation)

…ex.ts

The generated index.ts was importing models but not re-exporting them,
breaking backwards compatibility for code that imports models directly:

  import { DatabaseModel, TableModel } from '@constructive-db/constructive-sdk';

This adds:
- export * from './models' to re-export all model classes
- export { createQueryOperations } from './query' (when queries exist)
- export { createMutationOperations } from './mutation' (when mutations exist)

This maintains backwards compatibility while still supporting the new
createClient() API.
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 2deb9be into main Jan 21, 2026
48 checks passed
@pyramation pyramation deleted the fix-sdk-model-exports branch January 21, 2026 11:18
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