mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Add tests for Couchbase v1 NoSQL queries
This commit is contained in:
@@ -2,4 +2,13 @@ module main
|
||||
|
||||
go 1.14
|
||||
|
||||
require go.mongodb.org/mongo-driver v1.3.2
|
||||
require (
|
||||
github.com/google/uuid v1.1.4 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
go.mongodb.org/mongo-driver v1.3.2
|
||||
gopkg.in/couchbase/gocb.v1 v1.6.7
|
||||
gopkg.in/couchbase/gocbcore.v7 v7.1.18 // indirect
|
||||
gopkg.in/couchbaselabs/gocbconnstr.v1 v1.0.4 // indirect
|
||||
gopkg.in/couchbaselabs/gojcbmock.v1 v1.0.4 // indirect
|
||||
gopkg.in/couchbaselabs/jsonx.v1 v1.0.0 // indirect
|
||||
)
|
||||
|
||||
@@ -2,10 +2,13 @@ package main
|
||||
|
||||
//go:generate depstubber -vendor go.mongodb.org/mongo-driver/bson/primitive D
|
||||
//go:generate depstubber -vendor go.mongodb.org/mongo-driver/mongo Collection,Pipeline
|
||||
//go:generate depstubber -vendor gopkg.in/couchbase/gocb.v1 Bucket,Cluster
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
gocbv1 "gopkg.in/couchbase/gocb.v1"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
@@ -49,4 +52,11 @@ func test(coll *mongo.Collection, filter interface{}, models []mongo.WriteModel,
|
||||
coll.Watch(ctx, pipeline) // $nosqlquery=pipeline
|
||||
}
|
||||
|
||||
func testGocbV1(bucket gocbv1.Bucket, cluster gocbv1.Cluster, aq *gocbv1.AnalyticsQuery, nq *gocbv1.N1qlQuery) {
|
||||
bucket.ExecuteAnalyticsQuery(aq, nil) // $nosqlquery=aq
|
||||
cluster.ExecuteAnalyticsQuery(aq, nil) // $nosqlquery=aq
|
||||
bucket.ExecuteN1qlQuery(nq, nil) // $nosqlquery=nq
|
||||
cluster.ExecuteN1qlQuery(nq, nil) // $nosqlquery=nq
|
||||
}
|
||||
|
||||
func main() {}
|
||||
|
||||
1273
ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/gopkg.in/couchbase/gocb.v1/stub.go
generated
vendored
Normal file
1273
ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/gopkg.in/couchbase/gocb.v1/stub.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,24 @@
|
||||
# go.mongodb.org/mongo-driver v1.3.2
|
||||
## explicit
|
||||
go.mongodb.org/mongo-driver
|
||||
# github.com/google/uuid v1.1.4
|
||||
## explicit
|
||||
github.com/google/uuid
|
||||
# github.com/opentracing/opentracing-go v1.2.0
|
||||
## explicit
|
||||
github.com/opentracing/opentracing-go
|
||||
# gopkg.in/couchbase/gocb.v1 v1.6.7
|
||||
## explicit
|
||||
gopkg.in/couchbase/gocb.v1
|
||||
# gopkg.in/couchbase/gocbcore.v7 v7.1.18
|
||||
## explicit
|
||||
gopkg.in/couchbase/gocbcore.v7
|
||||
# gopkg.in/couchbaselabs/gocbconnstr.v1 v1.0.4
|
||||
## explicit
|
||||
gopkg.in/couchbaselabs/gocbconnstr.v1
|
||||
# gopkg.in/couchbaselabs/gojcbmock.v1 v1.0.4
|
||||
## explicit
|
||||
gopkg.in/couchbaselabs/gojcbmock.v1
|
||||
# gopkg.in/couchbaselabs/jsonx.v1 v1.0.0
|
||||
## explicit
|
||||
gopkg.in/couchbaselabs/jsonx.v1
|
||||
|
||||
Reference in New Issue
Block a user