⌘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 16 for params (0.003 sec.)
ODBC Extension Functions 13395
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) -> ... bc_connect Returns: Always returns NULL ( VARCHAR ). Example: SELECT odbc_begin_transaction(getvariable('conn')) odbc_bind_params odbc_bind_params(conn_handle BIGINT, params_handle BIGINT, params STRUCT) -> BIGINT Binds specified parameter values to th ... ng, see Query parameters for details. Parameters: conn_handle ( BIGINT ): ODBC connection handle created with odbc_connect params_handle ( BIGINT ): parameters handle created with odbc_create_params params ( STRUCT ): parameters values Returns: Paramet ... ers handle ( BIGINT ), the same one that was passed as a second argument. Example: SELECT odbc_bind_params(getvariable('conn'), getvariable('params1'), row(42, 'foo')) odbc_close odbc_close(conn_handle BIGINT) -> VARCHAR Closes s ...
https://man.mtool.work/duckdb/2.0/core_extensions/odbc/functions.html
ODBC Extension 11211
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 ... with parameters FROM odbc_query(getvariable('conn'), 'SELECT CAST(? AS NVARCHAR2(2)) || CAST(? AS VARCHAR2(5)) FROM DUAL', params = row('?', 'quack')); -- copy data into remote DB FROM odbc_copy(getvariable('conn'), source_file = 'https://blobs.duckdb. ... ters over ODBC API 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 nam ... value inline: FROM odbc_query( getvariable('conn'), ' SELECT CAST(? AS VARCHAR2(3)) || CAST(? AS VARCHAR2(3)) FROM DUAL ', params = row(?, ?)) If we prepare this query with duckdb_prepare() , bind foo and bar VARCHAR values to it with duckdb_bind_value ...
https://man.mtool.work/duckdb/2.0/core_extensions/odbc/overview.html
Run Queries 10293
Overview A Connection runs SQL through two families of methods: The execute_* methods ( execute() and execute_batch() ) send statements that do not return rows, such as INSERT or DDL, and report the number of affected rows. The query_* meth ... holders rather than formatted into the SQL string. DuckDB uses positional ( ? ) and numbered ( ?1 , ?2 ) placeholders. The params! macro packs a heterogeneous list of values into the parameter slice: use duckdb::params; conn.execute( "INSERT INTO perso ... n (id, name, data) VALUES (?, ?, ?)", params![1, "Steven", None::<Vec<u8>>], )?; For named placeholders such as $name , use the named_params! macro: use duckdb::named_ ... params; conn.query_row( "SELECT $age >= 18 AND $name = 'Alice'", named_params! { "age": min_age, "name": name, }, |row| row.get(0), )?; Any value bound as a parameter implements the ToSql trait, and a ...
https://man.mtool.work/duckdb/2.0/clients/rust/querying.html
Handle Results 9929
Overview Beyond reading a result set row by row , the Rust client can hand a query result to Apache Arrow as a stream of record batches, register an Arrow batch as a queryable table, and return results as Polars data frames. Each of these c ... ilt-in ArrowVTab table function on the connection, and pass the batch as a query parameter with arrow_recordbatch_to_query_params() . The following is adapted from the crate's arrow_vtab example : use duckdb::{Connection, arrow::record_batch::RecordBat ... ch}; use duckdb::vtab::arrow::{arrow_recordbatch_to_query_params, ArrowVTab}; let conn = Connection::open_in_memory()?; conn.register_table_function::<ArrowVTab>("arrow")?; let params = a ... rrow_recordbatch_to_query_params(cities_batch); let batches: Vec<RecordBatch> = conn .prepare( "SELECT city, population FROM arrow(?, ?) WHERE coastal AND ...
https://man.mtool.work/duckdb/2.0/clients/rust/result_handling.html
Import Data 9686
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 ... appender() , passing the target table name, then push rows with append_row() . Each row is a parameter list built with the params! macro: use duckdb::{params, Connection, Result}; fn insert_rows(conn: &Connection) -> Result<()> { conn.execute_batch("CR ... EATE TABLE foo (a INTEGER, b INTEGER)")?; let mut app = conn.appender("foo")?; app.append_row(params![1, 2])?; app.append_row(params![3, 4])?; app.flush()?; Ok(()) } To append many rows from an iterator of parameter lists i ... rom the transaction. The following bulk-inserts ten million rows, adapted from the crate's appender example : use duckdb::{params, Connection, DropBehavior, Result}; fn main() -> Result<()> { let mut db = Connection::open_in_memory()?; db.execute_batch ...
https://man.mtool.work/duckdb/2.0/clients/rust/data_import.html
Executing SQL in Python 8785
SQL queries can be executed using the duckdb.sql function. import duckdb duckdb.sql("SELECT 42").show() By default this will create a relation object. The result can be converted to various formats using the result conversion functions. For ... ("SELECT * FROM integers WHERE i = $value", {"value": 42}).fetchall() con.sql and duckdb.sql take the values through their params keyword argument: con.sql( "SELECT * FROM integers WHERE i = $value", params={"value": 42}, ).fetchall() The params list o ...
https://man.mtool.work/duckdb/2.0/guides/python/execute_sql.html
Connect 7797
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 ... the r2d2 connection pool. A DuckdbConnectionManager creates connections that the pool checks out and returns: use duckdb::{params, DuckdbConnectionManager}; let manager = DuckdbConnectionManager::file("my_database.duckdb")?; let pool = r2d2::Pool::new( ... rker checks out its own connection from the pool. let conn = pool.get()?; conn.execute("INSERT INTO foo (bar) VALUES (?)", params![1])?; DuckdbConnectionManager::memory() builds a manager for an in-memory database, and DuckdbConnectionManager::file_wit ...
https://man.mtool.work/duckdb/2.0/clients/rust/connecting.html
Appender 7797
The Appender can be used to load bulk data into a DuckDB database. It is available in the C, C++, Go, Java, Julia, Node.js, Python, and Rust clients. This page describes how the Appender behaves across clients and shows a minimal example in ... ation, see the Go Appender API . Rust Create an appender from a Connection with appender() , then push rows built with the params! macro: let mut app = conn.appender("foo")?; app.append_row(params![1, "hello"])?; app.flush()?; For more information, see ...
https://man.mtool.work/duckdb/2.0/data/appender.html
Rust Client 7745
Installation To use the DuckDB Rust client, visit the Rust installation page . The latest stable version of the DuckDB Rust client is 2.0.0. The DuckDB Rust client, duckdb-rs , is an ergonomic wrapper over the DuckDB C API that exposes an i ... tch() , and results are read by preparing a statement and mapping each row to a Rust value with query_map() : use duckdb::{params, Connection, Result}; #[derive(Debug)] struct Person { id: i32, name: String, data: Option<Vec<u8>>, } fn main() -> Result ... Person { id: 0, name: "Steven".to_string(), data: None, }; conn.execute( "INSERT INTO person (name, data) VALUES (?, ?)", params![me.name, me.data], )?; let mut stmt = conn.prepare("SELECT id, name, data FROM person")?; let person_iter = stmt.query_ma ...
https://man.mtool.work/duckdb/2.0/clients/rust/overview.html
Relational API 7676
The Relational API builds a query one step at a time from Python. A relation, a DuckDBPyRelation , is a piece of SQL text: the methods of the Transformation and Functions sections return a new relation whose text extends the one they were c ... tatement passed to sql() , such as CREATE TABLE or INSERT , runs at the call, and the relation holds what it returned. The params list or dict is copied when the relation is created, and its values are converted each time the relation runs. A column is ... ation Alias of read_parquet() . from_query from_query(self: _duckdb.DuckDBPyConnection, query: object, *, alias: str = '', params: object = None) -> DuckDBPyRelation | None Alias of sql() . query query(self: _duckdb.DuckDBPyConnection, query: object, * ... , alias: str = '', params: object = None) -> DuckDBPyRelation | None Alias of sql() . read_csv read_csv(self: _duckdb.DuckDBPyConnection, *args: obj ...
https://man.mtool.work/duckdb/2.0/clients/python/relational_api.html
PREV 1 2 NEXT
DuckDB 2.0 Documentation / man.mtool.work