⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 10 of about 40 for handle (0.002 sec.)
ODBC 101: A Duck Themed Guide to ODBC 14478
What is ODBC? ODBC which stands for Open Database Connectivity, is a standard that allows different programs to talk to different databases including, of course, DuckDB. This makes it easier to build programs that work with many different d ... ge to the official Microsoft ODBC documentation , which is a great resource for learning more about ODBC. General Concepts Handles Connecting Error Handling and Diagnostics Buffers and Binding Handles A handle is a pointer to a specific ODBC object whi ... ch is used to interact with the database. There are several different types of handles, each with a different purpose, these are the environment handle, the connection handle, the statement handle, and the de ... scriptor handle. Handles are allocated using the SQLAllocHandle which takes as input the type of handle to allocate, and a pointer to the ...
https://man.mtool.work/duckdb/2.0/guides/odbc/general.html
ODBC Extension Functions 13464
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) -> ... ompletion starts another implicit transaction on this connection. See Transaction management for details. Parameters: conn_handle ( BIGINT ): ODBC connection handle created with odbc_connect Returns: Always returns NULL ( VARCHAR ). Example: SELECT odb ... c_begin_transaction(getvariable('conn')) odbc_bind_params odbc_bind_params(conn_handle BIGINT, params_handle BIGINT, params STRUCT) -> BIGINT Binds specified parameter values to the specified parameters handle ... . Only necessary with 2-step parameters binding, see Query parameters for details. Parameters: conn_handle ( BIGINT ): ODBC connection handle created with odbc_connect params_handle ( BIGINT ): parameters handle created with odbc ...
https://man.mtool.work/duckdb/2.0/core_extensions/odbc/functions.html
Profile and Monitor 10921
Overview The Rust client can observe a running or completed query: it can retrieve per-operator profiling metrics after a query runs, and interrupt a long-running query from another thread. Both are shown below. Profiling Profiling must be ... children through children . Interrupting Queries A long-running query can be cancelled from another thread. Call interrupt_handle() on the connection to get an Arc<InterruptHandle> . InterruptHandle is both Send and Sync , so you can move it, or the co ... query fails with an error: use duckdb::{Connection, Result}; fn run_query(conn: Connection) -> Result<()> { let interrupt_handle = conn.interrupt_handle(); let join_handle = std::thread::spawn(move || { conn.execute("⟨expensive query⟩", []) }); // ... ... later, from this thread, cancel the query: interrupt_handle.interrupt(); let query_result = join_handle.join().unwrap(); assert!(query_result.is_err()); Ok(()) } interrupt() cancels ...
https://man.mtool.work/duckdb/2.0/clients/rust/profiling.html
ODBC Extension 8487
Please note that DuckDB also offers an ODBC client , which allows you to connect to DuckDB via ODBC from other applications. The odbc_scanner extension allows connecting to other databases (using their ODBC drivers ) and run queries with th ... I to the queries to remote databases. Two methods of passing query parameters are supported, using either params or params_handle named argument to odbc_query function. params argument takes a STRUCT value as an input. Struct field names are ignored, s ... time duckdb_execute_prepared() is called. To avoid this problem is it possible to use 2-step parameter binding with params_handle named argument to odbc_query : -- create parameters handle SET VARIABLE params = odbc_create_params(); -- when 'duckdb_pre ... ote DB FROM odbc_query( getvariable('conn'), ' SELECT CAST(? AS VARCHAR2(3)) || CAST(? AS VARCHAR2(3)) FROM DUAL ', params_handle = getvariable('params')); -- now we can repeatedly bind new parameters to the handle using 'odbc_bind_params()' -- and cal ...
https://man.mtool.work/duckdb/2.0/core_extensions/odbc/overview.html
Startup & Shutdown 8284
To use DuckDB, you must first initialize a duckdb_database handle using duckdb_open() . duckdb_open() takes as parameter the database file to read and write from. The special value NULL ( nullptr ) can be used to create an in-memory databas ... -memory database no data is persisted to disk (i.e., all data is lost when you exit the process). With the duckdb_database handle, you can create one or many duckdb_connection using duckdb_connect() . While individual connections are thread-safe, they ... with duckdb_disconnect() and the duckdb_database has to be explicitly closed with duckdb_close() to avoid memory and file handle leaking. Example duckdb_database db; duckdb_connection con; if (duckdb_open(NULL, &db) == DuckDBError) { // handle error } ... if (duckdb_connect(db, &con) == DuckDBError) { // handle error } // run queries... // cleanup duckdb_disconnect(&con); duckdb_close(&db); API Reference Overview duckdb_instance_ca ...
https://man.mtool.work/duckdb/2.0/clients/c/connect.html
Troubleshoot 7925
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 ... er on GitHub. Classifying DuckDB Errors The client returns a *duckdb.Error for 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 duckdb.ErrorTypeCatalog: // Handle a missing table, view, or other catalog entry. case duckdb.ErrorTypeConstraint: // Handle a constraint violation. } } } du ...
https://man.mtool.work/duckdb/2.0/clients/go/troubleshoot.html
Query 7816
The duckdb_query method allows SQL queries to be run in DuckDB from C. This method takes two parameters, a (null-terminated) SQL query string and a duckdb_result result pointer. The result pointer may be NULL if the application is not inter ... e a table state = duckdb_query(con, "CREATE TABLE integers (i INTEGER, j INTEGER);", NULL); if (state == DuckDBError) { // handle error } // insert three rows into the table state = duckdb_query(con, "INSERT INTO integers VALUES (3, 4), (5, 6), (7, NUL ... L);", NULL); if (state == DuckDBError) { // handle error } // query rows again state = duckdb_query(con, "SELECT * FROM integers", &result); if (state == DuckDBError) { // h ... andle error } // handle the result // ... // destroy the result after we are done with it duckdb_destroy_result(&result); Value Extraction Values ...
https://man.mtool.work/duckdb/2.0/clients/c/query.html
Configuration 7676
Configuration options can be provided to change different settings of the database system. Note that many of these settings can be changed later on using PRAGMA statements as well. The configuration object should be created, filled with val ... tabase db; duckdb_config config; // create the configuration object if (duckdb_create_config(&config) == DuckDBError) { // handle error } // set some configuration options duckdb_set_config(config, "access_mode", "READ_WRITE"); // or READ_ONLY duckdb_s ... ", "DESC"); // open the database using the configuration if (duckdb_open_ext(NULL, &db, config, NULL) == DuckDBError) { // handle error } // cleanup the configuration object duckdb_destroy_config(&config); // run queries... // cleanup duckdb_close(&db) ...
https://man.mtool.work/duckdb/2.0/clients/c/config.html
Import Data 7613
Overview The Rust client offers two ways to get data into DuckDB in bulk: the high-performance Appender for inserting rows from Rust, and reading directly from data files such as Parquet, CSV, and JSON. Both are described below. Appender Th ... enabled, an Appender can append an Apache Arrow RecordBatch directly, which avoids building a parameter list per row. See Handle Results for the Arrow integration. Reading Data Files DuckDB can read many file formats directly in SQL, which is often th ... the engine-level Appender interface that the Rust Appender wraps. Data Import — DuckDB's full set of bulk-loading options. Handle Results — the Apache Arrow integration used to append and read record batches. Run Queries — sending the CREATE TABLE and ...
https://man.mtool.work/duckdb/2.0/clients/rust/data_import.html
Connect 7567
Overview Every DuckDB feature reachable from Rust starts with a Connection . Opening in-memory and file-backed databases, configuring a database instance with Config , opening read-only, pooling connections across threads, the crate's threa ... automatically when it is dropped (goes out of scope), which shuts down the underlying database. To close it explicitly and handle any error, call close() : match conn.close() { Ok(()) => {} Err((_conn, err)) => eprintln!("failed to close connection: {e ... s little difference between an explicit close() and letting the connection drop, but close() gives a chance to observe and handle a shutdown error that Drop would otherwise discard. Further Reading Run Queries — using the Connection to send queries and ... read results. Configuration — the full list of DuckDB settings that can be passed to Config . Concurrency — how DuckDB handles multiple connections and threads. Troubleshoot — linking and build problems encountered when opening a connection. ...
https://man.mtool.work/duckdb/2.0/clients/rust/connecting.html
PREV 1 2 3 4 NEXT
DuckDB 2.0 Documentation / man.mtool.work