TS error: Argument of type PgTableWithColumns is not assignable to parameter of type AnyPgTable

Jjpcafe5/20/2023
Hi all, after updating to latest i'm getting this TS error. This is my db creation and schema.
import { User } from './schemas/user';

const queryClient = postgres(DATABASE_URL);

const db = drizzle(queryClient, { schema: { User } });
export type DB = typeof db;

db.select().from(User);
import { User } from './schemas/user';

const queryClient = postgres(DATABASE_URL);

const db = drizzle(queryClient, { schema: { User } });
export type DB = typeof db;

db.select().from(User);
Repro extracted from the getting started docs
import { pgTable, serial, text, varchar } from 'drizzle-orm/pg-core';

export const users = pgTable('users', {
id: serial('id').primaryKey(),
fullName: text('full_name'),
phone: varchar('phone', { length: 256 })
});

import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';

const client = postgres('');
const db = drizzle(client);

const allUsers = await db.select().from(users);
import { pgTable, serial, text, varchar } from 'drizzle-orm/pg-core';

export const users = pgTable('users', {
id: serial('id').primaryKey(),
fullName: text('full_name'),
phone: varchar('phone', { length: 256 })
});

import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';

const client = postgres('');
const db = drizzle(client);

const allUsers = await db.select().from(users);
MMaston5/20/2023
can't personally reproduce with drizzle-orm v0.26.0 postgres 3.3.4
Jjpcafe5/20/2023
i think the error is now gone i've installed from fresh!

Looking for more? Join the community!