Download the PHP package filipefernandes/laravel-duckdb without Composer

On this page you can find all versions of the php package filipefernandes/laravel-duckdb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-duckdb

Laravel DuckDB Driver

A production-ready Laravel database driver for DuckDB, powered by satur/duckdb-auto. This package allows you to query DuckDB databases using Laravel's powerful Query Builder for analytical (OLAP) workloads.

Requirements

[!WARNING] Production Notice: Enabling FFI globally (ffi.enable=true) can have security implications. It is recommended to use ffi.enable=preload in production environments and preload the necessary scripts if possible, or strictly control access to the server.

Installation

  1. Install via Composer:

  2. Configuration

Add the connection configuration to your config/database.php file:

Auto-Installer

This package automatically downloads and installs the DuckDB native binary and FFI header when your application boots — no manual setup required.

On first boot it will:

  1. Create storage/duckdb/ (if it doesn't exist)
  2. Download the correct native library for your OS from the DuckDB GitHub Releases
  3. Download the duckdb.h FFI header
  4. Set the required environment variables (DUCKDB_LIB_PATH, DUCKDB_HEADER_PATH) at runtime

Subsequent boots detect the files are already present and skip the download (idempotent).

Supported platforms

OS Architecture Library
Windows x86_64 duckdb.dll
Linux x86_64 libduckdb.so
Linux aarch64 libduckdb.so
macOS Universal libduckdb.dylib

Configuration

Publish the config file to override defaults:

Available .env variables:

[!NOTE] ext-zip must be enabled in your php.ini (it is bundled with PHP by default on most platforms). If the installer fails (e.g. no internet access), it logs the error and does not crash the application — allowing you to manage binaries manually.

Usage

You can use the DB facade to interact with DuckDB.

Querying Files

You can query files directly (Parquet, CSV, JSON) without pre-configuring tables using the file() helper:

Basic Queries

Analytical Queries (OLAP)

DuckDB shines at analytics. You can query Parquet, CSV, or JSON files directly.

php use Illuminate\Support\Facades\DB;

// 1. Get all users $users = DB::connection('duckdb')->table('users')->get();

// 2. Aggregate count $count = DB::connection('duckdb')->table('users')->count();

// 3. Conditional Fetch with Bindings $user = DB::connection('duckdb') ->table('users') ->where('id', 1) ->first();

// 4. Raw SQL Select $results = DB::connection('duckdb')->select("SELECT * FROM users WHERE email LIKE ?", ['%example.com']);

// 5. Analytical Query (DuckDB syntax) // e.g. Extract hour from timestamp $hourly = DB::connection('duckdb') ->select("SELECT date_part('hour', created_at) as hour, count(*) as count FROM users GROUP BY 1"); ini [ffi] ffi.enable=true bash composer install bash vendor/bin/phpunit


All versions of laravel-duckdb with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-zip Version *
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package filipefernandes/laravel-duckdb contains the following files

Loading the files please wait ...