Skip to content

How to write a set of data in one query? #110

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

Closed
youngzhaozju opened this issue Mar 15, 2022 · 7 comments
Closed

How to write a set of data in one query? #110

youngzhaozju opened this issue Mar 15, 2022 · 7 comments

Comments

@youngzhaozju
Copy link

Hi,
Thanks for the nice project. I want to write some series of data in a time, but I found the client.query() can handel only a series record a time. Is there any way to write may records in a time?
Thank you!
Regards,
Yang

@deeprobin
Copy link

I am also interested in a solution for this.
/cc @msrd0

@Empty2k12
Copy link
Collaborator

Feel free to open a PR which adds batch inserting. Should not be very hard to implement.

@sdether
Copy link
Contributor

sdether commented Jun 9, 2022

I'm also looking for bulk writing of lines and I'd be interested in providing a PR, but i'm not sure I read the terminology in this library correctly. It looks like client.query() with a WriteQuery hits the /write endpoint. Does that mean that a WriteQuery.get produces a line protocol from an InfluxDbWriteable? If so would a reasonable interface for bulk inserts look like a new BulkWriteQuery which can be constructed from an iterable of InfluxDbWriteable and itself contains an iterable of WriteQuery so that it can then generate a post body of line feed separated line protocols? Thx.

@sdether
Copy link
Contributor

sdether commented Jun 15, 2022

Ok, never mind. v0.5.2 already has support for Vec<WriteQuery> as a query type for client.query(). Looking at the code, this was added in #87 back on 3/6/21. I just tested the code and it works, so this issue should be closed, unless I mis-read the request.

@Empty2k12
Copy link
Collaborator

Ah, right. Maybe you can update the Readme Supported Features and add it there?

@sdether
Copy link
Contributor

sdether commented Jun 15, 2022

Updated: #112

@Empty2k12
Copy link
Collaborator

Closing this, as the README has been updated in #112 to document the bulk write capacity.

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

4 participants