drizzle-team / drizzle-team/drizzle-orm
[BUG]: runnning introspect:pg adds unused import functions to schema.ts
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### What version of `drizzle-orm` are you using?
0.30.10
### What version of `drizzle-kit` are you using?
0.20.18
### Describe the Bug
When i execute "drizzle-kit introspect:pg", it adds unused import functions to schema.ts.
#### The unused import functions
```
import { pgTable, pgSchema, index, uniqueIndex, varchar, time, boolean, timestamp, date, serial, text, doublePrecision, integer, bigint } from "drizzle-orm/pg-core"
import { sql } from "drizzle-orm"
```
Out of the above, pgTable and sql aren't used in the schema.ts file.
Thus my linter warns me for unused imports.
### Expected behavior
Not adding unused import function.
### Environment & setup
#### Packages i use
"dependencies": {
"@fastify/cors": "^9.0.1",
"drizzle-orm": "^0.30.10",
"fastify": "^4.27.0",
"firebase": "^10.12.1",
"firebase-admin": "^12.1.1",
"fluent-json-schema": "^4.2.1",
"postgres": "^3.4.4"
},
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@fastify/swagger": "^8.14.0",
"@fastify/swagger-ui": "^3.0.0",
"@types/node": "^20.12.10",
"@types/pg": "^8.11.6",
"drizzle-kit": "^0.20.18",
"drizzle-valibot": "^0.2.0",
"i": "^0.3.7",
"pg": "8.11.5",
"pino-pretty": "^11.0.0",
"tsx": "^4.9.3",
"typescript": "^5.4.5"
},
updating pg to 8.11.6 didn't change the result
#### command I run from package.json:
"scripts": {
"pull": "pnpm --env-file=.env drizzle-kit introspect:pg",
}
#### drizzle.config.ts:
```
import { defineConfig } from "drizzle-kit";
export default defineConfig({
driver: 'pg',
schema: "./src/schema.ts",
out: "./drizzle",
dbCredentials: {
connectionString: process.env.DB_URL ?? ''
},
schemaFilter: ["public", "sales"],
});
```
Contributor guide
Assessment
This issue has not been assessed yet.