drizzle-team / drizzle-team/drizzle-orm
[BUG]: tablesFilter doesn't work when using views
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
I have a Postgres DB with a couple of tables and views autogenerated from my hosting service. I wish to ignore these all together. However, when I run generate and push, I get prompted "Is table created or renamed from another table?" and then a list of the views and tables.
drizzle-kit: 0.21.1
drizzle-orm: 0.30.10
Example:

In the example, spatial_ref_sys is a table and the rest is views.
Heres my config:
```JavaScript
// config.drizzle.js
import 'dotenv/config'
import { defineConfig } from 'drizzle-kit'
const DATABASE_URL =
process.env.DATABASE_URL || process.env.POSTGRESQL_ADDON_URI
export default defineConfig({
schema: 'src/db/schema.*',
out: 'src/db/migrations',
dialect: 'postgresql',
dbCredentials: {
url: DATABASE_URL,
},
verbose: true,
strict: false,
tablesFilter: [
'!geography_columns',
'!geometry_columns',
'!raster_columns',
'!spatial_ref_sys',
'!pg_stat_statements',
'!raster_overviews',
'!pg_stat_statements_info',
],
schemaFilter: ['public'],
})
```
Current workaround is to declare the autogenerated views + tables in schema as pgTable's in my schemas and manually create them in my local DB
Contributor guide
Research direction
Start with config.drizzle.js and the tablesFilter configuration used by the generate and push commands, reproducing the behavior against PostgreSQL views and tables. Verify that the listed autogenerated objects are ignored without declaring them as pgTable entries, and that the rename/create prompts no longer include them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100