⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 8 of about 8 for exec (0.001 sec.)
PHP Client (PDO) 12869
The PHP DuckDB PDO extension is a tertiary client and is maintained by a third-party. To use pdo_duckdb , follow the instructions below . The latest version of pdo_duckdb supports DuckDB 2.0.0. pdo_duckdb is a native DuckDB database driver ... b Doctrine DBAL for DuckDB: doctrine-dbal-duckdb Examples Basic usage <?php $duckDb = new PDO('duckdb::memory:'); $duckDb->exec('CREATE TABLE table1 (id INTEGER, amount DECIMAL(10, 2), description VARCHAR)'); $statement = $duckDb->prepare('INSERT INT ... O table1 VALUES (?, ?, ?)'); $statement->execute([1, 42.21, 'Hello DuckDB! ? ? ?']); $statement = $duckDb->query('SELECT * FROM table1'); print_r($statement->fetchAll(P ... ATTR_CONFIG => ['access_mode' => 'read_only']]); Read and write Parquet files <?php $db = new PDO('duckdb::memory:'); $db->exec('CREATE TABLE table1 (id INTEGER, text VARCHAR USING COMPRESSION zstd, data JSON)'); $statement = $db->prepare('INSERT INT ...
https://man.mtool.work/duckdb/2.0/clients/tertiary_clients/php_pdo.html
Run Queries 10103
Overview Because the Go client implements database/sql , queries run through the standard methods: Exec and ExecContext send statements that do not return rows, such as INSERT or DDL, and report the number of affected rows. Query , QueryCon ... tatements, transactions, and scanning results. For opening the database these run on, see Connect . Sending Statements Use Exec (or ExecContext ) for a statement that does not return rows, such as INSERT or UPDATE . It returns a sql.Result , from whi ... ch RowsAffected() reports how many rows changed: _, err := db.ExecContext(ctx, `CREATE TABLE users (name VARCHAR, age INTEGER)`) if err != nil { log.Fatal(err) } res, err := db.ExecContext( ... maps time.Time to DuckDB's timestamp types. Prepared Statements db.PrepareContext() compiles a statement once so it can be executed many times, which pays off in a loop. The returned *sql.Stmt has its own Exec and Query methods, and must be closed wh ...
https://man.mtool.work/duckdb/2.0/clients/go/querying.html
Go Client 9940
The latest stable release of the DuckDB Go client bundles DuckDB 2.0.0. Its own version tag encodes that DuckDB version; see Versioning below. The DuckDB Go client, duckdb-go , is a SQL driver that conforms to Go's built-in database/sql int ... , or the DSN :memory: , opens an in-memory database, and a file path opens (or creates) a persistent database. From there, Exec , Query , and QueryRow run statements exactly as they do for any database/sql driver: package main import ( "database/sql" ... kdb-go/v2" ) func main() { db, err := sql.Open("duckdb", "") if err != nil { log.Fatal(err) } defer db.Close() _, err = db.Exec(`CREATE TABLE people (id INTEGER, name VARCHAR)`) if err != nil { log.Fatal(err) } _, err = db.Exec(`INSERT INTO people VA ... t — opening in-memory and file-backed databases, DSN configuration, connectors, and the connection lifetime. Run Queries — Exec , Query , prepared statements, parameter binding, transactions, and scanning results into Go values. Import Data — bulk lo ...
https://man.mtool.work/duckdb/2.0/clients/go/overview.html
Profile and Monitor 8874
Overview The Go client can observe query execution: it can retrieve per-operator profiling metrics after a query runs, and register a log storage that receives DuckDB's log messages. Both are described below. Profiling Profiling information ... ext.Background()) check(err) defer conn.Close() // Do not print profiling output to stdout after each query. _, err = conn.ExecContext(context.Background(), `SET enable_profiling = 'no_output'`) check(err) // Run the query to profile. res, err := con ... r that query. info, err := duckdb.GetProfilingInfo(conn) check(err) // Optionally, turn profiling off again. _, err = conn.ExecContext(context.Background(), `PRAGMA disable_profiling`) check(err) GetProfilingInfo() returns a duckdb.ProfilingInfo , a ... gMsg) }, }) check(err) // Enable logging, then point it at the registered storage. db := sql.OpenDB(connector) _, err = db.Exec(`CALL enable_logging(level = 'info')`) check(err) _, err = db.Exec(`SET logging_storage = 'my_log_storage'`) check(err) Lo ...
https://man.mtool.work/duckdb/2.0/clients/go/profiling.html
Import Data 8422
Overview The Go client offers two ways to load data into DuckDB in bulk: the high-performance Appender for inserting rows generated in Go, and reading directly from data files such as Parquet, CSV, and JSON. Both are described below. For in ... text.Background()) if err != nil { log.Fatal(err) } defer con.Close() db := sql.OpenDB(c) defer db.Close() if _, err := db.Exec(`CREATE TABLE users (name VARCHAR, age INTEGER)`); err != nil { log.Fatal(err) } a, err := duckdb.NewAppenderFromConn(con, ... le into a table rather than query it in place, wrap the reader in a CREATE TABLE ... AS SELECT or COPY statement sent with Exec : _, err := db.ExecContext(ctx, `CREATE TABLE data AS SELECT * FROM read_parquet('data.parquet')`) Further Reading Appende ...
https://man.mtool.work/duckdb/2.0/clients/go/data_import.html
SeaweedFS Import 7808
Prerequisites For SeaweedFS , the S3-compatible gateway allows you to use DuckDB's S3 support to read and write from SeaweedFS buckets. This requires the httpfs extension , which can be installed using the INSTALL SQL command. This only nee ... fs:latest \ mini -dir=/data -s3.config=/etc/seaweedfs/s3config.json echo "s3.bucket.create -name ⟨your-bucket⟩" | \ docker exec -i seaweedfs weed shell -master=localhost:9333 The S3 endpoint listens on port 8333. Credentials and Configuration Create ...
https://man.mtool.work/duckdb/2.0/guides/network_cloud_storage/seaweedfs_import....
Troubleshoot 7338
Overview This page collects common issues encountered when using the DuckDB Go client, together with their workarounds. Because the client uses cgo to embed DuckDB, most build problems are cgo or linker problems. If you run into a problem t ... r errors reported by DuckDB. Use errors.As to handle these errors by category without parsing their messages: _, err := db.Exec(query) if err != nil { var duckdbError *duckdb.Error if errors.As(err, &duckdbError) { switch duckdbError.Type { case duck ...
https://man.mtool.work/duckdb/2.0/clients/go/troubleshoot.html
ODBC Extension Functions 6886
odbc_begin_transaction odbc_bind_params odbc_close odbc_commit odbc_connect odbc_copy odbc_create_params odbc_list_data_sources odbc_list_drivers odbc_query odbc_rollback odbc_begin_transaction odbc_begin_transaction(conn_handle BIGINT) -> ... rows again. To copy once, use duckdb.sql("CALL odbc_copy(...)") , which runs at the call and consumes all rows, or duckdb.execute("SELECT * FROM odbc_copy(...)") followed by fetchall() or complete() . Parameters: conn_handle_or_string ( BIGINT or VA ... be opened and will be closed automatically after the query is complete Optional named parameters (source): Source query is executed using a separate DB instance from the instance on which odbc_copy is being called. Thus source_query cannot refer to p ... SQL query to read the data, example: FROM nl_train_stations source_queries ( LIST(VARCHAR) ): multiple DuckDB SQL queries executed one by one, last query must return the result set to copy, results of previous queries are discarded, results of all q ...
https://man.mtool.work/duckdb/2.0/core_extensions/odbc/functions.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work