<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dalmas Ogembo</title>
    <description>The latest articles on DEV Community by Dalmas Ogembo (@dalmasonto).</description>
    <link>https://dev.to/dalmasonto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4068757%2Fd392bbaf-3ab9-4d68-a8f2-ab778fda5f2a.jpg</url>
      <title>DEV Community: Dalmas Ogembo</title>
      <link>https://dev.to/dalmasonto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dalmasonto"/>
    <language>en</language>
    <item>
      <title>umbral - declare your data in Rust, get migrations, an admin, and a REST API for free</title>
      <dc:creator>Dalmas Ogembo</dc:creator>
      <pubDate>Sat, 08 Aug 2026 13:51:38 +0000</pubDate>
      <link>https://dev.to/dalmasonto/umbral-declare-your-data-in-rust-get-migrations-an-admin-and-a-rest-api-for-free-43oh</link>
      <guid>https://dev.to/dalmasonto/umbral-declare-your-data-in-rust-get-migrations-an-admin-and-a-rest-api-for-free-43oh</guid>
      <description>&lt;p&gt;The reason Django, Rails, and Laravel made people productive was never the language. It was the deal they offered: declare your data once, and the framework hands you migrations, CRUD, an admin UI, and an API, without you writing any of that by hand.&lt;/p&gt;

&lt;p&gt;Rust has all the raw materials for that deal. tokio for the async runtime, axum for routing, sqlx for the database, sea-query for SQL, tower for middleware. What it has been missing is the wiring that turns those into "declare a model and get everything." That wiring is what I am building, and it is called umbral.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pitch in one struct
&lt;/h2&gt;

&lt;p&gt;Here is a real model from the example shop app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;umbral&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;prelude&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;#[derive(Debug,&lt;/span&gt; &lt;span class="nd"&gt;Clone,&lt;/span&gt; &lt;span class="nd"&gt;sqlx::FromRow,&lt;/span&gt; &lt;span class="nd"&gt;Serialize,&lt;/span&gt; &lt;span class="nd"&gt;Deserialize,&lt;/span&gt; &lt;span class="nd"&gt;Model)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Brand&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;i64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nd"&gt;#[umbral(unique,&lt;/span&gt; &lt;span class="nd"&gt;string)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nd"&gt;#[umbral(unique)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;logo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Option&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;website&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Option&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Option&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one declaration is the single source of truth. From it, umbral gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A database table and an autodetected, reversible migration. You run &lt;code&gt;cargo run -- makemigrations&lt;/code&gt;, then &lt;code&gt;cargo run -- migrate&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A typed ORM. &lt;code&gt;Brand::objects().filter(...).first().await?&lt;/code&gt; is checked at compile time, and &lt;code&gt;Option&amp;lt;String&amp;gt;&lt;/code&gt; is exactly the nullable column, with no nulls sneaking past the type system.&lt;/li&gt;
&lt;li&gt;A JSON REST endpoint, if you install the REST plugin. Query-string filtering comes with it.&lt;/li&gt;
&lt;li&gt;A row in the admin UI at &lt;code&gt;/admin/&lt;/code&gt;, with create, edit, and delete.&lt;/li&gt;
&lt;li&gt;An OpenAPI document and Swagger UI at &lt;code&gt;/openapi/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Relations are types, not string joins. On the richer &lt;code&gt;Product&lt;/code&gt; model those look like &lt;code&gt;pub category: ForeignKey&amp;lt;Category&amp;gt;&lt;/code&gt; and &lt;code&gt;pub brand: Option&amp;lt;ForeignKey&amp;lt;Brand&amp;gt;&amp;gt;&lt;/code&gt;. Field behavior is attributes you can read at a glance: &lt;code&gt;#[umbral(unique)]&lt;/code&gt;, &lt;code&gt;#[umbral(choices)]&lt;/code&gt; on an enum, &lt;code&gt;#[umbral(default = "0")]&lt;/code&gt;, &lt;code&gt;#[umbral(auto_now_add)]&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The everyday loop is the product
&lt;/h2&gt;

