HN Debrief

Rethinking Database Programming

  • Databases
  • Programming
  • Developer Tools
  • Open Source
  • Startups

The post introduces Acadia, a new functional language from the creator of Elm that aims to make database programming feel more like regular typed programming. It targets PostgreSQL and SQLite, compiles to SQL and backend code, and tries to unify schema-adjacent modeling, queries, row-level security, and HTTP endpoints in one system. The pitch is familiar to anyone who has used typed query builders or ORMs, but the emphasis here is stronger composition, algebraic data types, and type information flowing from database to backend to frontend.

If you run production systems, treat this less as a drop-in SQL replacement and more as an experiment in tighter frontend-backend-database integration. The practical question is not whether the syntax is nicer, but whether you are willing to bind your schema, query model, and data access to one young tool with limited escape hatches and a restrictive license.

Discussion mood

Interested but skeptical. People liked the ambition around type safety, composable queries, and tighter integration across the stack, but the dominant reaction was that SQL and the database schema should remain the source of truth, advanced engine features will break any replacement layer, and Acadia’s closed subscription model makes the adoption risk much higher than the technical upside.

Key insights

  1. 01

    SQL-first tooling is the credible compromise

    Keeping SQL as the canonical schema and query language, then deriving typed application bindings from it, was the most concrete alternative to Acadia's code-first model. Tools like Ormin and sqlc were cited as the sweet spot because they preserve access to the full database feature set while still giving compile-time query checking, type conversions, and less brittle application integration. That reframes the problem from "replace SQL" to "make SQL safer to consume from code."

    If your team wants stronger guarantees, start with SQL-parsing codegen before adopting a new database language. You will get much of the safety benefit without giving up engine features or retraining everyone on a new abstraction.

      Attribution:
    • mike_hearn #1
    • elcritch #1
    • bbkane #1
    • adzm #1
  2. 02

    The database usually outlives the app

    Several experienced builders pushed the same framing from different angles: application code gets rewritten, but production databases and their accumulated data often survive for years. That makes code-owned schemas and custom encodings feel backwards. Once the data layer is subordinate to one language or framework, every future rewrite inherits that dependency. Comments from someone with decades of work on database language interfaces were especially blunt that ORMs and replacement languages create a second hard problem instead of solving the first.

    Design your persistence layer as if another team and another stack will need to use it later. Favor representations and workflows that remain legible outside the current application framework.

      Attribution:
    • dwohnitmok #1
    • dboreham #1
    • geophile #1 #2
  3. 03

    End-to-end type safety is real but not unique

    The strongest pro-Acadia argument was type information flowing across database, backend, and frontend boundaries. The pushback was that this is an architectural choice, not a property only a new query language can deliver. One comment noted you can keep raw SQL and still generate types from query descriptions to get the same chain of guarantees. Another argued that moving logic out of the database also drops built-in guarantees around constraints, transactions, and time handling that a type system does not replace.

    When someone sells end-to-end type safety, ask exactly which classes of failure disappear and which database guarantees are being traded away. You may be able to get the typed interface you want without relocating core logic out of the database.

      Attribution:
    • alpinisme #1
    • victorbjorklund #1
    • groundzeros2015 #1
    • rzmmm #1
  4. 04

    Row level security could be the standout feature

    The most compelling new capability mentioned was first-class enforced row level security. The argument is not that typed queries are novel, but that security rules embedded in the programming model could make access control harder to bypass accidentally. That is a sharper differentiator than syntax improvements or ADT support because it targets a real source of production failures.

    If Acadia is worth tracking, watch whether it can make authorization rules auditable and hard to circumvent. Security guarantees that survive refactors are a much stronger reason to adopt a new data layer than cleaner query syntax.

      Attribution:
    • gampleman #1
  5. 05

    The thread defended relational ideas more than SQL

    A useful distinction emerged between the relational model and SQL the language. People were willing to praise relational algebra, normalization, and the staying power of relational systems while still calling SQL clumsy, non-composable, and full of historical baggage like bags and nulls. That matters because it separates two often-confused claims. You can believe the database engine is right and still think the programmer interface on top of it needs replacement.

    When evaluating database tools, separate criticism of SQL syntax and ergonomics from criticism of relational databases themselves. A better interface should preserve the strengths of relational systems rather than pretending the whole stack needs replacing.

      Attribution:
    • CopyOnWrite #1
    • cmrdporcupine #1
    • senderista #1
    • tome #1
  6. 06

    Even mature ORMs miss basic engine features

    A concrete complaint about Django not handling PostgreSQL schemas cleanly without search_path hacks showed how shallow many abstractions remain once you leave default settings. This was a practical reminder that the problem is not only exotic features like partitioning or compression. Even ordinary multi-schema setups can force developers back into engine-specific configuration and SQL knowledge.

    Before adopting any abstraction, test it against the boring database features your production setup actually uses. Multi-schema support, migrations, and engine-specific config often fail long before the advanced use cases do.

      Attribution:
    • znpy #1

