ArChak
ArChak
Explore posts from servers
TtRPC
Created by ArChak on 7/29/2024 in #❓-help
Checking the connection status from the client side
I am doing nodejs to nodejs subscription, and I can't figure out how to check the connection status from the client side in both sse or ws approach so I can handle on disconnect.
2 replies
TtRPC
Created by ArChak on 7/26/2024 in #❓-help
How to check websocket is alive from client?
Hi, I am new to trpc, might I know how can I check the websocket connection is alive from client side? (I am doing node to node call) I tried to subscribe from the client and then close the server, but there is no error or something I can tell the user the connection is dead.
2 replies
DTDrizzle Team
Created by ArChak on 7/5/2024 in #help
How to check user input is a valid column before appending condition?
Does anyone knows the proper way to do so?
if (columnFilters.length > 0) {
const columnWhereClause: (SQL | undefined)[] = columnFilters.map(
(filter) => {
const columns = getTableColumns(tasks);

if (filter.column in columns) {
// getting error on columns[filter.column]: type 'string' can't be used to index type
return ilike(columns[filter.column], `%${filter.keyword}%`);
}
},
);
whereClause.push(and(...columnWhereClause));
}
if (columnFilters.length > 0) {
const columnWhereClause: (SQL | undefined)[] = columnFilters.map(
(filter) => {
const columns = getTableColumns(tasks);

if (filter.column in columns) {
// getting error on columns[filter.column]: type 'string' can't be used to index type
return ilike(columns[filter.column], `%${filter.keyword}%`);
}
},
);
whereClause.push(and(...columnWhereClause));
}
4 replies