Effect CommunityEC
Effect Community2y ago
59 replies
Kristian Notari

Struggling with TypeScript Query Builders: Seeking Pre-runtime SQL Validation Solutions

I was convinced writing queries in typescript with an advanced query builder was the right choice, but more queries I write more I feel like it's slowing down both my dx and my typechecking... but I don't want to do a guessing game on which query is going to silently fail everytime I change table schema or similar.

From what I know sqlx doesn't come with a type safe query builder, so I guees it's just "write the query and hope it works runtime". Does someone have the need to have it checked before have it fail at runtime? Like, some sort of ts plugin that checks queries wrapped by sql or a command that checks them on a live db instance? Or something else?
Was this page helpful?