Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default export for all schema #19

Closed
fdarian opened this issue Jan 14, 2024 · 2 comments
Closed

Provide default export for all schema #19

fdarian opened this issue Jan 14, 2024 · 2 comments

Comments

@fdarian
Copy link
Owner

fdarian commented Jan 14, 2024

Using schema.ts for drizzle-kit doesn't expose any schema.

export default defineConfig({
  schema: './drizzle/schema/schema.ts',
})

It can't find any tables from the schema.ts, but glob works fine

export default defineConfig({
  schema: './drizzle/schema/*',
})

Originally posted by @hilja in #18 (comment)

@fdarian
Copy link
Owner Author

fdarian commented Jan 19, 2024

After some thinking, it might be better to just recommend the use of glob pattern instead of introducing another index.ts that re-exports all schema since it'll make IDE to give duplicate recommendations when importing a table. Also barrel file is normally better to be avoided because of (IDE) performance issue

@fdarian fdarian closed this as completed Jan 19, 2024
@hilja
Copy link

hilja commented Jan 24, 2024

That's great, mentioning it in the docs basically solves the issue. Thank for all the work!

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

No branches or pull requests

2 participants