blinkblinko
blinkblinko
Explore posts from servers
DTDrizzle Team
Created by blinkblinko on 7/31/2024 in #help
Missing newlines when querying sqlite text column
I am saving text to a turso sqlite database, if I shell into the db I can see that the newlines have been saved, but whenever I use drizzle orm db.query.table.findMany() I see that the newlines have been stripped. Any idea how to stop this? For example, using the db shell:
SELECT * FROM table;
ID TEXT
0 Hello
World
1 Single line
2 Newline

are

preserved
3 Another single line
SELECT * FROM table;
ID TEXT
0 Hello
World
1 Single line
2 Newline

are

preserved
3 Another single line
But using drizzle:
await db.query.table.findMany();
[
{
id: 0,
text: "Hello world"
},
{
id: 1,
text: "Single line"
},
{
id: 2,
text: "Newline are preserved"
},
{
id: 3,
text: "Another single line"
},
]
await db.query.table.findMany();
[
{
id: 0,
text: "Hello world"
},
{
id: 1,
text: "Single line"
},
{
id: 2,
text: "Newline are preserved"
},
{
id: 3,
text: "Another single line"
},
]
Its the same if I use db.run(sqlSELECT * FROM table)
2 replies
TTCTheo's Typesafe Cult
Created by blinkblinko on 3/22/2024 in #questions
Calling public trpc procedure redirects user to custom signin, causing an infinite loop
I have a custom sign in page, set up with next-auth middleware. This sign in page calls a public procedure of a trpc router. It loops forever until crash. Enabling DEBUG=* I see that there is a loop because the public trpc route seems to redirect to the sign in page, which then calls the procedure, which then redirects again, so on. All SSR. The proc is just returning a simple static object so wondering how a next auth redirect got in the mix.
6 replies