Against the grain

  1. 01

    SQL itself is the bottleneck

    The pro-replacement case was that SQL's age and script-like nature cap what tools can prove ahead of time. The argument went beyond syntax complaints. It claimed cross-query static analysis, migration risk analysis, and stronger reasoning about isolation and locking are structurally hard when the interface is handwritten SQL. From that perspective, a better long-term answer looks more like an intermediate representation such as Substrait than yet another ORM.

    If your pain is less about writing queries and more about proving operational behavior, look for systems that expose richer analyzable plans rather than prettier SQL builders. That is a different problem from ORM ergonomics.

      Attribution:
    • exidex #1 #2
  2. 02

    Host language integration is worth the abstraction

    A minority pushed back on the "just learn SQL" line by saying the value of ORMs and query DSLs is not hiding SQL concepts. It is pulling database work into the same tooling, type system, refactoring support, and composition model as the rest of the application. Even fluent SQL users still have to deal with string literals, placeholders, manual result mapping, and weak editor support. In that view, the abstraction earns its keep by improving program construction, not by replacing database knowledge.

    If your team spends more time wiring queries into application code than inventing database tricks, measure the cost of integration friction directly. Better compile-time feedback and refactoring support may justify a layer even when everyone already knows SQL.

      Attribution:
    • threethirtytwo #1
    • antihero #1
    • elcritch #1
    • setr #1
  3. 03

    The closed license may fund real maintenance

    A few comments defended the commercial model on pragmatic grounds. Elm showed that admiration and adoption do not automatically finance long-term stewardship. Acadia's restrictive license may be an attempt to create a sustainable business around deep infrastructure work rather than repeating the pattern of beloved but underfunded tools. Even people unlikely to adopt it said they were curious whether the model could pay for serious language development.

    Separate two questions in vendor reviews: whether you like the license, and whether the pricing model could keep the project alive. A sustainable maintainer may still lose to lock-in concerns, but the tradeoff should be evaluated explicitly.

      Attribution:
    • happyraul #1
    • leftyspook #1
    • bbkane #1

In plain english

ADT
Algebraic Data Type, a way of modeling data with variants and combinations that is common in functional programming languages.
DDL
Data definition language, the SQL commands used to create or change database schema objects like tables and indexes.
normalization
A database design process that organizes data to reduce redundancy and improve consistency.
ORM
Object-relational mapper, a library that converts between database rows and in-memory objects, often with performance overhead.
Ormin
A Nim library that parses SQL table definitions and provides compile-time checked queries against them.
PostgreSQL
A widely used open source relational database known for reliability, standards support, and a mature ecosystem.
relational model
The mathematical model behind relational databases, where data is represented as relations and manipulated with algebraic operations.
search_path
A PostgreSQL setting that controls which database schemas are searched when object names are referenced without qualification.
SQL
Structured Query Language, the standard language used to query and modify relational databases.
sqlc
A tool that reads SQL queries and generates type-safe code in an application language to execute those queries.
SQLite
A lightweight relational database that runs from a local file and is often used for simple deployments or embedded apps.
Substrait
An open specification for representing data processing plans in a portable form that different tools and engines can exchange.

Reference links

SQL-first tools and alternatives

  • sqlc
    Example of generating typed application code from raw SQL rather than replacing SQL with a new language.
  • Ormin
    Example of a Nim tool that parses SQL tables and compile-time checks queries while keeping SQL as the source of truth.
  • Selda
    Cited as an older Haskell system with similar ideas, used to argue Acadia is not as novel as presented.
  • Substrait
    Suggested as a better long-term target for analyzable, portable database plans than another ORM or SQL replacement.

Critiques and alternative query languages

  • Against SQL
    Referenced as a broader critique of SQL's limits as a programming interface.
  • MixT
    Pointed to as an example of stronger static analysis possibilities for database work.
  • Datalevin documentation
    Shared as a Datalog-based alternative for people who want a different data querying model.

Acadia licensing and availability

Related projects and context