⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 1 of about 1 for widget (0.001 sec.)
Appender 9414
Use an appender to insert rows that your Python code produces. It collects rows and writes them together in one SQL statement; this is called flushing. The with block below flushes on successful exit: import duckdb con = duckdb.connect() co ... ique key. con.execute("CREATE TABLE stock (sku VARCHAR PRIMARY KEY, qty INTEGER)") con.execute("INSERT INTO stock VALUES ('widget', 3), ('gadget', 5)") with con.appender("stock", action="upsert") as appender: appender.append_row("widget", 10) appender. ... as appender: appender.append_row("gizmo") print(con.sql("SELECT * FROM stock ORDER BY sku").fetchall()) [('gadget', 0), ('widget', 10)] upsert runs an INSERT OR REPLACE , so the table needs exactly one primary key or unique constraint. It takes column ... you wrote it. con.execute("CREATE TABLE products (id INTEGER, sku VARCHAR)") con.execute("INSERT INTO products VALUES (1, 'widget'), (2, 'gadget')") con.execute("CREATE TABLE orders (product_id INTEGER, qty INTEGER)") appender = con.query_appender( "IN ...
https://man.mtool.work/duckdb/2.0/clients/python/appender.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work