-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconnector.go
75 lines (72 loc) · 1.95 KB
/
connector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package azuresql
import (
"math"
"github.com/kubemq-hub/builder/connector/common"
)
func Connector() *common.Connector {
return common.NewConnector().
SetKind("azure.stores.azuresql").
SetDescription("Azure SQL Target").
SetName("MSSQL").
SetProvider("Azure").
SetCategory("Store").
SetTags("sql", "db", "cloud", "managed").
AddProperty(
common.NewProperty().
SetKind("string").
SetName("connection").
SetTitle("Connection String").
SetDescription("Set Azuresql connection string").
SetMust(true).
SetDefault("server=server.net;user id=test;password=test;port=1433;database=initial_db;"),
).
AddProperty(
common.NewProperty().
SetKind("int").
SetName("max_idle_connections").
SetDescription("Set Azuresql max idle connections").
SetMust(false).
SetDefault("10").
SetMin(1).
SetMax(math.MaxInt32),
).
AddProperty(
common.NewProperty().
SetKind("int").
SetName("max_open_connections").
SetDescription("Set Azuresql max open connections").
SetMust(false).
SetDefault("100").
SetMin(1).
SetMax(math.MaxInt32),
).
AddProperty(
common.NewProperty().
SetKind("int").
SetName("connection_max_lifetime_seconds").
SetTitle("Connection Lifetime (Seconds)").
SetDescription("Set Azuresql connection max lifetime seconds").
SetMust(false).
SetDefault("3600").
SetMin(1).
SetMax(math.MaxInt32),
).
AddMetadata(
common.NewMetadata().
SetName("method").
SetKind("string").
SetDescription("Set Azuresql execution method").
SetOptions([]string{"query", "exec", "transaction"}).
SetDefault("query").
SetMust(true),
).
AddMetadata(
common.NewMetadata().
SetName("isolation_level").
SetKind("string").
SetDescription("Set Azuresql isolation level").
SetOptions([]string{"Default", "ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"}).
SetDefault("Default").
SetMust(false),
)
}