{"id":20594909,"url":"https://github.com/thbley/php-duckdb-integration","last_synced_at":"2025-04-14T23:34:36.583Z","repository":{"id":61662530,"uuid":"298860203","full_name":"thbley/php-duckdb-integration","owner":"thbley","description":"PHP example to integrate DuckDB using PHP-FFI","archived":false,"fork":false,"pushed_at":"2023-02-13T11:44:21.000Z","size":8371,"stargazers_count":40,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T11:39:38.102Z","etag":null,"topics":["embedded-database","php-ffi"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thbley.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-26T16:58:11.000Z","updated_at":"2025-01-31T23:09:01.000Z","dependencies_parsed_at":"2024-11-16T08:10:55.339Z","dependency_job_id":"ab7c98eb-0935-407f-ba04-976ce75f2254","html_url":"https://github.com/thbley/php-duckdb-integration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-duckdb-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-duckdb-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-duckdb-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-duckdb-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thbley","download_url":"https://codeload.github.com/thbley/php-duckdb-integration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248980259,"owners_count":21193131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-database","php-ffi"],"created_at":"2024-11-16T08:10:48.241Z","updated_at":"2025-04-14T23:34:36.561Z","avatar_url":"https://github.com/thbley.png","language":"C","readme":"PHP example to integrate DuckDB using PHP-FFI\n-----------------------------------------------\n\nCurrently there is no PHP extension available for using DuckDB, so I created a small library using PHP-FFI.\n\nDuckDB is an embeddable SQL OLAP database management system.\nIt does not require external servers. Databases are stored in single files (similar to SQLite).\nCompared to SQLite, DuckDB is much faster. E.g. I imported 16M rows from a CSV file in 5s on my notebook (i5-8250U).\n\nDuckDB can import CSV files with automatic format detection and automatic table creation using:\n\n    CREATE TABLE test1 AS SELECT * FROM read_csv_auto('test1.csv');\n    CREATE TABLE test2 AS SELECT * FROM read_csv_auto('test2.csv.gz');\n\nUsage:\n\n    php -dffi.enable=1 test.php\n\n    or:\n\n    docker build -t php-ffi .\n    docker run -it --rm -v $(pwd):/code php-ffi php /code/test.php\n\nRequirements:\n\n    PHP 7.4+ with FFI extension enabled\n\nReferences:\n\n- Slides: https://github.com/thbley/php-duckdb-integration/blob/master/Getting_started_with_phpffi_ipc_2021_ThomasBley.pdf\n- https://duckdb.org\n- https://github.com/cwida/duckdb\n- https://github.com/cwida/duckdb/releases/latest/download/libduckdb-linux-amd64.zip\n- https://www.php.net/manual/en/book.ffi.php\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbley%2Fphp-duckdb-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthbley%2Fphp-duckdb-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbley%2Fphp-duckdb-integration/lists"}