frankscp
frankscp
DTDrizzle Team
Created by frankscp on 2/4/2024 in #help
can't connect to database in Netflify after adding drizzle, even though it works in localhost
Error log:
Error: getaddrinfo ENOTFOUND {myDatabaseHostURL}
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
errno: -3007,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: {myDatabaseHostURL}
}
Error: getaddrinfo ENOTFOUND {myDatabaseHostURL}
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
errno: -3007,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: {myDatabaseHostURL}
}
3 replies
DTDrizzle Team
Created by frankscp on 2/4/2024 in #help
can't connect to database in Netflify after adding drizzle, even though it works in localhost
Can it be related to how I'm creating my database connection client? I saw a few discussions on it
import {DIRECT_URL } from '$env/static/private';
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
const connectionString = DIRECT_URL;
// Disable prefetch as it is not supported for "Transaction" pool mode
const client = postgres(connectionString, { prepare: false });
export const db = drizzle(client);
import {DIRECT_URL } from '$env/static/private';
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
const connectionString = DIRECT_URL;
// Disable prefetch as it is not supported for "Transaction" pool mode
const client = postgres(connectionString, { prepare: false });
export const db = drizzle(client);
3 replies
DTDrizzle Team
Created by Júlio on 11/29/2023 in #help
What is the best way to create conditional filters on a query?
Can you provide an example?
5 replies
DTDrizzle Team
Created by frankscp on 1/15/2024 in #help
How to check if a column of type uuid has a value missing without using sql
Perfect, thank you! 🙂
4 replies
DTDrizzle Team
Created by frankscp on 12/14/2023 in #help
Having CRUD functions and Transaction Support
Ok I think I found a potential solution. Instead of using the drizzle client directly, I added it as an input. This way, I can pass either the drizzle client or the client in the context of the transaction. Rollbacks are working as expected 🙂
3 replies
DTDrizzle Team
Created by frankscp on 12/4/2023 in #help
Transaction rolling back without error
Hey, thank you for your answer I ended up stumbling upon the solution. Basically, needed to add 'prepare: false' to my drizzleClient
const client = postgres(connectionString, { prepare: false });
const client = postgres(connectionString, { prepare: false });
8 replies
DTDrizzle Team
Created by shultz🇮🇱 on 7/20/2023 in #help
drizzle-kit introspect:pg Invalid input Only "pg" is available options for "--driver"
I was having the exact same issue. I managed to solve it by using credentials instead of the connection string:
import type { Config } from "drizzle-kit";

export default {
schema: "./src/schema/*",
out: "./drizzle",
driver: 'pg',
dbCredentials: {
user: "postgres",
password: "password",
host: "127.0.0.1",
port: 5432,
database: "db",
}
} satisfies Config;
import type { Config } from "drizzle-kit";

export default {
schema: "./src/schema/*",
out: "./drizzle",
driver: 'pg',
dbCredentials: {
user: "postgres",
password: "password",
host: "127.0.0.1",
port: 5432,
database: "db",
}
} satisfies Config;
5 replies