drizzle-team / drizzle-team/drizzle-orm
[BUG]: "Error Please provide required params" although all are checked
- 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.44.2
### What version of `drizzle-kit` are you using?
^0.31.4
### Other packages
_No response_
### Describe the Bug
Updated `schema.ts`, `npm db:push` thows error - but the message makes no sense:
```
% DATABASE_URL=postgresql://user:pass@ex.tld:5432/db npm run db:push
> project@0.0.1 db:push
> drizzle-kit push
No config path provided, using default 'drizzle.config.ts'
Reading config file '/project/drizzle.config.ts'
Error Please provide required params:
[✓] dialect: 'postgresql'
[✓] schema: './src/lib/server/db/schema.ts'
%
```
```
# ./drizzle.config.ts
import { defineConfig } from 'drizzle-kit';
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
export default defineConfig({
schema: './src/lib/server/db/schema.ts',
dialect: 'postgresql',
dbCredentials: { url: process.env.DATABASE_URL },
verbose: true,
strict: true,
extensionsFilters: ["pg_stat_kcache", "pg_stat_kcache_detail", "pg_stat_statements", "pg_stat_statements_info"],
});
```
```
# ./src/lib/server/db/schema.ts
import { pgTable, serial, integer, text, timestamp, customType } from 'drizzle-orm/pg-core';
import { sql } from 'drizzle-orm';
export const session = pgTable('session', withAuditFields({
id: serial('id').primaryKey(),
uuid: text('uuid')
.$defaultFn(() => uuidv4())
.notNull(),
type: text('type'),
expiresAt: timestamp('expires_at', { withTimezone: true }).notNull(),
lastIP: text('last_ip'),
lastAgent: text('last_agent'),
lastSeenAt: timestamp('last_seen', { withTimezone: true }).notNull().defaultNow(),
}));
// ...
export type Session = typeof session.$inferSelect;
```
It worked before, I just added a new field.
Contributor guide
Assessment
This issue has not been assessed yet.