Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: f.map is not a function running Drizzle Studio using schema with constructor column #569

Open
seppewyns opened this issue Sep 16, 2024 · 0 comments

Comments

@seppewyns
Copy link

I'm getting the following error when running Drizzle Studio using a schema that has a table with a column named constructor.
The error occurs when the database column itself is named constructor.

For example:

  • carConstructor: varchar("constructor") throws an error
  • constructor: varchar("car_constructor") does not throw an error

This might be related to the fact that the constructor property of an object typically refers to the constructor function.

Stack trace:

TypeError: f.map is not a function
    at https://local.drizzle.studio/index.js:14051:6036
    at Array.forEach (<anonymous>)
    at ori (https://local.drizzle.studio/index.js:14051:5671)
    at https://local.drizzle.studio/index.js:14040:6
    at Array.map (<anonymous>)
    at cri (https://local.drizzle.studio/index.js:14039:39)
    at bri (https://local.drizzle.studio/index.js:14060:306)
    at ykl (https://local.drizzle.studio/index.js:14123:34156)

Schema:

import { pgTable, uuid, varchar } from "drizzle-orm/pg-core";

export const cars = pgTable("cars", {
  id: uuid("id").primaryKey().defaultRandom(),
  carConstructor: varchar("constructor").notNull(),
});

Bug report: bug-report.zip

  • drizzle-orm: 0.33.0
  • drizzle-kit: 0.24.2
  • Node.js: v20.17.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant