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(6mo ago)2141MITPHPPHP ^8.2

Since Oct 29Pushed 6mo 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 1mo ago

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

37

—

LowBetter than 82% of packages

Maintenance72

Regular maintenance activity

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

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

191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe6c27a2d5150e5987aba932dd2295e98799bd0786d7819d751838bcdcb73c22?d=identicon)[gumphp](/maintainers/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

[watson/validating

Eloquent model validating trait.

9723.3M46](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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