-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
[BUG]:drizzle typescript doesn't see boolean column #2900
Comments
Getting this exact same problem, its started since |
Same thing here, seems like the typescript types are wonky all of a sudden. Same error, different schema: // schema.ts
export const event = sqliteTable(
"Event",
{
id: text("id").primaryKey(),
projectId: integer("projectId")
.notNull()
.references(() => project.id),
type: text("type", { enum: ["EXCEPTION", "MESSAGE"] }).notNull(),
message: text("message"),
stack: text("stack", { mode: "json" }),
meta: text("meta", { mode: "json" }),
count: integer("count"),
createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`),
lastEventAt: text("lastEventAt").default(sql`(CURRENT_TIMESTAMP)`),
resolvedAt: text("resolvedAt"),
},
(table) => {
return {
projectIdx: index("projectIdx").on(table.projectId),
};
}
); import { db, schema } from "../../../../../db";
import { and, eq } from "drizzle-orm";
await db
.update(schema.event)
.set({ resolvedAt: new Date().toISOString() })
.where(
and(
eq(schema.event.id, String(eventId)),
eq(schema.event.projectId, Number(projectId))
)
);
in a different file, typescript errors over the |
I can confirm this issue arises started in 0.32.0 |
Hello 👋 Can you check if you have https://github.com/rphlmr/drizzle-on-indexeddb/blob/main/tsconfig.json Here an the same schema with a tsconfig using strict mode: https://drizzle.run/x4vxq6rmgt0s0n5693poz5az |
yes, using strict mode |
@tamagokun I can't reproduce on https://drizzle.run/h64z5eeqpx5pki1my1xka3n5 Can you share your tsconfig? (here or on discord https://discord.com/channels/1043890932593987624/1293551158094467112) |
The Drizzle team suggests not using TypeScript versions higher than 5.4.5. They are working on a fix to support newer versions. |
Ah, that'll do it. Confirmed that rolling back to typescript 5.4.0 gets rid of the errors. Posting my tsconfig anyways. afaik based off the auto-generated next.js tsconfig, but added a few things: {
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"incremental": true,
"module": "esnext",
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsxImportSource": "nativewind",
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
} Also including package versions since mine may differ from the original issue's: {
"typescript": "5.4.5",
"@libsql/client": "^0.6.2",
"drizzle-orm": "^0.31.2"
} |
We have it as a priority, and if it doesn't require any major rewrites of types for new TypeScript versions, we will try to release it tomorrow |
Could someone check this tag |
If yes, will include in the next release |
Hey @AndriiSherman, confirming this is still broken. More context on env: https://discord.com/channels/1043890932593987624/1293551158094467112 |
Can confirm this is not in the latest release ( |
@Kaidstor how can you "close" this if it is not resolved? |
i get another bug, and create new issue #3269 |
What version of
drizzle-orm
are you using?0.33.0
What version of
drizzle-kit
are you using?0.24.2
Describe the Bug
i have entity
but when try to update it
see the error:
Object literal may only specify known properties, and 'active' does not exist in type '{ createdAt?: SQL | Date; country_code?: string | SQL; fromIp?: string | SQL; toIp?: string | SQL; }'.ts(2353)
Expected behavior
expect that I can to change boolean value and it contains in the
ranges
Environment & setup
No response
The text was updated successfully, but these errors were encountered: