CRUGG
CRUGG
Explore posts from servers
DTDrizzle Team
Created by CRUGG on 11/27/2024 in #help
How to store/query multi-line text in database?
await db
.update(serversTable)
.set({
config: "Hello\nWorld"
})
.where(eq(serversTable.id, "123"))
.execute();
await db
.update(serversTable)
.set({
config: "Hello\nWorld"
})
.where(eq(serversTable.id, "123"))
.execute();
I also tried:
// ...
.set({
config: `Hello
World`
})
// ...
// ...
.set({
config: `Hello
World`
})
// ...
both with the same result.
9 replies
DTDrizzle Team
Created by CRUGG on 11/27/2024 in #help
How to store/query multi-line text in database?
console.log and using the yaml library. When provided with Hello\nWorld! directly, console.log logs with the newlines and yaml works. When writing, then querying and using the same string through Drizzle, console.log logs \n literally and yaml library throws an exception (since yaml is dependant on newlines) And if I run the replaceAll on the result from Drizzle, it all behaves as before again.
9 replies