-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add ToPoint
type class.
#2
base: master
Are you sure you want to change the base?
Conversation
Main reason of adding this feature is to allow submitting custom domain models to InfluxDB without constructing Point instance every time.
@@ -12,12 +14,13 @@ class Database protected[influxdbclient] | |||
with RetentionPolicyManagement | |||
with DatabaseManagement | |||
{ | |||
def write(point: Point, | |||
|
|||
def write[A](metric: A, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not care about binary compatibility this time because artifact is being published under another group
* // ... | ||
* } | ||
* }}} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these examples too verbose? @razem-io what do you think?
Also, @razem-io, what do you think about adding same semantics for |
Hey @aaabramov , I made a quick example, which also compiles and does not change the code of the library:
|
This is exactly the approach I am currently using in my projects. If you think it should not be on library level so we can decline this one. As I said previously:
|
Moreover, I prefer using type classes rather than implicit conversions because they are way more flexible and clear. |
I also thought about it, let's just do it. It won't change the current api and just makes things easier. Support for bulk sounds good. |
Main reason of adding this feature is to allow submitting
custom domain models to InfluxDB without constructing Point instance
every time.