DT
Join ServerDrizzle Team
help
is not assignable to type 'DrizzleD1Database'
Hello
This last release was amazing. Making joins simple was the missing piece for me.
However, I'm trying to upgrade https://race-stack.pages.dev to the new API (it previously used the joins).
I'm getting the error from the screenshot. Not sure what's going on, created a PR with it.
Here's the PR - https://github.com/jose-donato/race-stack/pull/2
schema - https://github.com/jose-donato/race-stack/blob/f5ce04cdae134302c94e2de671c7a272274dab36/app/lib/schema.ts
db initialization - https://github.com/jose-donato/race-stack/blob/f5ce04cdae134302c94e2de671c7a272274dab36/app/lib/db.service.server.ts
This last release was amazing. Making joins simple was the missing piece for me.
However, I'm trying to upgrade https://race-stack.pages.dev to the new API (it previously used the joins).
I'm getting the error from the screenshot. Not sure what's going on, created a PR with it.
Here's the PR - https://github.com/jose-donato/race-stack/pull/2
schema - https://github.com/jose-donato/race-stack/blob/f5ce04cdae134302c94e2de671c7a272274dab36/app/lib/schema.ts
db initialization - https://github.com/jose-donato/race-stack/blob/f5ce04cdae134302c94e2de671c7a272274dab36/app/lib/db.service.server.ts
Will try to check and fix it asap
no rush, thanks for the help 🤟
not a bug with drizzle, you explicitly type the return type of that function as
DrizzleD1Database
which is not assignable, try DrizzleD1Database<typeof schema>
export const getDbFromContext = (
context: Record<string, unknown>
): DrizzleD1Database<typeof schema> => {
if (!contextWithDb(context)) {
throw new Error("No database in context");
}
return drizzle(context.DB, {
schema,
});
};
works for me, i cloned your pr
looks like a nice project you got also 

ohhhh I'm dumb 🫣🫣🫣
sorry for wasting your time with this 😅
thank you! drizzle has been amazing to work with. using on several projects
sorry for wasting your time with this 😅
thank you! drizzle has been amazing to work with. using on several projects