this post was submitted on 29 Mar 2024
13 points (88.2% liked)

SQL

451 readers
1 users here now

Related Fediverse communities:

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
 

Is there a programming language specifically designed for interacting with SQL databases that avoids the need for Object-Relational Mappers (ORMs) to solve impedance mismatch from the start?

If such a language exists, would it be a viable alternative to PHP or Go for a web backend project?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 10 points 4 months ago* (last edited 4 months ago) (3 children)

No matter how you tackle this, your front end likely communicates in json and your database in sql.

At the crux of it, your backend has the job of translating between the two without openly exposing the database to the front end (unless security truly doesn't matter for your app)

There's no easy way to get around the fact you simply just have to write logic to mediate between those two languages.

The best way I use to avoid mismatch problems between BE<->DB is I use Code First Entity Framework Core as my ORM, letting my EF Core spec act as the source if truth fir my db schema via automated EF migrations.

This means the only way you get a mismatch is due to merge conflicts not being resolved properly if 2 devs both mutate the db schema at the same time.

C#'s Linq is also the closest first class API I have seen that very closely mimics sql.

I genuinely find Linq queries on Entity Framework easier to write and read than sql.

[โ€“] [email protected] 2 points 4 months ago

Linq

LINQ is remarkable.

load more comments (2 replies)