Skip to content

Commit 007c8fa

Browse files
committed
add '.attach DATABASE' option and example
1 parent aafd78c commit 007c8fa

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sqlite_bro/sqlite_bro.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,13 +1642,15 @@ def _main():
16421642
-- .separator COL Set column separator in next .once exports (default ,)
16431643
-- .once [--bom] FILE Output of next SQL command to FILE [with utf-8 bom]
16441644
-- .import FILE TABLE Import data from FILE into TABLE
1645-
-- (create table only if it doesn't exist, keep existing records)
1645+
-- (create TABLE only if it doesn't exist, keep existing records)
16461646
.headers on
16471647
.separator ;
16481648
.once --bom '~this_file_of_result.txt'
16491649
select ItemNo, Description from item order by ItemNo desc;
16501650
.import '~this_file_of_result.txt' in_this_table
1651-
1651+
.attach '~test.db'
1652+
DROP TABLE IF EXISTS test.new_item;
1653+
CREATE TABLE test.new_item as select * from "main"."item"
16521654
"""
16531655
app.n.new_query_tab("Welcome", welcome_text)
16541656
app.tk_win.mainloop()

0 commit comments

Comments
 (0)