Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you add async_insert to options? #145

Open
SlavaVV opened this issue Nov 20, 2021 · 2 comments
Open

Could you add async_insert to options? #145

SlavaVV opened this issue Nov 20, 2021 · 2 comments

Comments

@SlavaVV
Copy link

SlavaVV commented Nov 20, 2021

This is new feature for CH. Allows to avoid using buffer tables

New asynchronous INSERT mode allows to accumulate inserted data and store it in a single batch in background.

https://clickhouse.com/docs/ru/operations/settings/settings/#async-insert - by default=0

@SlavaVV
Copy link
Author

SlavaVV commented Nov 20, 2021

For now it solved adding user's profile. Maybe add to library not too problematic

<?xml version="1.0"?>
<yandex>
	<profiles>
		<http_writer>
			<async_insert>1</async_insert>
		</http_writer>
	</profiles>
	<users>
		<gen_writer>
			<profile>http_writer</profile>
		</gen_writer>
	</users>
</yandex>

@DoubleDi
Copy link
Collaborator

DoubleDi commented Dec 13, 2021

Hi! Sorry for the late reply. In the current opts implementation you can pass any valid clickhouse option and it will be proxied to all the requests.
Consider adding &async_insert=1 to your dsn or add it in cfg.Params

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants