howtonity
howtonity
DTDrizzle Team
Created by howtonity on 7/24/2024 in #help
geometry not available on 'drizzle-orm/pg-core'
nvm, it was just an eslint issue. I just had to update all my packages.
6 replies
DTDrizzle Team
Created by howtonity on 7/24/2024 in #help
geometry not available on 'drizzle-orm/pg-core'
Ok, I got the latest version of drizzle and was able to access geometry.
import { geometry, index, pgTable, serial, text } from "drizzle-orm/pg-core";
export const stores = pgTable(
"stores",
{
id: serial("id").primaryKey(),
name: text("name").notNull(),
location: geometry("location", {
type: "point",
mode: "xy",
srid: 4326,
}).notNull(),
},
(t) => ({
spatialIndex: index("spatial_index").using("gist", t.location),
}),
);
import { geometry, index, pgTable, serial, text } from "drizzle-orm/pg-core";
export const stores = pgTable(
"stores",
{
id: serial("id").primaryKey(),
name: text("name").notNull(),
location: geometry("location", {
type: "point",
mode: "xy",
srid: 4326,
}).notNull(),
},
(t) => ({
spatialIndex: index("spatial_index").using("gist", t.location),
}),
);
When I try to follow the examples, I get the error: Unsafe call of an error type typed value. I am using the t3-stack with drizzle, I don't know if the way any of it is setup is causing this issue.
6 replies