InfluxCommunity / influxdb3-go

The go package that provides a simple and convenient way to interact with InfluxDB 3.
https://pkg.go.dev/github.com/InfluxCommunity/influxdb3-go
MIT License
21 stars 11 forks source link

feat: query database optional #27

Closed Sciator closed 11 months ago

Sciator commented 1 year ago

Closes #25 Closes #26

Proposed Changes

Remove database argument from query and add it into client config as default:

client, err := influx.New(influx.Configs{
    HostURL:   url,
    AuthToken: token,
    Database: database,
})
// database not needed here, it's already defined in config
iterator, err := client.Query(context.Background(), query)

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #27 (a02260a) into main (8193854) will increase coverage by 0.47%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   78.59%   79.07%   +0.47%     
==========================================
  Files           8        8              
  Lines         528      540      +12     
==========================================
+ Hits          415      427      +12     
  Misses         97       97              
  Partials       16       16              
Impacted Files Coverage Δ
influx/client.go 88.46% <ø> (ø)
influx/query.go 77.27% <100.00%> (+5.05%) :arrow_up:
alespour commented 11 months ago

Superceded by #30 with #31