Async Insert
punky97 opened this issue · 1 comments
punky97 commented
Hi
I am trying to implement async_insert like this document ( link ).
I cloned query's settings called InsertSettings, it's been append into the query before "VALUES"
func (q *InsertQuery) AppendQuery(fmter chschema.Formatter, b []byte) (_ []byte, err error) {
...
b, err = q.appendInsertSettings(fmter, b)
if err != nil {
return nil, err
}
b, err = q.appendValues(fmter, b)
if err != nil {
return nil, err
}
...
}
The result looks like that
clDb.NewInsert().Model(&list).ModelTableExpr("example_table").InsertSetting("async_insert=1").InsertSetting("wait_for_async_insert=1").Exec(ctx)
=> INSERT INTO example_table ("col1", "col2") SETTINGS async_insert= 1, wait_for_async_insert= 1 VALUES
But it's seem doesnt work. The query doesn't appear in system.asynchronous_insert_log
.
If I run the insert query directly using con.Exec("Insert...."), it still do async insert right way.
Can any help me to implement async insert using ch_insert ?
Sorry for my bad English
Thanks
punky97 commented
Close issue
executeQuery: Setting async_insert=1, but INSERT query will be executed synchronously (reason: insert query doesn't have inlined data)