Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Show HN: Convo Caddy – Hermes powered interview companion
    discuss
  2. DropSlim – Local and open-source image compressor built with Rust and Tauri(github.com/onza ↗)
    discuss
  3. Leave the Class Path in the Rearview Mirror(netflixtechblog.com ↗)
    1comments
  4. AI containment is a systems engineering problem(knaup.me ↗)
    discuss
  5. Some of All Fears(sharptext.net ↗)
    discuss
  6. You cry "AI generated" because you can't debunk the actual technical facts(medium.com/istokovicsgyorgy79 ↗)
    discuss
  7. Alea iacta non est: rerolling the LLM dice(rolisz.ro ↗)
    discuss
  8. Arrow heads at Obi-Rakhmat (Uzbekistan) 80K years ago?(plos.org ↗)
    discuss
  9. Testing whether a real fly connectome's wiring matters, using crypto as stimulus(github.com/mayombe67 ↗)
    discuss
  10. Ephemerals.dev – Disposable cloud dev environments(ephemerals.dev ↗)
    discuss
  11. The Headword(wiktionary.org ↗)
    discuss
  12. Lilo 0.2.2 – a Rust/egui Markdown notes app with widget and workspace modes(github.com/hellterenjoy ↗)
    discuss
  13. Court shines a further light on who was at fault in SVB implosion(ft.com ↗)
    discuss
  14. The Lamentable Later Life of Lemmings(filfre.net ↗)
    discuss
  15. Jev VC – Pitch Jev Your Startup(pitchjev.vercel.app ↗)
    1comments
  16. US Treasuries Have Become Unappetizing for Foreign Central Banks and Governments(wolfstreet.com ↗)
    1comments
  17. A systemd timer to log and lock kids out of their Linux accounts overnight(github.com/mowglixx ↗)
    discuss
  18. Knot: A CLI ticket tracker for solo developers(github.com/unisoma ↗)
    discuss
  19. How to run offline, local coding agents on Linux(ostechnix.com ↗)
    discuss
  20. From 2027 you must be at least 18 to use Dropbox(dropbox.com ↗)
    2comments
  21. Salesforce tracing without debug logs: every trigger, field write, and rollback(fidelic.dev ↗)
    discuss
  22. Awesome-tunneling – List of ngrok, Cloudflare Tunnel, Tailscale and related(github.com/anderspitman ↗)
    discuss
  23. Black Holes or Black Hole Stars? Astronomers Spar over 'Little Red Dots'(quantamagazine.org ↗)
    discuss
  24. System Design Unboxed: new eBook and extras(lextrem.com ↗)
    discuss
  25. Terrasat – Get Answers from Anywhere on Earth(terrasat.net ↗)
    1comments
  26. The Physics of Database Speed: from 300 to 1M transactions per second [video](youtube.com ↗)
    discuss
  27. How to Build a Scraping Tool(flaviocopes.com ↗)
    discuss
  28. Inexpressible States: The History and Usage of Algebraic Data Types(makonea.com ↗)
    discuss
  29. FlashAttention: Part 2(chizkidd.github.io ↗)
    discuss
  30. Fable 5.1 vs. Astra for coding: Fable 2X more expensive per task but solves more(imec-int.com ↗)
    3comments

Show HN: pg_raw_parse - parse PgSQL in Rust

1 pointsby 59m agogithub.com
0 comments
Hey HN!

We built a wrapper on top of the Postgres native SQL parser to allow us to parse and manipulate SQL in Rust.

Our library forks libpg_query [1] and its original Rust bindings, pg_query.rs [2]. By not using Protobuf and mapping our structs directly on top of the Postgres arena allocator, we are able to achieve a pretty massive speedup:

- 20-60x parse/deparse, depending on query size

- 90% memory utilization decrease vs pg_query.rs

This library is used in production in PgDog [3], but has no dependencies to it, so you can use it in your Rust apps without issues.

It also provides access to Postgres internals used to walk and transform query ASTs. Those are actually really cool. Check out the README for details, but we basically use a bunch of Rust macros to generate 100% compatible Rust structs directly from C headers.

This makes it really easy to upgrade major versions, i.e., we just bump the submodules and re-compile.

Let us know what you think!

- PgDog team

[1]: https://github.com/pganalyze/libpg_query

[2]: https://github.com/pganalyze/pg_query.rs

[3]: https://github.com/pgdogdev/pgdog

A quiet thread, for now.Start the conversation on HN ↗