← All projects
Project record1 mention
Originally shared on Hacker News

Duck

A Swift library providing an application-level Swift API and DSL around DuckDB, built on the DuckDB 2.0.0 engine, for use in iOS and macOS apps. The first stable 1.0.0 release includes Codable integration, async/await, reactive queries, migrations, transactions, reusable prepared statements, connection pooling, bulk ingestion via DuckDB's Appender, native LIST/STRUCT values, and the SwiftStream/SQL DSL. It targets iOS 15+ and macOS 12+ and has also been tested on Linux.

Last shared For Swift developers building iOS and macOS apps
01 / The problem

What it addresses

The submitter wanted a client-side database solution for iOS and macOS apps bringing Postgres-style SQL power to the client, but DuckDB's official Swift client was not the application-level API he wanted, so he built his own Swift layer around it. A satisfying higher-level approach to migrations remains an open problem.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Duck

    A Swift library providing an application-level Swift API and DSL around DuckDB, built on the DuckDB 2.0.0 engine, for use in iOS and macOS apps. The first stable 1.0.0 release includes Codable integration, async/await, reactive queries, migrations, transactions, reusable prepared statements, connection pooling, bulk ingestion via DuckDB's Appender, native LIST/STRUCT values, and the SwiftStream/SQL DSL. It targets iOS 15+ and macOS 12+ and has also been tested on Linux.

    Problem: The submitter wanted a client-side database solution for iOS and macOS apps bringing Postgres-style SQL power to the client, but DuckDB's official Swift client was not the application-level API he wanted, so he built his own Swift layer around it. A satisfying higher-level approach to migrations remains an open problem.

    Audience: Swift developers building iOS and macOS apps

    Posted by @mihael · Original source ↗

    Story title · @mihael · · Source ↗

    Show HN: Duck – Making DuckDB feel like Swift

    Submitted URL · @mihael · · Source ↗

    https://github.com/swiftstream/Duck

    Source text · @mihael · · Source ↗

    SuckDB already has an official Swift client, but it wasn't the application-level API I wanted to use in my apps. So I decided to build my own Swift layer around it.

    Source text · @mihael · · Source ↗

    And here's what we have now: a beautiful, very Swiftly way of working with Duck and writing SQL

    Source text · @mihael · · Source ↗

    This is the first stable 1.0.0 release and it includes Codable integration, async/await, reactive queries, migrations, transactions, reusable prepared statements, connection pooling, bulk ingestion through DuckDB's Appender, native LIST/STRUCT values, and the SwiftStream/SQL DSL.

    Source text · @mihael · · Source ↗

    Underneath it is the real, fresh DuckDB 2.0.0 engine.

    Source text · @mihael · · Source ↗

    Right now Duck targets iOS15+ and macOS12+. I've also tested it on Linux.

    Source text · @mihael · · Source ↗

    I was looking for a new database solution for my iOS and macOS apps. The original idea was pretty simple: bring the power O love about postgres onto the client side.

    Source text · @mihael · · Source ↗

    I haven't found a silver bullet for the server-side migrations approach problem yet, so I kept migrations at the foundation level, and I'm going to experiment with one or more higher-level approaches on to of that.