3 ms·
Sql is not only typed, its very strongly typed. Please dont confuse the lack of explicit annotations in typical sql for a lack of types. Sql is the prototypical
by tathougies 8y ago
Sql is not only typed, its very strongly typed. Please dont confuse the lack of explicit annotations in typical sql for a lack of types. Sql is the prototypical killer app for type inference. Its so good, most people think it's untyped
- Aeolun 8y agoRight. I think it was fairly clear what I meant, since Prisma cannot really help to change postgres internals (and strict typing in mysql is a bit hit&miss in the first place), but for the sake of everyone else reading this: SQL results, coming without any translation layer, are untyped. Your result could be anything from a string to an array with an infinite number of fields. It doesn’t really get more structure than this big array either, regardless of table representation. Prisma helps with that.
- jacques_chester 8y ago> SQL results, coming without any translation layer, are untyped. That would depend on the database's wire protocol, wouldn't it?
- Aeolun 8y agoDo I really have to qualify this with ‘mainstream databases, with mainstream client libraries, in nearly all major languages’?
- jacques_chester 8y agoI don't know. That's why I asked. I did a quick lookup of libpq and it gave the impression that it can answer for column types.
- tathougies 8y agoMainstream databases like Postgres and SQL server (and MySQL too I think) all return type information with their results. Having written wire protocol clients for these, I flat out reject your claim that SQL isn't typed at the results level. It's one of the few places in common usage that the types are explicitly stated. Whether or not your client libraries reflect that is a different issue (and if they don't, I encourage you to use something better).