&lt;p&gt;The thing I care about most is the change loop, because that is where a lot of ORMs quietly fall apart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;declare -&amp;gt; migrate -&amp;gt; change -&amp;gt; migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You declare or change a model. umbral diffs it against the last migration snapshot and writes an ordered, reversible migration: create table, add column, alter column, drop. &lt;code&gt;migrate&lt;/code&gt; applies what is pending. If you already have a Postgres database, &lt;code&gt;inspectdb&lt;/code&gt; introspects it into models plus an initial migration, so an existing schema drops straight into the same loop.&lt;/p&gt;

&lt;p&gt;Existing rows are treated as the test, not an obstacle. A UNIQUE you add trips on real duplicates. A new NOT NULL asks for a default. That friction is the point: it shows up in development instead of in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every capability is a plugin. Including auth.
&lt;/h2&gt;

&lt;p&gt;This is the architectural bet that keeps the framework honest. Auth, sessions, admin, tasks, and REST are all plugins. Structurally they are identical to a third-party plugin. A plugin can contribute models (which become migrations), routes, middleware, admin registrations, settings, and lifecycle hooks. The core defines the &lt;code&gt;Plugin&lt;/code&gt; trait and never names a concrete plugin.&lt;/p&gt;

&lt;p&gt;The proof is a rule the codebase enforces: an app that does not use REST compiles with zero serializer code. If a built-in cannot be expressed as a plugin, the plugin contract is wrong. Cargo's ban on circular dependencies is what enforces "serializers are a plugin," because &lt;code&gt;umbral-core&lt;/code&gt; is not allowed to depend on the REST crate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secure and typed by default
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SQL is always parameterized.&lt;/li&gt;
&lt;li&gt;CSRF, secure cookies, and HTML autoescaping are on by default.&lt;/li&gt;
&lt;li&gt;Backend mismatches fail at boot, not in production. A Postgres-only field on SQLite is a clear startup error.&lt;/li&gt;
&lt;li&gt;Errors are &lt;code&gt;Result&lt;/code&gt; values, with &lt;code&gt;?&lt;/code&gt; flowing through a framework error enum.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;umbral-cli
umbral startproject myapp
&lt;span class="nb"&gt;cd &lt;/span&gt;myapp
cargo run &lt;span class="nt"&gt;--&lt;/span&gt; serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The generated app already serves a page at &lt;code&gt;/&lt;/code&gt;, JSON CRUD at &lt;code&gt;/api/post/&lt;/code&gt;, the admin at &lt;code&gt;/admin/&lt;/code&gt;, and Swagger at &lt;code&gt;/openapi/&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples and real-world use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A full runnable example lives in the repo: &lt;a href="https://github.com/dalmasonto/umbral/tree/main/examples/shop" rel="noopener noreferrer"&gt;examples/shop&lt;/a&gt;, an e-commerce app that exercises models, relations, the admin, and REST.&lt;/li&gt;
&lt;li&gt;The project site itself, &lt;a href="https://umbralrs.dev" rel="noopener noreferrer"&gt;umbralrs.dev&lt;/a&gt;, is built with Umbral.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pipeline.supercodehive.com/" rel="noopener noreferrer"&gt;pipeline.supercodehive.com&lt;/a&gt; is a live site built on Umbral. It captures streamed price values from Chainlink for Polymarket, so you can follow the opening and closing prices of different crypto market types.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Honest status
&lt;/h2&gt;

&lt;p&gt;umbral is early and alpha. It is published on crates.io under the &lt;code&gt;umbral-*&lt;/code&gt; namespace, so start with the &lt;code&gt;umbral&lt;/code&gt; facade. APIs will still move before 1.0. Postgres is the first-class production backend, and SQLite is for tests. It stands on tokio, axum, sqlx, sea-query, and tower rather than reimplementing the async runtime, HTTP, SQL, or JSON.&lt;/p&gt;

&lt;p&gt;If "declare your data and get everything" in a compile-checked language sounds like something you have wanted in Rust, I would love your eyes on it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/dalmasonto/umbral" rel="noopener noreferrer"&gt;https://github.com/dalmasonto/umbral&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://dalmasonto.github.io/umbral/" rel="noopener noreferrer"&gt;https://dalmasonto.github.io/umbral/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Site: &lt;a href="https://umbralrs.dev" rel="noopener noreferrer"&gt;https://umbralrs.dev&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A star on the repo genuinely helps, and a "this broke for me" issue helps even more.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: this post was co-authored with an AI assistant (Claude) and reviewed by Dalmasonto for correctness and usability. The framework, the examples, and the direction are the author's.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
