PHPackages                             gumphp/laravel-duckdb - 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. gumphp/laravel-duckdb

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

gumphp/laravel-duckdb
=====================

A DuckDB based Eloquent model and Query builder for Laravel

v1.0.3(8mo ago)3141MITPHPPHP ^8.2

Since Oct 29Pushed 8mo agoCompare

[ Source](https://github.com/gumphp/laravel-duckdb)[ Packagist](https://packagist.org/packages/gumphp/laravel-duckdb)[ RSS](/packages/gumphp-laravel-duckdb/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (1)

Laravel DuckDB 驱动
=================

[](#laravel-duckdb-驱动)

这是一个用于 Laravel 的 DuckDB 数据库驱动，让你可以在 Laravel 应用中像使用 MySQL 或 PostgreSQL 一样简单地使用 DuckDB。

特性
--

[](#特性)

- 支持 Laravel 数据库连接管理
- 支持查询构建器 (Query Builder)
- 支持 Schema 构建器 (Schema Builder)
- 支持 Eloquent ORM（有限支持）
- 与 Laravel 的数据库迁移系统集成

安装
--

[](#安装)

1. 安装 DuckDB PHP 扩展：
2. 安装 composer 包：

    ```
    composer require gumphp/laravel-duckdb
    ```

配置
--

[](#配置)

在 `config/database.php` 中添加 DuckDB 连接配置：

```
'duckdb' => [
    'driver' => 'duckdb',
    'database' => env('DUCKDB_DATABASE', ':memory:'),
    'prefix' => '',
    'config' => [
        'threads' => env('DUCKDB_THREADS', 4),
    ],
],
```

在 `.env` 文件中设置：

```
DUCKDB_DATABASE=/path/to/your/database.db
DUCKDB_THREADS=4
```

使用
--

[](#使用)

### 基本查询

[](#基本查询)

```
// 使用查询构建器
$users = DB::connection('duckdb')->table('users')->get();

// 插入数据
DB::connection('duckdb')->table('users')->insert([
    ['name' => 'John Doe', 'email' => 'john@example.com'],
    ['name' => 'Jane Smith', 'email' => 'jane@example.com']
]);

// 更新数据
DB::connection('duckdb')->table('users')
    ->where('name', 'John Doe')
    ->update(['email' => 'john.doe@example.com']);

// 删除数据
DB::connection('duckdb')->table('users')
    ->where('name', 'Jane Smith')
    ->delete();
```

### Schema 操作

[](#schema-操作)

```
// 创建表
Schema::connection('duckdb')->create('users', function ($table) {
    $table->string('name');
    $table->string('email');
});

// 删除表
Schema::connection('duckdb')->dropIfExists('users');
```

注意事项
----

[](#注意事项)

在生产环境中，建议将 DuckDB 数据库文件存储在持久化存储中，而不是使用内存数据库。

在 webman 中使用
------------

[](#在-webman-中使用)

许可证
---

[](#许可证)

MIT

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance61

Regular maintenance activity

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~1 days

Total

3

Last Release

246d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12705667?v=4)[gumphp](/maintainers/gumphp)[@gumphp](https://github.com/gumphp)

---

Top Contributors

[![gumphp](https://avatars.githubusercontent.com/u/12705667?v=4)](https://github.com/gumphp "gumphp (3 commits)")[![chenwencheng](https://avatars.githubusercontent.com/u/17660503?v=4)](https://github.com/chenwencheng "chenwencheng (1 commits)")

### Embed Badge

![Health badge](/badges/gumphp-laravel-duckdb/health.svg)

```
[![Health](https://phpackages.com/badges/gumphp-laravel-duckdb/health.svg)](https://phpackages.com/packages/gumphp-laravel-duckdb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)

PHPackages © 2026

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