slingdata-io / sling-cli

Sling is a CLI tool that extracts data from a source storage/database and loads it in a target storage/database.
https://docs.slingdata.io
GNU General Public License v3.0
299 stars 16 forks source link

create row for every sample #278

Closed sleepybishop closed 2 months ago

sleepybishop commented 2 months ago

When setting a range and step what will result in multiple samples for that range, only one row is being created and its fields overwritten for every sample.

This pr moves the creation of the row within the loop that pulls the sample data as well as appending after each row is filled in.

Lastly uses of sample.Timestamp.Time() are replaced with sample.Timestamp.Unix() since that is more closer to the output from the api. Might be worth hooking into slings datetime formatting options, but im not yet familiar enough with sling-cli to know how to do that.

flarco commented 2 months ago

Thanks, makes sense. I'll leave the sample.Timestamp.Unix(), but you forgot to change the column type here to integer. I'll do that in branch 1.2.7.