drizzle-team / drizzle-team/drizzle-orm
[BUG]: `drizzle-kit introspect` missing `--schema` option
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Report hasn't been filed before.
- [x] I have verified that the bug I'm about to report hasn't been filed before.
### What version of `drizzle-orm` are you using?
0.43.1
### What version of `drizzle-kit` are you using?
0.31.1
### Other packages
_No response_
### Describe the Bug
Related issues: #2150 #3978
[The documentation](https://orm.drizzle.team/docs/drizzle-kit-pull) for `drizzle-kit introspect` appears to imply that using the `--schema` flag should allow you to specify the output directory for schema files. However, this option doesn't appear to exist:
https://github.com/drizzle-team/drizzle-orm/blob/6c9e484c3047ea461ec0b9c7b99642e5ecafbb10/drizzle-kit/src/cli/schema.ts#L473-L481
https://github.com/drizzle-team/drizzle-orm/blob/6c9e484c3047ea461ec0b9c7b99642e5ecafbb10/drizzle-kit/src/cli/commands/utils.ts#L481-L489
...In fact, it doesn't appear to have **ever** existed since the commit that moved drizzle-kit into this public repository (4beb53c00ee4352e4ea43d7c93872d997a5c9681). A few questions regarding this:
1. Is the `--schema` option intended to exist?
2. If this option is not intended to exist, what is the proper way to specify the path that the schema should be written to? At the moment, the schema ends up in the same directory as the migrations, meaning the SQL logic and the actual app logic get mixed up.
Contributor guide
Research direction
Start with drizzle-kit/src/cli/schema.ts around lines 473-481 and drizzle-kit/src/cli/commands/utils.ts around lines 481-489, then compare the linked drizzle-kit documentation for introspect. Trace how the command selects its schema output path and determine whether --schema is expected to exist or which supported option controls that path. Done means the behavior and configuration are consistent with the documentation and the issue's separation requirement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100