⌘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 12 for items (0.004 sec.)
Relational API 13248
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 ... ry 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 items") held = counted.materialize() duckdb_conn.sql(" ... INSERT INTO items VALUES (1), (2)") print(counted.fetchall(), held.fetchall()) [(2,)] [(0,)] Relation Creation This section contains the det ... ', 65, TRUE), (4, 'hammer', 'tools', 42, TRUE), (5, 'screwdriver', 'tools', 7, TRUE), (6, 'drill', 'tools', 89, TRUE) ) AS items(id, item, category, price, in_stock) """) rel.set_alias("my_relation").alias Result 'my_relation' columns Return a list co ...
https://man.mtool.work/duckdb/2.0/clients/python/relational_api.html
Python DB API 11479
The standard DuckDB Python API provides a SQL interface compliant with the DB-API 2.0 specification described by PEP 249 similar to the SQLite Python API . Connection To use the module, you must first create a DuckDBPyConnection object that ... mPy arrays. Below are some short examples: import duckdb con = duckdb.connect() # create a table con.execute("CREATE TABLE items (item VARCHAR, value DECIMAL(10, 2), count INTEGER)") # insert two items into the table con.execute("INSERT INTO items VAL ... UES ('jeans', 20.0, 1), ('hammer', 42.2, 2)") print(con.rowcount) # retrieve the items again con.execute("SELECT * FROM items") print(con.fetchall()) # retrieve the items one at a time con.execute("SELECT * FR ... OM items") print(con.fetchone()) print(con.fetchmany(5)) print(con.fetchone()) 2 [('jeans', Decimal('20.00'), 1), ('hammer', Decima ...
https://man.mtool.work/duckdb/2.0/clients/python/dbapi.html
R Client 9781
Installation To use the DuckDB R client, visit the R installation page . The latest stable version of the DuckDB R client is 2.0.0. Installation duckdb : R Client The DuckDB R client can be installed using the following command: install.pac ... used for queries that produce results (e.g., SELECT ). Below is an example. # create a table dbExecute(con, "CREATE TABLE items (item VARCHAR, value DECIMAL(10, 2), count INTEGER)") # insert two items into the table dbExecute(con, "INSERT INTO items ... VALUES ('jeans', 20.0, 1), ('hammer', 42.2, 2)") # retrieve the items again res <- dbGetQuery(con, "SELECT * FROM items") print(res) # item value count # 1 jeans 20.0 1 # 2 hammer 42.2 2 DuckD ... nd dbGetQuery methods. Here is an example: # prepared statement parameters are given as a list dbExecute(con, "INSERT INTO items VALUES (?, ?, ?)", list('laptop', 2000, 1)) # if you want to reuse a prepared statement multiple times, use dbSendStatemen ...
https://man.mtool.work/duckdb/2.0/clients/r.html
Run Queries 9392
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 Co ... nager.getConnection("jdbc:duckdb:"); // create a table Statement stmt = conn.createStatement(); stmt.execute("CREATE TABLE items (item VARCHAR, value DECIMAL(10, 2), count INTEGER)"); // insert two items into the table stmt.execute("INSERT INTO items ... VALUES ('jeans', 20.0, 1), ('hammer', 42.2, 2)"); try (ResultSet rs = stmt.executeQuery("SELECT * FROM items")) { while (rs.next()) { System.out.println(rs.getString(1)); System.out.println(rs.getInt(3)); } } stmt.close(); jeans 1 ... s as per the JDBC API: import java.sql.PreparedStatement; try (PreparedStatement stmt = conn.prepareStatement("INSERT INTO items VALUES (?, ?, ?);")) { stmt.setString(1, "chainsaw"); stmt.setDouble(2, 500.0); stmt.setInt(3, 42); stmt.execute(); // mor ...
https://man.mtool.work/duckdb/2.0/clients/java/querying.html
Conversion between DuckDB and Python 8454
This page documents the rules for converting DuckDB results to Python and Python objects to DuckDB . Result Conversion: DuckDB Results to Python A result is read from a relation or, when using the DB-API / con.execute() , from the connectio ... ython guides for more. To run the examples, use this table: import duckdb con = duckdb.connect() con.execute("CREATE TABLE items (item VARCHAR, value DECIMAL(10, 2), count INTEGER)") con.execute(""" INSERT INTO items VALUES ('jeans', 20.0, 1), ('hamme ... 2000.0, 1), ('chainsaw', 500.0, 10), ('iphone', 300.0, 2) """) Fetch as Pandas DataFrame: df = con.execute("SELECT * FROM items").df() print(df) item value count 0 jeans 20.0 1 1 hammer 42.2 2 2 laptop 2000.0 1 3 chainsaw 500.0 10 4 iphone 300.0 2 Fe ... tch as dictionary of NumPy arrays: arr = con.execute("SELECT * FROM items").fetchnumpy() print(arr) {'item': array(['jeans', 'hammer', 'laptop', 'chainsaw', 'iphone'], dtype=object), 'value': arra ...
https://man.mtool.work/duckdb/2.0/clients/python/conversion.html
Concurrency 7906
Handling Concurrency Single Process In in-process mode, DuckDB has two configurable options for concurrency: Read-write mode: one process can both read and write to the database. Read-only mode: multiple processes can read from the database ... back and forth to disk during each query. It also allows the caching of function pointers, the database catalog, and other items so that subsequent queries on the same connection are faster. Concurrency Model within a Single Process DuckDB supports co ...
https://man.mtool.work/duckdb/2.0/connect/concurrency.html
Node.js Client (Neo) 7711
Installation To use the DuckDB Node.js client, visit the Node.js installation page . The latest stable version of the DuckDB Node.js (Neo) client is 2.0.0. An API for using DuckDB in Node.js . The primary package, @duckdb/node-api , is a hi ... ct Data Values import { DuckDBTypeId } from '@duckdb/node-api'; if (columnType.typeId === DuckDBTypeId.ARRAY) { const arrayItems = columnValue.items; // array of values const arrayString = columnValue.toString(); } if (columnType.typeId === DuckDBType ... icros; // bigint const intervalString = columnValue.toString(); } if (columnType.typeId === DuckDBTypeId.LIST) { const listItems = columnValue.items; // array of values const listString = columnValue.toString(); } if (columnType.typeId === DuckDBTypeI ...
https://man.mtool.work/duckdb/2.0/clients/node_neo/overview.html
Friendly SQL 7711
DuckDB offers several advanced SQL features and syntactic sugar to make SQL queries more concise. We refer to these colloquially as “friendly SQL”. Several of these features were first introduced by DuckDB, while some are inspired by other ... ommas DuckDB allows trailing commas , both when listing entities (e.g., column and table names) and when constructing LIST items . For example, the following query works: SELECT 42 AS x, ['a', 'b', 'c',] AS y, 'hello world' AS z, ; "Top-N in Group" Qu ...
https://man.mtool.work/duckdb/2.0/sql/dialect/friendly_sql.html
CREATE SEQUENCE Statement 7711
The CREATE SEQUENCE statement creates a new sequence number generator. Examples Generate an ascending sequence starting from 1: CREATE SEQUENCE serial; Generate sequence from a given start number: CREATE SEQUENCE serial START 101; Generate ... WITH 1 MAXVALUE 10 CYCLE; Creating and Dropping Sequences Sequences can be created and dropped similarly to other catalog items. Overwrite an existing sequence: CREATE OR REPLACE SEQUENCE serial; Only create sequence if no such sequence exists yet: C ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_sequence.html
Vector Similarity Search Extension 7605
The vss extension is an experimental extension for DuckDB that adds indexing support to accelerate vector similarity search queries using DuckDB's new fixed-size ARRAY type. See the announcement blog post and the “What's New in the Vector S ... call the PRAGMA hnsw_compact_index('⟨index_name⟩') pragma function to trigger a re-compaction of the index pruning deleted items, or re-create the index after a significant number of updates. Bonus: Vector Similarity Search Joins The vss extension als ...
https://man.mtool.work/duckdb/2.0/core_extensions/vss.html
PREV 1 2 NEXT
DuckDB 2.0 Documentation / man.mtool.work