Skip to content

pbowyer/ext-duckdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ext-duckdb

An exercise in using LLMs to generate a PHP extension - and to try to fill a gap in available PHP extensions.

I have the duckdb source code in duckdb/ and the PHP source code in php-src/ for easy reference.

Based on https://github.com/bogkonstantin/php-extension-hello-world. Original README below.


Base PHP extension in C language with VSCode Debugger setup

Clone this repository and navigate to the directory.
Want to learn more about PHP extension development? Read more here.

Build image

docker build --pull --rm -f "Dockerfile" -t php-dev:latest "."

Run container

docker run --rm --name php-dev -it php-dev bash

Test function

Check if it works from inside the container:

php -r "echo hello_world() . PHP_EOL;"

Debug configuration for Visual Studio Code

VSCode launch config (tested on Mac M2). Use Docker Dev containers in VSCode

{
    "name": "Launch Test Function (gdb)",
    "type": "cppdbg",
    "request": "launch",
    "program": "/usr/local/bin/php",
    "args": [
        "-r",
        "echo hello_world() . PHP_EOL;",
    ],
    "cwd": ".",
    "MIMode": "gdb",
    "additionalSOLibSearchPath": "/php-src;/php-ext",
    "setupCommands": [
        {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
        }
    ]
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published