Antti Rasinen
At least it doesn’t have ä or ö and it’s not a compound word either. As far as Finnish words go it’s relatively inoffensive 😇
ALT: a man in a bulls jersey stands in front of a blue map
5
Reed the Goblin (formerly Wichita) (🇺🇸)
that's funny. However, you got me to look up "kysely" and I am compelled to mention I do not like those kinds of "thin abstraction layer"s over sql. Just type SQL into your code. You think you are gaining type-safety, etc. but you aren't
2
Reed the Goblin (formerly Wichita) (🇺🇸)
no, thank you. I can see from the first page of the site that it is exactly the kind of thing I revile about "thin abstraction layers over sql" They have taken sql syntax and smashed it into a series of function calls, making the sql hard to decipher.
2
Igal Klebanov 💥 kysely
software development is all about tradeoffs - the added value is clear to teams and individuals who enjoy the type safety, wase of use, composition power, etc. also, comparing things based on hello world examples without taking them for a spin.. is not being serious.
1 1
Igal Klebanov 💥 kysely
optional, but recommended to auto-generate types from your database to avoid database drift being undetected by ci. does your alternative provide such protections or less "coupling"?
2 1
Reed the Goblin (formerly Wichita) (🇺🇸)
another solution I almost liked (but disliked for purely political reasons) was "db as a service" Your code doesn't connect to any DB, they connect to a data provider: const person = datamonkey.fetchPerson(1) this only works if you own the service and can add the apis for the access you need
1
Igal Klebanov 💥 kysely
same as with orms, you eventually have to break out of the limited api and perform raw sql for prrformance reasons, or for things unsupported by api, e.g. window functions.
1 1
Reed the Goblin (formerly Wichita) (🇺🇸)
it works when you embrace (or have forced on you) microservices (are those still in vogue?) so the datamonkey is one such, and no one else in the stack even cares what kind of db or db-like thing has the info: mysql? cassandra? bigtable? redis? a gnome with a filing cabinet?
1
Igal Klebanov 💥 kysely
what you're describing is a data service or data access layer, if i get what you're describing.. someone still has to implement the endpoints. if its someone at the company, they still have to perform queries against the database, and maintain that stuff.
1 1
1 more reply
Reed the Goblin (formerly Wichita) (🇺🇸)
the best solution i've seen is to never put naked sql like this into the codebase, either as a string (as I was exampling) or as chained functions (as kelsely does) Instead, use a db stored procedure for EVERY access by client code, and version those. When the db changes, change sprocs
2
Igal Klebanov 💥 kysely
used stored procedures extensively in production. never going back. editing requires a connection for autocompletion & errors. usually not co-located /w call sites, causing unnecessary context switches. make cicd more complex. rare readily available type-safe solutions to introspect & exec them.
1 1
Igal Klebanov 💥 kysely
unless the stored procedure is tested, nothing stops you from applying migrations that would break it going forward. this slows you down, especially during exploration.
1
1 more reply
Reed the Goblin (formerly Wichita) (🇺🇸)
if the client needs different data, version the query. Then old code using the old query still works, and new code using version 2 can be deployed at leisure const personandpet = await db .executeProcedure("getpersonandpet_1",1) if (personandpet){…}
1