Results of 1 - 10 of about 36 for conn (0.003 sec.)
- Relational API 13043
- 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
...mns and their types, and holds no data. For example, a relation over a billion rows is built at once: import duckdb duckdb_conn = duckdb.connect() rel = duckdb_conn.sql("FROM range(1_000_000_000) t(id) SELECT id, id % 7 AS bucket") print(rel.sql_quer...the current data. Printing a relation, or calling show() , also runs it and displays the first rows: import duckdb duckdb_conn = duckdb.connect() rel = duckdb_conn.sql("FROM range(1_000_000_000) t(id) SELECT id, id % 7 AS bucket") rel.filter("bucket...since rel.offset is the offset() method. To run a query once and keep its rows, call materialize() : import duckdb duckdb_conn = duckdb.connect() duckdb_conn.sql("CREATE TABLE items (id INTEGER)") counted = duckdb_conn.sql("SELECT count(*) AS n FROM... - https://man.mtool.work/duckdb/2.0/clients/python/relational_api.html
- ODBC Extension Functions 11379
- 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) ->
...VARCHAR Sets the SQL_ATTR_AUTOCOMMIT attribute to SQL_AUTOCOMMIT_OFF on the specified connection thus effectively starting an implicit transaction. odbc_commit or odbc_rollback must be called on such connection to...complete the transaction. The completion starts another implicit transaction on this connection. See Transaction management for details. Parameters: conn_handle ( BIGINT ): ODBC connection handle created with odb...c_connect Returns: Always returns NULL ( VARCHAR ). Example: SELECT odbc_begin_transaction(getvariable('conn')) odbc_bind_params... - https://man.mtool.work/duckdb/2.0/core_extensions/odbc/functions.html
- Run Queries 10745
- Overview DuckDB-Wasm provides functions for querying data. Queries are run sequentially: First, create a connection by calling connect . Then, run queries by calling query to materialize the whole result, or send to fetch result chunks lazi
...they are produced — useful for large results that you would rather stream than hold in memory all at once: // Create a new connection const conn = await db.connect(); // Either materialize the query result await conn.query<{ v: arrow.Int }>(` SELECT...* FROM generate_series(1, 100) t(v) `); // ..., or fetch the result chunks lazily for await (const batch of await conn.send<{ v: arrow.Int }>(` SELECT * FROM generate_series(1, 100) t(v) `)) { // ... } // Close the connection to release memo...ry await conn.close(); Prepared Statements Prepared statements let you parse a query once and run it repeatedly with different parameter... - https://man.mtool.work/duckdb/2.0/clients/wasm/query.html
- Import Data 9794
- Overview DuckDB-Wasm has multiple ways to import data, depending on the format of the data. Importing happens in two steps. The data file is registered in a virtual file system using one of the register functions ( registerFileBuffer , regi
...ileText , registerFileURL ). These are called on the database object ( db ), because a registered file is visible to every connection. The data is loaded into DuckDB using one of the insert functions ( insertArrowFromIPCStream , insertArrowTable , in...sertCSVFromPath , insertJSONFromPath ), which are called on a connection ( conn ). Alternatively, the Parquet, JSON, or Wasm-flavored httpfs extensions can read a registered — or remote — f...ile directly from a FROM SQL query, and INSERT statements can load values inline. The examples below all use a connection named conn , opened from the db object created when you instantiate DuckDB-Wasm . Opening and Closing a Connection E... - https://man.mtool.work/duckdb/2.0/clients/wasm/data_ingestion.html
- Connect 9398
- Overview The Go client works through the standard database/sql types: a *sql.DB is a pool of connections to a DuckDB database. This page covers opening in-memory and file-backed databases, passing DuckDB configuration options, running initi
...alization steps with a Connector , the client's thread-safety and connection-lifetime rules, and closing a database cleanly. Opening a Database sql.Op...ase: created if it does not exist. db, err := sql.Open("duckdb", "/path/to/foo.db") sql.Open() does not necessarily open a connection: it validates its arguments and returns a *sql.DB that opens connections lazily. Call db.Ping() to verify that the d...l processes can read it at once. The full list of options is on the Configuration page . Options can also be changed after connecting with a SET statement . Running Initialization Steps with a Connector To run setup statements before any query, or to... - https://man.mtool.work/duckdb/2.0/clients/go/connecting.html
- Run Queries 9208
- Overview Java applications send queries and read result sets through the familiar Statement , PreparedStatement , and ResultSet interfaces. This page covers sending queries and reading DuckDB's nested and composite types. For opening the Conn
...nnection these run on, see Define Connections . Sending Queries DuckDB supports the standard JDBC methods to send queries and retrieve result sets. First a State...ment object has to be created from the Connection , this object can then be used to send queries using execute() and executeQuery() . execute() is meant for queries w...results (e.g., SELECT ). Below are two examples. See also the JDBC Statement and ResultSet documentations. import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; Connection conn = DriverManage... - https://man.mtool.work/duckdb/2.0/clients/java/querying.html
- Profile and Monitor 9081
- 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
...is connection-local, so it is read from a *sql.Conn checked out with db.Conn() . Enable profiling on that connection with the enab...ofile, then read the result with duckdb.GetProfilingInfo() : db, err := sql.Open("duckdb", "") check(err) defer db.Close() conn, err := db.Conn(context.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 :... - https://man.mtool.work/duckdb/2.0/clients/go/profiling.html
- Connect 8891
- 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
...d-safety guarantees, and closing a connection are all covered below. Opening a Connection A Connection is created with Connection::open_in_memory() for an in-memo...ry database, or Connection::open(path) for a database file. Both return a Result , so the ? operator propagates any error: use duckdb::{Connect...ion, Result}; // In-memory database: nothing is persisted to disk. let conn = Connection::open_in_memory()?; // File-backed database: created if it does not exist. let conn = Connection::open("my_da... - https://man.mtool.work/duckdb/2.0/clients/rust/connecting.html
- Profile and Monitor 8716
- 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
...enabled on a connection before metrics are collected. Enable it with the enable_profiling PRAGMA , run a query, then read the result with ge...t_profiling_info() : use duckdb::Connection; let conn = Connection::open_in_memory()?; // Do not print profiling output to stdout after each query (the default...when profiling is enabled). conn.execute("PRAGMA enable_profiling = 'no_output'", [])?; conn.execute("SELECT 42", [])?; let info = conn.get_profiling_info(... - https://man.mtool.work/duckdb/2.0/clients/rust/profiling.html
- Run Queries 8669
- 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
...ctions below walk through sending statements, binding parameters, and turning rows into typed Rust values. For opening the Connection these run on, see Connect . Sending Statements Use execute() for a single statement that does not return rows, such...QL and a list of parameters, and returns the number of affected rows. Pass an empty slice [] when there are no parameters: conn.execute( "CREATE TABLE person (id INTEGER, name TEXT, data BLOB)", [], )?; let rows_changed = conn.execute( "INSERT INTO p...VALUES (1, 'Steven')", [], )?; To run several statements at once, for example a schema-setup script, use execute_batch() : conn.execute_batch( r"CREATE SEQUENCE seq; CREATE TABLE person ( id INTEGER PRIMARY KEY DEFAULT NEXTVAL('seq'), name TEXT NOT N... - https://man.mtool.work/duckdb/2.0/clients/rust/querying.html
DuckDB 2.0 Documentation / man.mtool.work