92 karma · joined November 14, 2022
https://www.reddit.com/r/ProgrammerHumor/comments/q9x1d2/ask...
> Except that over time it had become accidentally load bearing
> through other (ill conceived) changes to the structure this stud was now helping hold up the second floor of the house
Evidently, you couldn't easily tell why it was there. Moreover, I'm not persuaded that it accidentally became load bearing. It seems quite plausible that it deliberately became load bearing, for reasons which are ill conceived to you but not to the people who had them.
https://www.postgresql.org/docs/current/cube.html
The cube datatype also stores arrays of numbers (cubes or vectors, same thing) and has functions/operators for computing distance. Granted, they're slightly different, with no direct substitute for cosine distance, but on the unit sphere the cosine distance, inner product, and Euclidean distance have direct correspondences.
I wish. Unfortunately, sometimes a stateless HTTP REST API is simply a non-negotiable business requirement.
Evidently, even some experts do use triggers.
"I normally limit them to at most one per operation per TRIGGER"
Great! So do I! So far so good. I guess I'm still in the good graces of some experts.
"in full ANSI/ISO SQL, we do have schema level constraints, the CREATE ASSERTION statement, but that is another topic"
Not in PostgreSQL, we don't. Evidently some experts may not be perfect experts.
> It seems like you built a layer of indirection to specifically allow the thing you said you didn’t want to do a couple posts up
No, because my layer of indirection is in the database in the form of views and procedures. I could be wrong, but I took "coupling my application schema to my database schema" to be something like "having your HTTP API depend on objects in the database", which it does because of the way that postgREST works. If that's the kind of coupling we're talking about, then that's the kind of coupling I would rather embrace than avoid.
Perhaps what you're asking is, "Why not just have your user interface connect directly to PostgreSQL and issue SQL statements?"
> For the back-end, Apollo Server absolutely can be beat by tools that don't require you to write any code:
> https://supabase.com/blog/pg-graphql
> https://www.graphile.org/postgraphile/
The careful reader will note that I presented three alternatives, with the one provided by my company last. Moreover, what I wrote is in fact a matter of fact. If you wish to have a GraphQL server without having to write server code to do it, as fine a product as Apollo is you cannot use Apollo to do it because that's not what Apollo does.
What I have done is present not matters of judgment, but matters of fact.
Fact: Apollo is not _the_ GraphQL company.
Fact: Apollo isn't the only one with a GraphQL client library
Fact: Apollo isn't the only path to creating a GraphQL server
As matters of fact, these are either true or false, but readers are free to evaluate which they are on their own. They shouldn't trust me, because I'm a stranger on the Internet. But then again so are you and so are most or all people here.
You say that if I don't disclose who I work for people will trust me less. That's silly, because people here shouldn't trust me at all, nor should they trust you, or anyone else, for the reasons I just gave.
In short: don't accept without careful scrutiny anything you read on the Internet, no matter who says it.
In any case, your requirement can be satisfied by SQL views, which transform the persisted model (tables), and which are 'below' the GraphQL server.
> Say you have a web app, an iOS app and an android app
and
> let’s say the model of the data that makes sense for the purposes being the UI for these apps is different from the model that’s used to persist data
Question: If we stipulate that the UI models are different from the persistent model, are the UI models are different from each other or are they they same? What I mean is this. Do the web app, iOS app, and android app models differ from each other? This is important for my reasoning that follows.