PHPackages                             ankane/seaduck - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ankane/seaduck

ActiveLibrary[Database &amp; ORM](/categories/database)

ankane/seaduck
==============

Apache Iceberg for PHP, powered by libduckdb

v0.1.1(1mo ago)112MITPHPPHP &gt;= 8.3CI failing

Since Nov 9Pushed 5mo agoCompare

[ Source](https://github.com/ankane/seaduck-php)[ Packagist](https://packagist.org/packages/ankane/seaduck)[ RSS](/packages/ankane-seaduck/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

SeaDuck PHP
===========

[](#seaduck-php)

[Apache Iceberg](https://iceberg.apache.org/) for PHP, powered by libduckdb

[![Build Status](https://github.com/ankane/seaduck-php/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/seaduck-php/actions)

Installation
------------

[](#installation)

Run:

```
composer require ankane/seaduck
```

Add scripts to `composer.json` to download the shared library:

```
    "scripts": {
        "post-install-cmd": "SeaDuck\\Library::check",
        "post-update-cmd": "SeaDuck\\Library::check"
    }
```

And run:

```
composer install
```

Getting Started
---------------

[](#getting-started)

Create a client for an Iceberg catalog

```
use SeaDuck\S3TablesCatalog;

$catalog = new S3TablesCatalog(arn: 'arn:aws:s3tables:...');
```

Note: SeaDuck requires a default namespace, which is `main` by default. This namespace is created if it does not exist. Pass `defaultNamespace` to use a different one.

Create a table

```
$catalog->sql('CREATE TABLE events (id bigint, name text)');
```

Load data from a file

```
$catalog->sql("COPY events FROM 'data.csv'");
```

You can also load data directly from other [data sources](https://duckdb.org/docs/stable/data/data_sources)

```
$catalog->attach('blog', 'postgres://localhost:5432/blog');
$catalog->sql('INSERT INTO events SELECT * FROM blog.events');
```

Query the data

```
$catalog->sql('SELECT COUNT(*) FROM events')->toArray();
```

Namespaces
----------

[](#namespaces)

List namespaces

```
$catalog->listNamespaces();
```

Create a namespace

```
$catalog->createNamespace('main');
```

Check if a namespace exists

```
$catalog->namespaceExists('main');
```

Drop a namespace

```
$catalog->dropNamespace('main');
```

Tables
------

[](#tables)

List tables

```
$catalog->listTables();
```

Check if a table exists

```
$catalog->tableExists('events');
```

Drop a table

```
$catalog->dropTable('events');
```

Snapshots
---------

[](#snapshots)

Get snapshots for a table

```
$catalog->snapshots('events');
```

Query the data at a specific snapshot version or time

```
$catalog->sql('SELECT * FROM events AT (VERSION => ?)', [3]);
// or
$catalog->sql('SELECT * FROM events AT (TIMESTAMP => ?)', [new DateTime()]);
```

SQL Safety
----------

[](#sql-safety)

Use parameterized queries when possible

```
$catalog->sql('SELECT * FROM events WHERE id = ?', [1]);
```

For places that do not support parameters, use `quote` or `quoteIdentifier`

```
$quotedTable = $catalog->quoteIdentifier('events');
$quotedFile = $catalog->quote('path/to/data.csv');
$catalog->sql("COPY $quotedTable FROM $quotedFile");
```

History
-------

[](#history)

View the [changelog](https://github.com/ankane/seaduck-php/blob/master/CHANGELOG.md)

Contributing
------------

[](#contributing)

Everyone is encouraged to help improve this project. Here are a few ways you can help:

- [Report bugs](https://github.com/ankane/seaduck-php/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/seaduck-php/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features

To get started with development:

```
git clone https://github.com/ankane/seaduck-php.git
cd seaduck
composer install

# REST catalog
docker compose up
CATALOG=rest composer test

# S3 Tables catalog
CATALOG=s3tables composer test

# Glue catalog
CATALOG=glue composer test
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance80

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~146 days

Total

2

Last Release

44d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/220358?v=4)[Andrew Kane](/maintainers/ankane)[@ankane](https://github.com/ankane)

---

Top Contributors

[![ankane](https://avatars.githubusercontent.com/u/220358?v=4)](https://github.com/ankane "ankane (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ankane-seaduck/health.svg)

```
[![Health](https://phpackages.com/badges/ankane-seaduck/health.svg)](https://phpackages.com/packages/ankane-seaduck)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
