From 4316c39197e5b082e24f8412b8288ed5c5c07117 Mon Sep 17 00:00:00 2001 From: Mir Ansar Date: Tue, 14 May 2024 14:56:29 +0530 Subject: [PATCH] Added sybase support. (#495) Signed-off-by: Mir Ansar --- go.mod | 4 ++-- go.sum | 8 ++++---- internal/inputs/database.go | 6 +++--- internal/load/load.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 30c7cf96..b3a3b5db 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/itchyny/gojq v0.12.12 github.com/jeremywohl/flatten v1.0.1 github.com/lib/pq v1.10.9 + github.com/newrelic-experimental/go-ase v1.2.0 github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible github.com/parnurzeal/gorequest v0.2.15 github.com/pkg/errors v0.9.1 @@ -41,8 +42,6 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect - github.com/SAP/go-ase v0.0.0-20230911093826-e06baafeece3 // indirect - github.com/SAP/go-dblib v0.0.0-20220825075032-c1f3f4d6e7b3 // indirect github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect @@ -74,6 +73,7 @@ require ( github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/moul/http2curl v1.0.0 // indirect + github.com/newrelic-experimental/go-dblib v1.2.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect diff --git a/go.sum b/go.sum index 0d4ed00e..8941d710 100644 --- a/go.sum +++ b/go.sum @@ -56,10 +56,6 @@ github.com/MonetDB/MonetDB-Go v1.0.2 h1:ovqY//8De9OzoJJbc1YkW4peNfGdLTgQhjc+fhBr github.com/MonetDB/MonetDB-Go v1.0.2/go.mod h1:camniXrjGJnMoXXgZWhUY+2nKPVfjKmcA5mmrjuV2+A= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/SAP/go-ase v0.0.0-20230911093826-e06baafeece3 h1:S2BdRIWytdt7gHV+39ZC9Fl8PbQlhlnWmBfQTy7iSUg= -github.com/SAP/go-ase v0.0.0-20230911093826-e06baafeece3/go.mod h1:RJNsL+XbiV4Ux3aTLlk5WIQy6kq6VW7OvAasNkq3j4U= -github.com/SAP/go-dblib v0.0.0-20220825075032-c1f3f4d6e7b3 h1:bX6dkWrQMTAO8IwVGZqXoNdWjZVQ3YnRU01p+x4X+Jw= -github.com/SAP/go-dblib v0.0.0-20220825075032-c1f3f4d6e7b3/go.mod h1:pyB1BEipxjxMcCYlymW+x6sgucc0N45V7LVPUnpDr/I= github.com/SAP/go-hdb v0.107.3 h1:tX7CI+fsUFVNzR9LIAuX1mzyzRtuMiUkvuVVUgNSGss= github.com/SAP/go-hdb v0.107.3/go.mod h1:EAlLPK5So38imnv2/aBADHZBjl76RVIWvu9Tkiu6LbY= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= @@ -263,6 +259,10 @@ github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3P github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/newrelic-experimental/go-ase v1.2.0 h1:l9JN00pX+AUolLEvjCIiOXGiQxTsYW5YBrtsnMhss7k= +github.com/newrelic-experimental/go-ase v1.2.0/go.mod h1:phLmGUg0sxUkaNXqj752lG0PX7ElZkR/JyRZ7nJiWFc= +github.com/newrelic-experimental/go-dblib v1.2.0 h1:Dm0r9PdvbgjHKgpUxo78qehLfqP2Hy1mdm0NY2M1cQ8= +github.com/newrelic-experimental/go-dblib v1.2.0/go.mod h1:B8su1WE/yk105iCtDKvsWolUkg+LHYQvBxocCDrqCtA= github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible h1:Ktcm1aPAl7CW3o+FXAIKJ+jygWVXDXaUIWFyf2CXQTk= github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible/go.mod h1:tMUHRMq6mJS0YyBnbWrTXAnREnQqC1AGO6Lu45u5xAM= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= diff --git a/internal/inputs/database.go b/internal/inputs/database.go index c2b17a68..ab6d7f0f 100644 --- a/internal/inputs/database.go +++ b/internal/inputs/database.go @@ -25,11 +25,11 @@ import ( //Database Drivers _ "github.com/MonetDB/MonetDB-Go/src" //MonetDB - // _ "github.com/SAP/go-ase" //Sybase _ "github.com/SAP/go-hdb/driver" //SAP HANA _ "github.com/denisenkom/go-mssqldb" //mssql | sql-server _ "github.com/go-sql-driver/mysql" //mysql _ "github.com/lib/pq" //postgres + _ "github.com/newrelic-experimental/go-ase" //Sybases _ "github.com/sijms/go-ora/v2" //Oracle vertigo "github.com/vertica/vertica-sql-go" //HP Vertica // @@ -228,8 +228,8 @@ func setDatabaseDriver(database, driver string, yml *load.Config, api load.API) return load.DefaultMySQL case "oracle": return load.DefaultOracle - // case "sybase", "ase": - // return load.DefaultSybase + case "sybase", "ase": + return load.DefaultSybase case "monetdb": return load.DefaultMonetDB case "hana", "go-hdb", "hdb": diff --git a/internal/load/load.go b/internal/load/load.go index 91f8bfb0..7b3f044f 100644 --- a/internal/load/load.go +++ b/internal/load/load.go @@ -119,7 +119,7 @@ const ( DefaultMSSQLServer = "sqlserver" DefaultMySQL = "mysql" DefaultOracle = "oracle" - // DefaultSybase = "ase" + DefaultSybase = "ase" DefaultMonetDB = "monetdb" DefaultVertica = "vertica" DefaultJmxHost = "127.0.0.1"