© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
1 reply
eatmoose

Type error?

import { pgTable, serial, integer } from 'drizzle-orm/pg-core';

export const users = pgTable('users', {
  id: serial('id').primaryKey(),
});

export const products = pgTable('products', {
  id: serial('id').primaryKey(),
});

export const metadata = pgTable('metadata', {
  id: serial('id').primaryKey(),

  someOtherRef: integer('some_other_ref_id').references(() => someOtherRef.id),
});

export const someOtherRef = pgTable('someOtherRef', {
  id: serial('id').primaryKey(),

  metadataId: integer('meta_data_id').references(() => metadata.id),
});
import { pgTable, serial, integer } from 'drizzle-orm/pg-core';

export const users = pgTable('users', {
  id: serial('id').primaryKey(),
});

export const products = pgTable('products', {
  id: serial('id').primaryKey(),
});

export const metadata = pgTable('metadata', {
  id: serial('id').primaryKey(),

  someOtherRef: integer('some_other_ref_id').references(() => someOtherRef.id),
});

export const someOtherRef = pgTable('someOtherRef', {
  id: serial('id').primaryKey(),

  metadataId: integer('meta_data_id').references(() => metadata.id),
});

....it does not have a type annotation and is referenced directly or indirectly in its own initializer.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

DB type error
Drizzle TeamDTDrizzle Team / help
3y ago
Nuxt3 type error
Drizzle TeamDTDrizzle Team / help
3y ago
Type error when inserting
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle schema type error
Drizzle TeamDTDrizzle Team / help
2y ago