Ben-xD
Ben-xD
Explore posts from servers
DTDrizzle Team
Created by Ben-xD on 7/29/2024 in #help
How to convert filters (e.g. eq(), ne(), lte(), like()) into SQL string, for use in sql.raw()
I'm trying to use LEFT JOIN LATERAL, but I have a lot of filters already created with drizzle. I would like to use them in my SQL:
const query = sql.raw(`SELECT user.id, message.received_at FROM user LEFT JOIN LATERAL (SELECT message.user_id, message.received_at FROM message WHERE message.user_id = user.id ORDER BY message.received_at LIMIT 1) message on user.id=message.user_id`);
// TODO use other filters too: `AND ${filtersExceptTime?.getSQL()}` doesn't work

const result = await db.execute(query);
const query = sql.raw(`SELECT user.id, message.received_at FROM user LEFT JOIN LATERAL (SELECT message.user_id, message.received_at FROM message WHERE message.user_id = user.id ORDER BY message.received_at LIMIT 1) message on user.id=message.user_id`);
// TODO use other filters too: `AND ${filtersExceptTime?.getSQL()}` doesn't work

const result = await db.execute(query);
5 replies
TtRPC
Created by Ben-xD on 12/20/2023 in #❓-help
Why do people use SplitLink? (http + websocket)
Why not just use websockets for everything? Just curious.
5 replies
CDCloudflare Developers
Created by Ben-xD on 12/18/2023 in #pages-help
Different requests get different files
Different client requesting the same file (sw.js) are getting different files. This is bad for PWAs, but browsers think there is a new version whenever the user opens the page Does anyone know why that might happen? I have more detail in a post: https://discord.com/channels/595317990191398933/789155108529111069/1185984798804672662
2 replies
CDCloudflare Developers
Created by Ben-xD on 4/4/2023 in #pages-help
wrangler pages dev --local=false still runs locally
Has anyone tries to run pages remotely? It defaults to local, but I cannot seem to make --local=false, as in https://developers.cloudflare.com/workers/wrangler/commands/#dev-1
2 replies