<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Postgresql on Marcello Barnaba</title>
    <link>https://sindro.me/tags/postgresql/</link>
    <description>Recent content in Postgresql on Marcello Barnaba</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 06 Apr 2019 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sindro.me/tags/postgresql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ChronoModel 1.0: Seven Years to Ship</title>
      <link>https://sindro.me/posts/2019-04-06-chronomodel-one-dot-zero/</link>
      <pubDate>Sat, 06 Apr 2019 00:00:00 +0000</pubDate>
      <guid>https://sindro.me/posts/2019-04-06-chronomodel-one-dot-zero/</guid>
      <description>&lt;div class=&#34;retrospective&#34;&gt;&#xA;  &lt;span class=&#34;retrospective-icon&#34;&gt;&amp;#x1f50d;&lt;/span&gt;&#xA;  &lt;div class=&#34;retrospective-body&#34;&gt;&#xA;    &lt;em&gt;2026 retrospective&lt;/em&gt;&lt;br&gt;&#xA;    My last release was &lt;a href=&#34;https://rubygems.org/gems/chrono_model/versions/1.2.2&#34; target=&#34;_blank&#34;&gt;v1.2.2&lt;/a&gt; in May 2019. After that, &lt;a href=&#34;https://github.com/tagliala&#34; target=&#34;_blank&#34;&gt;Geremia Taglialatela&lt;/a&gt; took over and pushed it to &lt;a href=&#34;https://rubygems.org/gems/chrono_model/versions/5.0.0&#34; target=&#34;_blank&#34;&gt;v5.0.0&lt;/a&gt; with Rails 8.1 and Ruby 4.0 support. &lt;a href=&#34;https://rubygems.org/gems/chrono_model/versions&#34; target=&#34;_blank&#34;&gt;34 releases&lt;/a&gt; spanning 14 years, &lt;a href=&#34;https://github.com/ifad/chronomodel/stargazers&#34; target=&#34;_blank&#34;&gt;201 stars&lt;/a&gt;, and still actively maintained. The &lt;a href=&#34;https://vjt.github.io/chronomodel/&#34; target=&#34;_blank&#34;&gt;API documentation&lt;/a&gt; and the &lt;a href=&#34;https://github.com/ifad/chronomodel&#34; target=&#34;_blank&#34;&gt;repo&lt;/a&gt; are both alive.&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;Seven years ago I &lt;a href=&#34;https://sindro.me/posts/2012-05-07-chronomodel-time-travel-postgresql/&#34;&gt;released ChronoModel v0.1.0&lt;/a&gt; — a Ruby gem that gives ActiveRecord models temporal capabilities on PostgreSQL. Five days of hacking, thirty-six commits, no tests, and a confession about monkey-patching the PostgreSQL adapter constant.&lt;/p&gt;&#xA;&lt;p&gt;Today I&amp;rsquo;m tagging &lt;a href=&#34;https://github.com/ifad/chronomodel/commit/aa07e74&#34; target=&#34;_blank&#34;&gt;v1.0.0&lt;/a&gt;. The commit message is &lt;code&gt;:gem: this is v1.0.0&lt;/code&gt;. Not much of a speech, but the code speaks for itself: 506 commits, 31 releases, 52 files changed, 5,392 lines added. The &lt;a href=&#34;https://sindro.me/posts/2012-05-07-chronomodel-time-travel-postgresql/#the-architecture&#34;&gt;core idea&lt;/a&gt; — updatable views on &lt;code&gt;public&lt;/code&gt;, current data on &lt;code&gt;temporal&lt;/code&gt;, history on &lt;code&gt;history&lt;/code&gt; with table inheritance — never changed. Everything else did.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Eaco: The Holder of the Keys of Hades</title>
      <link>https://sindro.me/posts/2015-02-28-eaco-authorization-ruby/</link>
      <pubDate>Sat, 28 Feb 2015 00:00:00 +0000</pubDate>
      <guid>https://sindro.me/posts/2015-02-28-eaco-authorization-ruby/</guid>
      <description>&lt;div class=&#34;retrospective&#34;&gt;&#xA;  &lt;span class=&#34;retrospective-icon&#34;&gt;&amp;#x1f50d;&lt;/span&gt;&#xA;  &lt;div class=&#34;retrospective-body&#34;&gt;&#xA;    &lt;em&gt;2026 retrospective&lt;/em&gt;&lt;br&gt;&#xA;    Eaco reached &lt;a href=&#34;https://github.com/ifad/eaco/tree/v1.0.0&#34; target=&#34;_blank&#34;&gt;v1.0.0&lt;/a&gt; on May 5, 2016 — commit message: &amp;ldquo;This is v1.0.0. Two years in production.&amp;rdquo; It grew to 54 stars, 8 forks, 240 commits, and ran authorization at IFAD for five more years after that. &lt;a href=&#34;https://github.com/tagliala&#34; target=&#34;_blank&#34;&gt;Geremia Taglialatela&lt;/a&gt; picked it up in 2020 and kept it running on Rails 6.0 and 6.1, then &lt;a href=&#34;https://github.com/ifad/eaco/commit/19&#34; target=&#34;_blank&#34;&gt;modernized the CI&lt;/a&gt; in late 2025. The ABAC-with-hash-ACLs pattern turned out to be exactly right for an organization where access is determined by position, department, and working group — not just &amp;ldquo;admin or not.&amp;rdquo; The &lt;a href=&#34;https://github.com/ifad/eaco&#34; target=&#34;_blank&#34;&gt;repo&lt;/a&gt; is still online, and the &lt;a href=&#34;https://vjt.github.io/eaco/&#34; target=&#34;_blank&#34;&gt;YARD documentation&lt;/a&gt; is still some of the most thorough I&amp;rsquo;ve ever written for a gem.&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/ifad/scriptoria&#34; target=&#34;_blank&#34;&gt;Scriptoria&lt;/a&gt; is an internal workflow application at &lt;a href=&#34;http://www.ifad.org/&#34; target=&#34;_blank&#34;&gt;IFAD&lt;/a&gt; — a UN specialized agency in Rome — and its authorization layer has been annoying me for months. The code works, but it&amp;rsquo;s tangled into the app. Every time we need to add a new role or change who can access what, we&amp;rsquo;re editing application code that shouldn&amp;rsquo;t care about authorization semantics.&lt;/p&gt;&#xA;&lt;p&gt;So eight days ago I started extracting it. Today I&amp;rsquo;m releasing the result: &lt;a href=&#34;https://github.com/ifad/eaco&#34; target=&#34;_blank&#34;&gt;Eaco&lt;/a&gt; — an Attribute-Based Access Control framework for Ruby, named after &lt;a href=&#34;http://en.wikipedia.org/wiki/Aeacus&#34; target=&#34;_blank&#34;&gt;Eacus&lt;/a&gt;, the holder of the keys of Hades in Greek mythology.&lt;/p&gt;&#xA;&lt;p&gt;172 commits. Five releases. 100% test coverage. And a Saturday afternoon I&amp;rsquo;ll never get back.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ChronoModel: Time Travel for PostgreSQL</title>
      <link>https://sindro.me/posts/2012-05-07-chronomodel-time-travel-postgresql/</link>
      <pubDate>Mon, 07 May 2012 00:00:00 +0000</pubDate>
      <guid>https://sindro.me/posts/2012-05-07-chronomodel-time-travel-postgresql/</guid>
      <description>&lt;div class=&#34;retrospective&#34;&gt;&#xA;  &lt;span class=&#34;retrospective-icon&#34;&gt;&amp;#x1f50d;&lt;/span&gt;&#xA;  &lt;div class=&#34;retrospective-body&#34;&gt;&#xA;    &lt;em&gt;2026 retrospective&lt;/em&gt;&lt;br&gt;&#xA;    ChronoModel is still alive — 14 years, 41 releases, 201 stars. The rules got replaced by INSTEAD OF triggers in &lt;a href=&#34;https://github.com/ifad/chronomodel/tree/v0.6.0&#34; target=&#34;_blank&#34;&gt;v0.6&lt;/a&gt; (2014), the &lt;code&gt;box()&lt;/code&gt;/&lt;code&gt;point()&lt;/code&gt; hack by proper &lt;code&gt;tsrange&lt;/code&gt; columns, and the monkey-patching by a proper adapter registration. &lt;a href=&#34;https://github.com/tagliala&#34; target=&#34;_blank&#34;&gt;Geremia Taglialatela&lt;/a&gt; took over maintenance in 2020 and pushed it to &lt;a href=&#34;https://rubygems.org/gems/chrono_model/versions/5.0.0&#34; target=&#34;_blank&#34;&gt;v5.0.0&lt;/a&gt; with Rails 8.1 and Ruby 4.0 support. The core idea — updatable views on &lt;code&gt;public&lt;/code&gt;, current data on &lt;code&gt;temporal&lt;/code&gt;, history on &lt;code&gt;history&lt;/code&gt; with table inheritance — never changed. The &lt;a href=&#34;https://github.com/ifad/chronomodel&#34; target=&#34;_blank&#34;&gt;repo&lt;/a&gt; is healthy and actively maintained.&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;We&amp;rsquo;re building a CRM at &lt;a href=&#34;http://www.ifad.org/&#34; target=&#34;_blank&#34;&gt;IFAD&lt;/a&gt; — a UN specialized agency in Rome — and one of the hard requirements is temporal data. We need to know what a record looked like at any point in the past. What was this project&amp;rsquo;s budget on March 15th? When did this beneficiary&amp;rsquo;s address change? Who approved what, and what did the record look like at the time?&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;d been prototyping a PostgreSQL schema approach for this — views, rules, table inheritance — and it worked. Then &lt;a href=&#34;https://github.com/amedeo&#34; target=&#34;_blank&#34;&gt;Amedeo&lt;/a&gt;, my boss, looked at it and said: &amp;ldquo;This shouldn&amp;rsquo;t live inside the CRM. Make it a reusable framework.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;He was right. The temporal pattern has nothing to do with CRM logic. It belongs in a gem.&lt;/p&gt;&#xA;&lt;p&gt;So I had five days of uninterrupted focus, and today I&amp;rsquo;m releasing &lt;a href=&#34;https://github.com/ifad/chronomodel&#34; target=&#34;_blank&#34;&gt;ChronoModel&lt;/a&gt; — an ActiveRecord extension that gives your models full temporal capabilities on PostgreSQL. What Oracle sells as &lt;a href=&#34;http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm&#34; target=&#34;_blank&#34;&gt;Flashback Queries&lt;/a&gt; and charges enterprise money for, we can do with standard SQL on Postgres 9.0+.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
