CommandoBrando
CommandoBrando
Explore posts from servers
DTDrizzle Team
Created by CommandoBrando on 2/3/2025 in #help
Using magic SQL operator with 2 SQL dbs
Hi folks, In my project I need to connect to both separate mysql and postgres databases. I am able to successfully do so and create database objects but trying to execute raw SQL is not working currently using the magic SQL wrapper syntax. Typescript is confused because it does not know how to assign the types for sql as it tries to assign them from mysql and pg types
import { langlfowDb } from "..";
import { sql } from "drizzle-orm";


export const queryAgents = async () => {
const result = await langlfowDb.execute(
sql`select * from flow where locked = true;`,
);
console.log(result);
};
import { langlfowDb } from "..";
import { sql } from "drizzle-orm";


export const queryAgents = async () => {
const result = await langlfowDb.execute(
sql`select * from flow where locked = true;`,
);
console.log(result);
};
I get this error message:
Argument of type 'SQL<unknown>' is not assignable to parameter of type 'SQLWrapper'.
The types returned by 'getSQL()' are incompatible between these types.
Type 'import("/Users/revan/dev/archeAi/nextarche/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/drizzle-orm/sql/sql").SQL<unknown>' is not assignable to type 'import("/Users/revan/dev/archeAi/nextarche/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/drizzle-orm/sql/sql").SQL<unknown>'.
Types have separate declarations of a private property 'shouldInlineParams'.ts(2345)
Argument of type 'SQL<unknown>' is not assignable to parameter of type 'SQLWrapper'.
The types returned by 'getSQL()' are incompatible between these types.
Type 'import("/Users/revan/dev/archeAi/nextarche/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/drizzle-orm/sql/sql").SQL<unknown>' is not assignable to type 'import("/Users/revan/dev/archeAi/nextarche/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/drizzle-orm/sql/sql").SQL<unknown>'.
Types have separate declarations of a private property 'shouldInlineParams'.ts(2345)
How can resolve this issue?
1 replies
DTDrizzle Team
Created by CommandoBrando on 10/1/2024 in #help
View No $inferSelect
Hi folks, what is the best way to get a type from my view? It tells me I cannot do $inferSelect on a view.
1 replies
TTCTheo's Typesafe Cult
Created by CommandoBrando on 8/26/2024 in #questions
Api directory in App vs Server?
What is the difference between these? What kind of routes are defined in each?
2 replies
TTCTheo's Typesafe Cult
Created by CommandoBrando on 8/25/2024 in #questions
T3 Env Client QQ
Hi folks, trying to use client side env variables but I keep getting type mismatch warning. Do clientside variable need to be passed into clientside components as props?
2 replies
TTCTheo's Typesafe Cult
Created by CommandoBrando on 8/24/2024 in #questions
Best way to do form?
What is the best packages for doing forms cleanly and easily with clientside validation? nextjs
10 replies