⌘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 gadget (0.000 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 ... xecute("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.append_row("giz ... mo", 1) with con.appender("stock", action="update", key=["sku"]) as appender: appender.append_row("gadget", 0) with con.appender("stock", action="delete", key=["sku"]) as appender: appender.append_row("gizmo") print(con.sql("SEL ... ECT * 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. ...
https://man.mtool.work/duckdb/2.0/clients/python/appender.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work