{"id":32211299,"url":"https://github.com/giterlizzi/perl-dbd-duckdb","last_synced_at":"2026-02-19T23:01:39.091Z","repository":{"id":318767206,"uuid":"1071815786","full_name":"giterlizzi/perl-DBD-DuckDB","owner":"giterlizzi","description":"DBD::DuckDB - DuckDB database driver for the DBI module","archived":false,"fork":false,"pushed_at":"2025-10-31T16:25:02.000Z","size":217,"stargazers_count":4,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-11T23:37:01.295Z","etag":null,"topics":["dbd","dbi","duckdb","perl"],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/DBD::DuckDB","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giterlizzi.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-07T21:11:14.000Z","updated_at":"2025-12-11T12:09:08.000Z","dependencies_parsed_at":"2025-10-15T11:08:47.821Z","dependency_job_id":"afd34702-6244-487b-84fc-cf1da98605a7","html_url":"https://github.com/giterlizzi/perl-DBD-DuckDB","commit_stats":null,"previous_names":["giterlizzi/perl-dbd-duckdb"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/giterlizzi/perl-DBD-DuckDB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giterlizzi%2Fperl-DBD-DuckDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giterlizzi%2Fperl-DBD-DuckDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giterlizzi%2Fperl-DBD-DuckDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giterlizzi%2Fperl-DBD-DuckDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giterlizzi","download_url":"https://codeload.github.com/giterlizzi/perl-DBD-DuckDB/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giterlizzi%2Fperl-DBD-DuckDB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29636040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dbd","dbi","duckdb","perl"],"created_at":"2025-10-22T06:49:35.550Z","updated_at":"2026-02-19T23:01:39.084Z","avatar_url":"https://github.com/giterlizzi.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://img.shields.io/github/release/giterlizzi/perl-DBD-DuckDB.svg)](https://github.com/giterlizzi/perl-DBD-DuckDB/releases) [![Actions Status](https://github.com/giterlizzi/perl-DBD-DuckDB/workflows/linux/badge.svg)](https://github.com/giterlizzi/perl-DBD-DuckDB/actions) [![License](https://img.shields.io/github/license/giterlizzi/perl-DBD-DuckDB.svg)](https://github.com/giterlizzi/perl-DBD-DuckDB) [![Starts](https://img.shields.io/github/stars/giterlizzi/perl-DBD-DuckDB.svg)](https://github.com/giterlizzi/perl-DBD-DuckDB) [![Forks](https://img.shields.io/github/forks/giterlizzi/perl-DBD-DuckDB.svg)](https://github.com/giterlizzi/perl-DBD-DuckDB) [![Issues](https://img.shields.io/github/issues/giterlizzi/perl-DBD-DuckDB.svg)](https://github.com/giterlizzi/perl-DBD-DuckDB/issues) [![Coverage Status](https://coveralls.io/repos/github/giterlizzi/perl-DBD-DuckDB/badge.svg)](https://coveralls.io/github/giterlizzi/perl-DBD-DuckDB)\n\n# DBD::DuckDB - DuckDB database driver for the DBI module\n\n# SYNOPSIS\n\n    use DBI;\n    my $dbh = DBI-\u003econnect(\"dbi:DuckDB:dbname=$dbfile\", \"\", \"\");\n\n# DESCRIPTION\n\nDuckDB is a high-performance analytical database system. It is designed to be \nfast, reliable, portable, and easy to use. DuckDB provides a rich SQL dialect \nwith support far beyond basic SQL. DuckDB supports arbitrary and nested \ncorrelated subqueries, window functions, collations, complex types (arrays, \nstructs, maps), and several extensions designed to make SQL easier to use.\n\n[https://duckdb.org](https://duckdb.org)\n\n# MODULE DOCUMENTATION\n\nThis documentation describes driver specific behavior and restrictions. It is\nnot supposed to be used as the only reference for the user. In any case\nconsult the **DBI** documentation first!\n\n[Latest DBI documentation.](https://metacpan.org/pod/DBI)\n\n# SETUP\n\nTo use [DBD::DuckDB](https://metacpan.org/pod/DBD%3A%3ADuckDB), the native DuckDB library must be available when the\nmodule is loaded.  There are two common ways to satisfy this requirement.\n\n## Manual installation\n\n- Download the library\n\n        $ wget https://github.com/duckdb/duckdb/releases/download/v$VERSION/libduckdb-linux-amd64.zip\n        $ unzip duckdb-linux-amd64.zip\n        $ sudo cp libduckdb.so /usr/lib64/          # or another system library directory\n\n- Update the library search path\n\n    If the library was not placed in a directory already listed in\n    `/etc/ld.so.conf` (or equivalent), add its location to\n    `LD_LIBRARY_PATH`:\n\n        $ export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH\n\n    or add the directory to `/etc/ld.so.conf` and run:\n\n        $ sudo ldconfig\n\n## Use Alien::DuckDB\n\n[Alien::DuckDB](https://metacpan.org/pod/Alien%3A%3ADuckDB) is a CPAN module that automatically downloads and\ninstalls the native DuckDB C library for the current platform.\n\n- Install the Alien module\n\n        $ cpanm Alien::DuckDB\n\n        # or\n\n        $ perl -MCPAN -e 'install Alien::DuckDB'\n\n- DBD::DuckDB detects Alien automatically\n\n    No environment variables or manual copying of \\*.so files are needed;\n    when you `use DBD::DuckDB`, the module calls\n    `Alien::DuckDB-\u003edynamic_lib` to obtain the correct library path.\n\n# THE DBI CLASS\n\n## DBI Class Methods\n\n### **connect**\n\nThis method creates a database handle by connecting to a database, and is the \nDBI equivalent of the \"new\" method.\n\nThe connection string is always of the form: \"dbi:DuckDB:dbname=\u0026lt;dbfile\u003e\"\n\n    my $dbh = DBI-\u003econnect(\"dbi:DuckDB:dbname=$dbfile\", \"\", \"\", \\%attr);\n\nDuckDB creates a file per a database.\n\nThe file is opened in read/write mode, and will be created if it does not exist yet.\n\nAlthough the database is stored in a single file, the directory containing the \ndatabase file must be writable by DuckDB because the library will create \nseveral temporary files there.\n\nIf the filename `$dbfile` is `:memory:`, then a private, temporary in-memory \ndatabase is created for the connection. This in-memory database will vanish \nwhen the database connection is closed. It is handy for your library tests.\n\n## Common connect Attributes\n\nSee [\"ATTRIBUTES-COMMON-TO-ALL-HANDLES\" in DBI](https://metacpan.org/pod/DBI#ATTRIBUTES-COMMON-TO-ALL-HANDLES).\n\n## DuckDB connect Attributes\n\n### **duckdb\\_checkpoint\\_on\\_disconnect**\n\nExecute `CHECKPOINT` statement on disconnect.\n\nThe `CHECKPOINT` statement synchronizes data in the write-ahead log (WAL) to the\ndatabase data file.\n\n### **duckdb\\_config**\n\nConfiguration options can be provided to change different settings of the database\nsystem. Note that many of these settings can be changed later on using `PRAGMA`\nstatements as well.\n\n    my $dbh = DBI-\u003econnect(\"dbi:DuckDB:dbname=$dbfile\", undef, undef, {\n        duckdb_config =\u003e {\n            access_mode   =\u003e 'READ_WRITE',\n            threads       =\u003e 8,\n            max_memory    =\u003e '8GB',\n            default_order =\u003e 'DESC'\n        }\n    });\n\nSee [https://duckdb.org/docs/stable/configuration/overview#global-configuration-options](https://duckdb.org/docs/stable/configuration/overview#global-configuration-options).\n\n## Methods Common To All Handles\n\nFor all of the methods below, **$h** can be either a database handle (**$dbh**) \nor a statement handle (**$sth**). Note that _$dbh_ and _$sth_ can be replaced with \nany variable name you choose: these are just the names most often used. Another \ncommon variable used in this documentation is $_rv_, which stands for \"return value\".\n\n### **err**\n\n    $rv = $h-\u003eerr;\n\nReturns the error code from the last method called. \n\n### **errstr**\n\n    $str = $h-\u003eerrstr;\n\nReturns the last error that was reported by DuckDB. \n\n### **state**\n\n    $str = $h-\u003estate;\n\nReturns a five-character \"SQLSTATE\" code. Success is indicated by a `00000` code, which \ngets mapped to an empty string by DBI.\n\nNote that the specific success code `00000` is translated to any empty string\n(false). DuckDB does not support SQLSTATE then state() will return `S1000` (General Error)\nfor all errors.\n\n### **trace**\n\n    $h-\u003etrace($trace_settings);\n    $h-\u003etrace($trace_settings, $trace_filename);\n    $trace_settings = $h-\u003etrace;\n\nChanges the trace settings on a database or statement handle. \nThe optional second argument specifies a file to write the \ntrace information to. If no filename is given, the information \nis written to `STDERR`. Note that tracing can be set globally as \nwell by setting `DBI-\u003etrace`, or by using the environment \nvariable _DBI\\_TRACE_.\n\n### **trace\\_msg**\n\n    $h-\u003etrace_msg($message_text);\n    $h-\u003etrace_msg($message_text, $min_level);\n\nWrites a message to the current trace output (as set by the [\"trace\"](#trace) method). If a second argument \nis given, the message is only written if the current tracing level is equal to or greater than \nthe `$min_level`.\n\n### **Other common methods**\n\nSee the [DBI](https://metacpan.org/pod/DBI) documentation for full details.\n\n# DBI DATABASE HANDLE OBJECTS\n\n## Database Handle Methods\n\n### **selectall\\_arrayref**\n\n    $ary_ref = $dbh-\u003eselectall_arrayref($sql);\n    $ary_ref = $dbh-\u003eselectall_arrayref($sql, \\%attr);\n    $ary_ref = $dbh-\u003eselectall_arrayref($sql, \\%attr, @bind_values);\n\nReturns a reference to an array containing the rows returned by preparing and\nexecuting the SQL string. See the [DBI](https://metacpan.org/pod/DBI) documentation for full details.\n\n### **selectcol\\_arrayref**\n\n    $ary_ref = $dbh-\u003eselectcol_arrayref($sql, \\%attr, @bind_values);\n\nReturns a reference to an array containing the first column from each rows \nreturned by preparing and executing the SQL string. It is possible to specify \nexactly which columns to return. See the [DBI](https://metacpan.org/pod/DBI) documentation for full details.\n\n### **prepare**\n\n    $sth = $dbh-\u003eprepare($statement, \\%attr);\n\nPrepares a statement for later execution by the database engine and returns a\nreference to a statement handle object.\n\n### **prepare\\_cached**\n\n    $sth = $dbh-\u003eprepare_cached($statement, \\%attr);\n\nImplemented by DBI, no driver-specific impact. This method is most useful if\nthe same query is used over and over as it will cut down round trips to the server.\n\n### **do**\n\n    $rv = $dbh-\u003edo($statement);\n    $rv = $dbh-\u003edo($statement, \\%attr);\n    $rv = $dbh-\u003edo($statement, \\%attr, @bind_values);\n\nPrepare and execute a single statement. Returns the number of rows affected if \nthe query was successful, returns undef if an error occurred, and returns -1 if \nthe number of rows is unknown or not available. Note that this method will \nreturn **0E0** instead of 0 for 'no rows were affected', in order to always \nreturn a true value if no error occurred.\n\n### **last\\_insert\\_id**\n\nDuckDB does not implement auto\\_increment of serial type columns it uses \npredefined sequences where the id numbers are either selected before insert, at \ninsert time, or as part of the query.\n\n    $dbh-\u003edo('CREATE SEQUENCE id_sequence START 1');\n\n    $dbh-\u003edo( q{CREATE TABLE tbl (\n        id INTEGER DEFAULT nextval('id_sequence'),\n        s VARCHAR\n    } );\n\n    $dbh-\u003edo( q{INSERT INTO tbl (s) VALUES ('hello'), ('world')} );\n\nSee [https://duckdb.org/docs/stable/sql/statements/create\\_sequence.html](https://duckdb.org/docs/stable/sql/statements/create_sequence.html).\n\n### **commit**\n\n    $rv = $dbh-\u003ecommit;\n\nIssues a COMMIT to DuckDB, indicating that the current transaction is \nfinished and that all changes made will be visible to other processes. If \nAutoCommit is enabled, then a warning is given and no COMMIT is issued. Returns \ntrue on success, false on error.\n\n### **rollback**\n\n    $rv = $dbh-\u003erollback;\n\nIssues a ROLLBACK to DuckDB, which discards any changes made in the current \ntransaction. If AutoCommit is enabled, then a warning is given and no ROLLBACK \nis issued. Returns true on success, and false on error.\n\n### **begin\\_work**\n\nThis method turns on transactions until the next call to \"commit\" or \"rollback\",\nif AutoCommit is currently enabled. If it is not enabled, calling begin\\_work will\nissue an error. Note that the transaction will not actually begin until the first\nstatement after begin\\_work is called.\n\nExample:\n\n    $dbh-\u003e{AutoCommit} = 1;\n    $dbh-\u003edo('INSERT INTO foo VALUES (123)'); ## Changes committed immediately\n    $dbh-\u003ebegin_work();\n    ## Not in a transaction yet, but AutoCommit is set to 0\n\n    $dbh-\u003edo(\"INSERT INTO foo VALUES (345)\");\n    ## DuckDB actually issues two statements here:\n    ## BEGIN;\n    ## INSERT INTO foo VALUES (345)\n    ## We are now in a transaction\n\n    $dbh-\u003ecommit();\n    ## AutoCommit is now set to 1 again\n\n### **disconnect**\n\n    $rv = $dbh-\u003edisconnect;\n\nDisconnects from the DuckDB database. Any uncommitted changes will be rolled \nback upon disconnection. It's good policy to always explicitly call commit or \nrollback at some point before disconnecting, rather than relying on the default \nrollback behavior.\n\nIf the script exits before disconnect is called (or, more precisely, if the \ndatabase handle is no longer referenced by anything), then the database \nhandle's DESTROY method will call the rollback() and disconnect() methods \nautomatically. It is best to explicitly disconnect rather than rely on this \nbehavior.\n\n### **quote**\n\n    $rv = $dbh-\u003equote($value, $data_type);\n\n### **quote\\_identifier**\n\n    $string = $dbh-\u003equote_identifier( $name );\n    $string = $dbh-\u003equote_identifier( undef, $schema, $table);\n\n### **table\\_info**\n\n    $sth = $dbh-\u003etable_info( $catalog, $schema, $table, $type );\n\nReturns all tables and schemas (databases) as specified in [\"table\\_info\" in DBI](https://metacpan.org/pod/DBI#table_info).\nThe schema and table arguments will do a `LIKE` search. The `$type`\nargument accepts a comma separated list of the following types 'TABLE',\n'INDEX', 'VIEW' and 'TRIGGER' (by default all are returned).\nNote that a statement handle is returned, and not a direct list of tables.\nThe following fields are returned:\n\n- **TABLE\\_CAT**: The name of the catalog.\n- **TABLE\\_SCHEM**: The name of the schema (database) that the table or view is\nin. The default schema is 'main' and other databases will be in the name given when\nthe database was attached.\n- **TABLE\\_NAME**: The name of the table or view.\n- **TABLE\\_TYPE**: The type of object returned. Will be one of 'TABLE', 'INDEX',\n'VIEW', 'TRIGGER'.\n- **REMARKS**: A description of the table.\n\n### **column\\_info**\n\n    $sth = $dbh-\u003ecolumn_info( $catalog, $schema, $table, $column );\n\nFetch information about columns in specificed table ([\"column\\_info\" in DBI](https://metacpan.org/pod/DBI#column_info)).\nThe catalog, schema and table arguments will do a `LIKE` search.\nNote that a statement handle is returned, and not a direct list of columns.\nThe following fields are returned:\n\n- **TABLE\\_CAT**: The name of the catalog.\n- **TABLE\\_SCHEM**: The name of the schema (database) that the table or \nview is in. The default schema is 'main' and other databases will be in the \nname given when the database was attached.\n- **TABLE\\_NAME**: The name of the table or view.\n- **COLUMN\\_NAME**: The column identifier.\n- **DATA\\_TYPE**\n- **TYPE\\_NAME**: A data source dependent data type name.\n- **COLUMN\\_SIZE**\n- **BUFFER\\_LENGTH**\n- **DECIMAL\\_DIGITS**: The total number of significant digits to the right\nof the decimal point.\n- **NUM\\_PREC\\_RADIX**: The radix for numeric precision. The value is 10 or\n2 for numeric data types and NULL (undef) if not applicable.\n- **NULLABLE**: Indicates if a column can accept NULLs (0 = SQL\\_NO\\_NULLS, \n1 = SQL\\_NULLABLE)\n- **REMARKS**: A description of the column.\n- **COLUMN\\_DEF**: The default value of the column, in a format that can be \nused directly in an SQL statement.\n- **SQL\\_DATA\\_TYPE**\n- **SQL\\_DATETIME\\_SUB**\n- **CHAR\\_OCTET\\_LENGTH**\n- **ORDINAL\\_POSITION**: The column sequence number (starting with 1).\n- **IS\\_NULLABLE**: Indicates if the column can accept NULLs. Possible \nvalues are: 'NO', 'YES' and ''.\n\n### **tables**\n\n    @names = $dbh-\u003etables( undef, $schema, $table, $type, \\%attr );\n\nSupported by this driver as proposed by DBI. This method returns all tables\nand/or views (including foreign tables and materialized views) which are\nvisible to the current user: see [\"table\\_info\"](#table_info) for more information about\nthe arguments.\n\n### **type\\_info\\_all**\n\n    $type_info_all = $dbh-\u003etype_info_all;\n\nSupported by this driver as proposed by DBI. Information is only provided for\nSQL datatypes and for frequently used datatypes.\n\n### **type\\_info**\n\n    @type_info = $dbh-\u003etype_info($data_type);\n\nReturns a list of hash references holding information about one or more variants of $data\\_type. \nSee the DBI documentation for more details.\n\n### **primary\\_key primary\\_key\\_info**\n\n    @names = $dbh-\u003eprimary_key(undef, $schema, $table);\n    $sth   = $dbh-\u003eprimary_key_info(undef, $schema, $table, \\%attr);\n\nYou can retrieve primary key names or more detailed information.\n\n### **foreign\\_key\\_info**\n\n    $sth = $dbh-\u003eforeign_key_info( $pk_catalog, $pk_schema, $pk_table,\n                                   $fk_catalog, $fk_schema, $fk_table );\n\nSupported by this driver as proposed by DBI, using the SQL/CLI variant.\n\n### **ping**\n\n    my $bool = $dbh-\u003eping;\n\nReturns true if the database file exists (or the database is in-memory), and\nthe database connection is active.\n\n## DuckDB methods\n\n### **x\\_duckdb\\_version**\n\nReturn the current DuckDB library version using `duckdb_library_version` C\nfunction.\n\n### **x\\_duckdb\\_appender**\n\nAppenders are the most efficient way of loading data into DuckDB from within \nthe C interface, and are recommended for fast data loading. The appender is \nmuch faster than using prepared statements or individual INSERT INTO statements.\n\n    $dbh-\u003edo('CREATE TABLE people (id INTEGER, name VARCHAR)');\n    my $appender = $dbh-\u003ex_duckdb_appender('people');\n\n    $appender-\u003eappend(1, DUCKDB_TYPE_INTEGER);\n    $appender-\u003eappend('Mark', DUCKDB_TYPE_VARCHAR);\n    $appender-\u003eend_row;\n\n    # or\n\n    $appeder-\u003eappend_row(id =\u003e 1, name =\u003e 'Mark');\n\nSee [DBD::DuckDB::Appender](https://metacpan.org/pod/DBD%3A%3ADuckDB%3A%3AAppender).\n\n### **x\\_duckdb\\_read\\_csv**\n\n    $dbh-\u003ex_duckdb_read_csv( $file );\n    $dbh-\u003ex_duckdb_read_csv( $file, \\%params );\n\nHelper method for `read_csv` function ([https://duckdb.org/docs/stable/data/csv/overview](https://duckdb.org/docs/stable/data/csv/overview)).\n\n    $sth = $dbh-\u003ex_duckdb_read_csv('https://duckdb.org/data/flights.csv' =\u003e {sep =\u003e '|'}) or Carp::croak $dbh-\u003eerrstr;\n\n    while (my $row = $sth-\u003efetchrow_hashref) {\n        say sprintf '%s --\u003e %s', $row-\u003e{OriginCityName}, $row-\u003e{DestCityName}; \n    }\n\n### **x\\_duckdb\\_read\\_json**\n\n    $dbh-\u003ex_duckdb_read_json( $file );\n    $dbh-\u003ex_duckdb_read_json( $file, \\%params );\n\nHelper method for `read_json` function ([https://duckdb.org/docs/stable/data/json/loading\\_json](https://duckdb.org/docs/stable/data/json/loading_json)).\n\n    $sth = $dbh-\u003ex_duckdb_read_json('https://duckdb.org/data/json/todos.json') or Carp::croak $dbh-\u003eerrstr;\n\n    while (my $row = $sth-\u003efetchrow_hashref) {\n        say sprintf '[%s] %s', ($row-\u003e{completed} ? '✓' : ' '), $row-\u003e{title};\n    }\n\n### **x\\_duckdb\\_read\\_xlsx**\n\n    $dbh-\u003ex_duckdb_read_xlsx( $file );\n    $dbh-\u003ex_duckdb_read_xlsx( $file, \\%params );\n\nHelper method for `read_xlsx` function ([https://duckdb.org/docs/stable/core\\_extensions/excel](https://duckdb.org/docs/stable/core_extensions/excel)).\n\n# DBI STATEMENT HANDLE OBJECTS\n\n## Statement Handle Methods\n\n### **bind\\_param**\n\n    $rv = $sth-\u003ebind_param($param_num, $bind_value);\n    $rv = $sth-\u003ebind_param($param_num, $bind_value, $bind_type);\n    $rv = $sth-\u003ebind_param($param_num, $bind_value, \\%attr);\n\nAllows the user to bind a value and/or a data type to a placeholder.\n\n### **bind\\_param\\_array**\n\n    $rv = $sth-\u003ebind_param_array($param_num, $array_ref_or_value)\n    $rv = $sth-\u003ebind_param_array($param_num, $array_ref_or_value, $bind_type)\n    $rv = $sth-\u003ebind_param_array($param_num, $array_ref_or_value, \\%attr)\n\nBinds an array of values to a placeholder, so that each is used in turn by a call \nto the [\"execute\\_array\"](#execute_array) method.\n\n### **execute**\n\n    $rv = $sth-\u003eexecute(@bind_values);\n\nPerform whatever processing is necessary to execute the prepared statement.\n\n### **execute\\_array**\n\n    $tuples = $sth-\u003eexecute_array() or die $sth-\u003eerrstr;\n    $tuples = $sth-\u003eexecute_array(\\%attr) or die $sth-\u003eerrstr;\n    $tuples = $sth-\u003eexecute_array(\\%attr, @bind_values) or die $sth-\u003eerrstr;\n    ($tuples, $rows) = $sth-\u003eexecute_array(\\%attr) or die $sth-\u003eerrstr;\n    ($tuples, $rows) = $sth-\u003eexecute_array(\\%attr, @bind_values) or die $sth-\u003eerrstr;\n\nExecute a prepared statement once for each item in a passed-in hashref, or items that \nwere previously bound via the [\"bind\\_param\\_array\"](#bind_param_array) method. See the [DBI](https://metacpan.org/pod/DBI) documentation \nfor more details.\n\n### **execute\\_for\\_fetch**\n\n    $tuples = $sth-\u003eexecute_for_fetch($fetch_tuple_sub);\n    $tuples = $sth-\u003eexecute_for_fetch($fetch_tuple_sub, \\@tuple_status);\n    ($tuples, $rows) = $sth-\u003eexecute_for_fetch($fetch_tuple_sub);\n    ($tuples, $rows) = $sth-\u003eexecute_for_fetch($fetch_tuple_sub, \\@tuple_status);\n\nUsed internally by the [\"execute\\_array\"](#execute_array) method, and rarely used directly. See the \n[DBI](https://metacpan.org/pod/DBI) documentation for more details.\n\n### **fetchrow\\_arrayref**\n\n    $ary_ref = $sth-\u003efetchrow_arrayref;\n\nFetches the next row of data from the statement handle, and returns a reference to an array \nholding the column values. Any columns that are NULL are returned as undef within the array.\n\nIf there are no more rows or if an error occurs, then this method return undef. You should \ncheck `$sth-\u003eerr` afterwards (or use the [RaiseError](#raiseerror-boolean-inherited) attribute) to discover if the undef returned \nwas due to an error.\n\nNote that the same array reference is returned for each fetch, so don't store the reference and \nthen use it after a later fetch. Also, the elements of the array are also reused for each row, \nso take care if you want to take a reference to an element. See also [\"bind\\_columns\"](#bind_columns).\n\n### **fetchrow\\_array**\n\n    @ary = $sth-\u003efetchrow_array;\n\nSimilar to the [\"fetchrow\\_arrayref\"](#fetchrow_arrayref) method, but returns a list of column information rather than \na reference to a list. Do not use this in a scalar context.\n\n### **fetchrow\\_hashref**\n\n    $hash_ref = $sth-\u003efetchrow_hashref;\n    $hash_ref = $sth-\u003efetchrow_hashref($name);\n\nFetches the next row of data and returns a hashref containing the name of the columns as the keys \nand the data itself as the values. Any NULL value is returned as an undef value.\n\nIf there are no more rows or if an error occurs, then this method return undef. You should \ncheck `$sth-\u003eerr` afterwards (or use the [RaiseError](#raiseerror-boolean-inherited) attribute) to discover if the undef returned \nwas due to an error.\n\nThe optional `$name` argument should be either `NAME`, `NAME_lc` or `NAME_uc`, and indicates \nwhat sort of transformation to make to the keys in the hash.\n\n### **fetchall\\_arrayref**\n\n    $tbl_ary_ref = $sth-\u003efetchall_arrayref();\n    $tbl_ary_ref = $sth-\u003efetchall_arrayref( $slice );\n    $tbl_ary_ref = $sth-\u003efetchall_arrayref( $slice, $max_rows );\n\nReturns a reference to an array of arrays that contains all the remaining rows to be fetched from the \nstatement handle. If there are no more rows, an empty arrayref will be returned. If an error occurs, \nthe data read in so far will be returned. Because of this, you should always check `$sth-\u003eerr` after \ncalling this method, unless [RaiseError](#raiseerror-boolean-inherited) has been enabled.\n\nIf `$slice` is an array reference, fetchall\\_arrayref uses the [\"fetchrow\\_arrayref\"](#fetchrow_arrayref) method to fetch each \nrow as an array ref. If the `$slice` array is not empty then it is used as a slice to select individual \ncolumns by perl array index number (starting at 0, unlike column and parameter numbers which start at 1).\n\nWith no parameters, or if $slice is undefined, fetchall\\_arrayref acts as if passed an empty array ref.\n\nIf `$slice` is a hash reference, fetchall\\_arrayref uses [\"fetchrow\\_hashref\"](#fetchrow_hashref) to fetch each row as a hash reference.\n\nSee the [DBI](https://metacpan.org/pod/DBI) documentation for a complete discussion.\n\n### **fetchall\\_hashref**\n\n    $hash_ref = $sth-\u003efetchall_hashref( $key_field );\n\nReturns a hashref containing all rows to be fetched from the statement handle. See the DBI documentation for \na full discussion.\n\n### **finish**\n\n    $rv = $sth-\u003efinish;\n\nIndicates to DBI that you are finished with the statement handle and are not going to use it again. Only needed \nwhen you have not fetched all the possible rows.\n\n### **rows**\n\n    $rv = $sth-\u003erows;\n\nReturns the number of rows returned by the last query. In contrast to many other DBD modules, \nthe number of rows is available immediately after calling `$sth-\u003eexecute`. Note that \nthe [\"execute\"](#execute) method itself returns the number of rows itself, which means that this \nmethod is rarely needed.\n\n### **dump\\_results**\n\n    $rows = $sth-\u003edump_results($maxlen, $lsep, $fsep, $fh);\n\nFetches all the rows from the statement handle, calls `DBI::neat_list` for each row, and \nprints the results to `$fh` (which defaults to `STDOUT`). Rows are separated by `$lsep` (which defaults \nto a newline). Columns are separated by `$fsep` (which defaults to a comma). The `$maxlen` controls \nhow wide the output can be, and defaults to 35.\n\nThis method is designed as a handy utility for prototyping and testing queries. Since it uses \n\"neat\\_list\" to format and edit the string for reading by humans, it is not recommended \nfor data transfer applications.\n\n# SUPPORT\n\n## Bugs / Feature Requests\n\nPlease report any bugs or feature requests through the issue tracker\nat [https://github.com/giterlizzi/perl-DBD-DuckDB/issues](https://github.com/giterlizzi/perl-DBD-DuckDB/issues).\nYou will be notified automatically of any progress on your issue.\n\n## Source Code\n\nThis is open source software.  The code repository is available for\npublic review and contribution under the terms of the license.\n\n[https://github.com/giterlizzi/perl-DBD-DuckDB](https://github.com/giterlizzi/perl-DBD-DuckDB)\n\n    git clone https://github.com/giterlizzi/perl-DBD-DuckDB.git\n\n# AUTHOR\n\n- Giuseppe Di Terlizzi \u003cgdt@cpan.org\u003e\n\n# LICENSE AND COPYRIGHT\n\nThis software is copyright (c) 2024-2025 by Giuseppe Di Terlizzi.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiterlizzi%2Fperl-dbd-duckdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiterlizzi%2Fperl-dbd-duckdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiterlizzi%2Fperl-dbd-duckdb/lists"}