File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed
Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -51,31 +51,35 @@ pip install -e .[dev]
5151### 🐍 Python usage:
5252
5353``` python
54+ from insert_tools.runner import InsertConfig, run_insert
5455
55- from insert_tools.pipeline import InsertPipeline
56- from insert_tools.sink.clickhouse import ClickhouseSink
57-
58- pipeline = InsertPipeline(
56+ config = InsertConfig(
57+ host = " localhost " ,
58+ database = " default " ,
59+ target_table = " my_table " ,
5960 select_sql = " SELECT * FROM source_table" ,
60- sink = ClickhouseSink(
61- host = " localhost" ,
62- database = " default" ,
63- target_table = " my_table" ,
64- user = " default" ,
65- password = " admin123" ,
66- ),
61+ user = " default" ,
62+ password = " admin123" ,
6763 allow_type_cast = True ,
68- strict_column_match = True ,
64+ strict_column_match = True
6965)
7066
71- pipeline.run( )
67+ run_insert(config )
7268```
7369
7470### 🖥️ CLI usage:
7571
7672``` bash
77- python -m insert_tools.cli \
78- --config path/to/config.yaml \
73+ insert-tools \
74+ --host localhost \
75+ --port 8123 \
76+ --user default \
77+ --password admin123 \
78+ --database default \
79+ --target_table my_table \
80+ --select_sql " SELECT * FROM source_table" \
81+ --allow_type_cast \
82+ --strict \
7983 --dry-run \
8084 --verbose
8185```
You can’t perform that action at this time.
0 commit comments