Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sa46
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
241.
▲
by
sa46
5y ago
Not a rust aficionado: If you’re using error.As, wouldn’t you need essentially the same logic in Rust to match the error type and get access to the right fields? Seems like the big difference is the compiler knows the variants of the error.
242.
▲
by
sa46
5y ago
Could Postgres convert the function into a DFA using the JIT optimizer (based on LLVM)? That might delve into sufficiently smart compiler territory but recognizing a bunch of OR'ed string matches seems on the easier end of optimization
243.
▲
by
sa46
5y ago
You'll hit all sorts of other fun problems by vertically scaling. - Many concurrent connections to a single database which Postgres has traditionally not handled well (though improved in recent versions). - You're now on the hook
244.
▲
by
sa46
5y ago
It's not an uncommon pattern: https://github.com/postgres/postgres/blob/master/src/backend...
245.
▲
by
sa46
5y ago
They're a really bad idea, so much so that's it's the first item in Effective Java: > Consider static factory methods instead of constructors The reasons outlined in Effective Java include: - Unlike constructors, static fa
246.
▲
by
sa46
5y ago
I'm pretty comfortable declaring that creating a mutable-by-default date, string, or number library is a mistake. I'm not on the make-all-the-things-immutable train but making dates mutable is a painful mistake that Java painfully
247.
▲
by
sa46
5y ago
One thing I’m pursuing with pggen is serializing DB query results directly to a proto. It’d be super cool to write a sql query and have it spit out a proto and avoid all the boilerplate struct copying.
248.
▲
by
sa46
5y ago
I uploaded most of our Workspace setup here: https://github.com/jschaf/bazel-postgres-sketch . The tooling is a bunch of Go to manage the Postgres process. Basically, give it schema files and receive a running database
249.
▲
by
sa46
5y ago
Oh hey! Apologies, not trying to throw shade. Last time I used sqlc was a while ago and I ran it in docker.
250.
▲
by
sa46
5y ago
Yep, that’s the main downside. pggen works out of the box with Docker under the hood if you give it some schema files. Notably, the recommended way to run sqlc also requires Docker. I check in the generated code so I only run pggen at dev t
251.
▲
by
sa46
5y ago
I agree whole-heartedly that writing SQL feels right. Broadly speaking, you can take the following approaches to mapping database queries to Go code: - Write SQL queries, parse the SQL, generate Go from the queries (sqlc, pggen). - Write SQ
252.
▲
by
sa46
5y ago
I was curious about the specific type of munition. It was for smokeless gunpowder: > unquenchable thirst for the industrial alcohol needed to produce cordite—a smokeless gunpowder used in ammunition and artillery shells https:/
253.
▲
by
sa46
5y ago
SimpleCircle | Founding Engineer | San Francisco | Full-time Join us as a founding engineer at our five-person, fully funded startup. We’re looking for a senior engineer well-versed with the intricacies of building rich, data-backed applica
254.
▲
by
sa46
5y ago
I ended up skipping static compilation for the reasons you outlined (not necessary). I packaged everything up in a directory and used LD_LIBRARY_PATH. I linked to a sketch on GitHub in a sibling comment.
255.
▲
by
sa46
5y ago
Sure, here's sketch of how it works: https://github.com/jschaf/bazel-postgres-sketch
256.
▲
by
sa46
5y ago
It's possible but tediuos to run Postgres standalone. I packaged Postgres up for our Bazel build which requires a hermetic environment. The hard parts were: 1. Postgres doesn't really didn't want to be statically compiled, ac
257.
▲
by
sa46
5y ago
There's a lot wrong with SQL. Chris Date [1] wrote several books comparing SQL to a more pure implementation relational algebra, Tutorial D. In Date's words: > SQL is incapable of providing the kind of firm foundation we need f
258.
▲
by
sa46
5y ago
It's really not. Coffeescript might be nice with fresh development and a small codebase but it's really bad when you're trying to figure out someone else's code.
259.
▲
by
sa46
5y ago
This is great until you have a tenant too large for a single shard. It’s pretty difficult to perfectly shard relational data. At some point you’ll run into a need for cross shards queries. I think for most workloads, this approach should wo
260.
▲
by
sa46
5y ago
The really fun part of having docs in confluence is that if Confluence goes down, you lose access to ops playbooks. I’ve had similar fun experience with Slack-ops when slack goes down.
261.
▲
by
sa46
5y ago
I really like the sound of this. That’s how Google’s internal technical docs worked. Write markdown in src repo, get nice, searchable doc site in return. Anyone know if a tool like that already exists to turn README.md files into a website?
262.
▲
by
sa46
5y ago
I wrote a similar tool for Go and Postgres but it also generates the serialization code. [1] - I prefer generating code from queries instead of generating active record style models based on tables. - I think it’s worth it to spin up Postg
263.
▲
by
sa46
5y ago
An earlier submission has a lively debate between these two approaches. https://news.ycombinator.com/item?id=12120752
264.
▲
by
sa46
5y ago
Another common slow down is bind mounts. Each file system operation is an RPC request between Docker for Mac and the Linux VM. I’ve never been super happy with Docker for Mac. I did a pretty deep dive into figuring out why it’s so slow with
265.
▲
by
sa46
5y ago
With something like service_binary, how do you wire up services? For example, If main.cc depended on Redis, how would you get the host and port of the Redis dependency from main.cc?
266.
▲
by
sa46
5y ago
You generally have more than one database connection per thread. As an example, consider Node.js which acts like a single threaded process. You’d probably want to be able to handle more than 1 database query concurrently since network lat
267.
▲
by
sa46
5y ago
When a client connects to Postgres, Postgres creates a new process just for that client. Separate processes are great for isolation but it means Postgres connections are a bit expensive (this is an active area of improvement). Postgres real
268.
▲
by
sa46
5y ago
I’d characterize JS as having moderately annoying numeric limitations rather than serious problems. Two that come mind: Not having 64 bit integers is a large annoyance. There’s workarounds but none of them are especially ergonomic. The expr
269.
▲
by
sa46
5y ago
It’s a common heuristic for inspections. It’s not efficient or possible to check everything, so you inspect a few pieces in minute detail. For the pieces that fail, you do a complete inspection. In my experience it’s a pretty good heuristic
270.
▲
by
sa46
5y ago
Heh, I uses a similar keybinding, "jk", for escape that I can't get out of muscle memory. Works well enough in vanilla Vim and Emacs, but causes much pain in other Vim bindings, namely IntelliJ. Even if you do get it to work,
More ›