r/learnrust • • 12h ago

LiteORM: A schema-first PostgreSQL ORM for Rust (with a native Desktop Studio)

4 Upvotes

Hey r/learnrust,

In Rust, using ORMs like Diesel often means writing raw SQL migrations by hand and managing complex query macros.

I built LiteORM to explore a simpler, schema-first approach:

  1. Define your models once in a declarative liteorm.schema:

​

struct User {
  id     Int32    (autoincrement())
  email  String  
  active Boolean u/default(true)
}
  1. LiteORM does the heavy lifting:
  • liteorm db push auto-diffs against PostgreSQL and runs atomic SQL migrations.
  • liteorm generate generates type-safe Rust structs and query builders.
  • liteorm studio opens a native, cross-platform desktop UI to view/edit data.
  1. Query with compile-time safety:

​

rustlet active_users = db
    .all(User::select().where_(User::ACTIVE.equals(true)).limit(10))
    .await?;

No manual SQL migrations, zero string-concatenation risk (parameterized queries via tokio-postgres), and guards against accidental table wipes on updates/deletes.

Would love any feedback on the Rust API design and architecture!


r/learnrust • • 21h ago

Built my first #![no_std] lock-free hash map in Rust to learn systems programming feedback & code review appreciated 🥀

2 Upvotes

Hey everyone I’ve been experimenting with low-level systems programming in Rust and built a tiny, #![no_std] lock-free map using atomic CAS and open addressing. First time sharing an open source systems project, I’d love to hear your thoughts or code critiques! ❤ the link https://github.com/voryiex/Titan-Cache-Engine