• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geniusrabbit / eventstream / 3953294224

pending completion
3953294224

push

github

Dmitry Ponomarev
Configs fixes and improvements

147 of 219 new or added lines in 13 files covered. (67.12%)

20 existing lines in 1 file now uncovered.

718 of 1495 relevant lines covered (48.03%)

1.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/storage/sql/common.go
1
package sql
2

3
import (
4
        "time"
5

6
        "github.com/geniusrabbit/eventstream"
7
        "github.com/geniusrabbit/eventstream/stream"
8
)
9

10
type config struct {
11
        SQLQuery     string `json:"sql_query"`
12
        Target       string `json:"target"`
13
        BufferSize   uint   `json:"buffer_size"`
14
        WriteTimeout uint   `json:"write_timeout"`
15
        IterateBy    string `json:"iterate_by"`
16
        Fields       any    `json:"fields"`
17
}
18

19
// New stream for SQL type integrations
20
func New(connector Connector, pattern string, conf *stream.Config, options ...Option) (stream eventstream.Streamer, err error) {
×
21
        var config config
×
22
        if err = conf.Decode(&config); err != nil {
×
23
                return nil, err
×
24
        }
×
25
        if config.SQLQuery != `` {
×
NEW
26
                options = append(options, WithQuery(config.SQLQuery,
×
NEW
27
                        QWithIterateBy(config.IterateBy),
×
NEW
28
                        QWithMessageTmpl(config.Fields)))
×
29
        } else if config.Fields != nil {
×
NEW
30
                options = append(options, WithQuery(pattern,
×
NEW
31
                        QWithIterateBy(config.IterateBy),
×
NEW
32
                        QWithTarget(config.Target),
×
NEW
33
                        QWithMessageTmpl(config.Fields)))
×
34
        }
×
35
        return NewStreamSQL(
×
36
                conf.Name,
×
37
                connector,
×
38
                append(
×
39
                        []Option{
×
40
                                WithBlockSize(int(config.BufferSize)),
×
41
                                WithFlushIntervals(time.Duration(config.WriteTimeout) * time.Millisecond),
×
42
                                WithDebug(conf.Debug),
×
43
                        },
×
44
                        options...)...,
×
45
        )
×
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc