top | item 43784200

A Principled Approach to Querying Data – A Type-Safe Search DSL

93 points| kioku | 10 months ago |claudiu-ivan.com

18 comments

order

fire_lake|10 months ago

> Users expect near-native responsiveness, even when offline

Do they? I think users are amazed if anything works without internet with modern applications.

scarletphoenix|10 months ago

In my mental model of an offline app, I expect instant responses. However, I know to the complexities of apps, the diverse wants of a big, diverse user base that it can be hard/impossible for an app to be well-architected enough to achieve this ideal.

Failover is hard, and there generally aren't hard rules for what to do if data isn't available or how to communicate to a user in a specific offline situation on how the current state of an offline app affects what they see -- and even when they would care or what they could do about it when they do care

cdaringe|10 months ago

The two are not mutually exclusive!

FrustratedMonky|10 months ago

Seems a lot like FSharp Type Providers? Is that a good analogy?

williamcotton|10 months ago

I've got a similar project that includes a React component for the search input. The React component is actually a Monaco text editor so you get syntax highlighting, error highlighting, tab completion and more.

Check it out here: https://github.com/williamcotton/search-input-query

There's an animated GIF of the demo so you can get a very quick idea of how it works!

gitroom|10 months ago

Nice, Ive bounced around between Prisma and Kysely too. I get nervous about locking too much into one thing, you ever worry if leaning on too much codegen or magic ends up biting you down the road?

tehlike|10 months ago

LINQ or PRQL.

hu3|10 months ago

Looks good.

For a more database specific, type-safe, data querying solution, I like to use https://kysely.dev

damidekronik|10 months ago

I am using both prisma and kysely in the same codebase with a great success. The db schema is driven by SQL, not prisma. It is then introspected by both kysely and prisma, prisma is used in 95% of the places while kysely is used whenever performance is critical or when prisma doesn't support the SQL features we need.

mifydev|10 months ago

The same should apply to configuration, we have prisma for sql, we should have something like this for JSONs, like https://typeconf.dev (I’m one of the founders)