db0 icon indicating copy to clipboard operation
db0 copied to clipboard

Type issue with integrations

Open Barbapapazes opened this issue 1 year ago • 3 comments
trafficstars

Environment

"db0": "^0.1.4", "drizzle-orm": "^0.31.2"

[email protected]

Reproduction

Write import { drizzle } from "db0/integrations/drizzle"; in any project and the IDE will tell you that types does not exists.

Describe the bug

Hey,

I'm trying to use this integration: https://db0.unjs.io/integrations/drizzle but my IDE complains about types.

Screenshot 2024-07-04 at 19 51 48

While trying to understand why this could happens, it seems to be an issue with the compilation step where the ../../types does not exists anymore since every thing move to dist except integrations and connectors because of mkdist.

Screenshot 2024-07-04 at 19 45 46

Additional context

No response

Logs

No response

Barbapapazes avatar Jul 04 '24 17:07 Barbapapazes

@Barbapapazes, this worked for me...

import { drizzle } from "db0/integrations/drizzle/index";

Wr4th100 avatar Jul 11 '24 09:07 Wr4th100

@Barbapapazes, this worked for me...

import { drizzle } from "db0/integrations/drizzle/index";

Oohh ok, I'll give a try (but adding /index at the end, seems to be more a workaround than a normal behavior).

Barbapapazes avatar Jul 11 '24 09:07 Barbapapazes

It works but not really because the type Database cannot be resolved so you can pass a string to the Drizzle integration and TypeScript won't complain.

Barbapapazes avatar Jul 11 '24 16:07 Barbapapazes

fixed with https://github.com/unjs/db0/commit/c48530cda032175f0c0377df4addc99399063774

pi0 avatar Oct 09 '24 21:10 pi0