Results of 1 - 5 of about 5 for fetchmany (0.004 sec.)
- Python DB API 11895
- 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
...B using the execute() method of connections. Once a query has been executed, results can be retrieved using the fetchone , fetchmany and fetchall methods on the connection. fetchone() returns the next row, or None when no rows are left. fetchmany(size) re...rint(con.fetchall()) # retrieve the items one at a time con.execute("SELECT * FROM items") print(con.fetchone()) print(con.fetchmany(5)) print(con.fetchone()) 2 [('jeans', Decimal('20.00'), 1), ('hammer', Decimal('42.20'), 2)] ('jeans', Decimal('20.00'),...returns no rows, or until fetchall() , df() or fetchnumpy() reads the rest of it. After a partial read with fetchone() or fetchmany() , these methods return the rows not fetched yet. con.complete() runs an open result to its end without reading its rows,... - https://man.mtool.work/duckdb/2.0/clients/python/dbapi.html
- Conversion between DuckDB and Python 9891
- 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
...n methods: Result Relation DB-API 2.0 ( con.execute() ) Python tuples fetchall() , iter_rows(batch_size=1024) fetchone() , fetchmany(size=1) , fetchall() Python dicts to_dicts() NumPy fetchnumpy() fetchnumpy() Pandas df() df() , fetch_df_chunk() Apache Ar...) Relations are recommended for most conversion, except when you want to do row-based work. A relation has no fetchone() , fetchmany() or fetch_df_chunk() because it is stateless, i.e. it does not hold a result itself. To get specific rows of a result wit....fetchall() , iter_rows() or to_arrow_reader() instead. Note that with the DB-API, after a partial read with fetchone() or fetchmany() , the df() , fetchnumpy() and Arrow methods of the connection return only the remaining rows. Examples Below are some ex... - https://man.mtool.work/duckdb/2.0/clients/python/conversion.html
- Migrating Python Code to DuckDB 2.0 9891
- This page lists what Python code written for DuckDB 1.x must change to run on DuckDB 2.0. Each item gives the 1.x form, the 2.0 form and the page that explains it. For changes outside the Python client, see Migrating to DuckDB v2.0 . Python
..._arrow_reader() or con.sql(query).pl() . See Arrow and Polars Output . Fetching from a relation. 1.x: rel.fetchone() , rel.fetchmany(n) , rel.execute() and rel.fetch_df_chunk() . 2.0: these methods are gone, because a relation keeps no result between call...s and runs its query again on every read. To keep a fetchone() or fetchmany() loop for a SQL query, create its result with con.execute(query) instead of con.sql(query) . To iterate over an existing... - https://man.mtool.work/duckdb/2.0/clients/python/migration.html
- Python Client API 7372
- Connection class duckdb. Appender Bases: object append_row ( self , * args ) → None Buffer one row, one value per column, each converted as an executemany parameter would be append_rows ( self , rows : object ) → None Buffer each row of an
...wing execute fetchdf ( self , * , date_as_object : bool = False ) → object Fetch a result as DataFrame following execute() fetchmany ( self , size : int = 1 ) → list Fetch the next set of rows from a result following execute fetchnumpy ( self ) → dict Fet..., connection : _duckdb.DuckDBPyConnection | None = None ) → object Fetch a result as DataFrame following execute() duckdb. fetchmany ( size : int = 1 , * , connection : _duckdb.DuckDBPyConnection | None = None ) → list Fetch the next set of rows from a re... - https://man.mtool.work/duckdb/2.0/clients/python/reference/
- Relational API 6875
- 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
...ieve the first n rows from this relation object, starting at offset. To read the first rows into Python, as fetchone() and fetchmany() did on a relation before DuckDB 2.0, use rel.limit(1).fetchall() and rel.limit(n).fetchall() . To read all the rows a ba... - https://man.mtool.work/duckdb/2.0/clients/python/relational_api.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work