From 19147eec408fa22df04bdee253bc03d38edc04c8 Mon Sep 17 00:00:00 2001 From: Ed Minnix Date: Mon, 3 Mar 2025 13:25:21 -0500 Subject: [PATCH 1/9] Add couchbase models --- .../ext/github.com.couchbase.gocb.model.yml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml index d17b53dd6da9..0881a2c966b6 100644 --- a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml +++ b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml @@ -9,6 +9,32 @@ extensions: - ["gocb2", "github.com/couchbase/gocb/v2"] - ["gocb2", "gopkg.in/couchbase/gocb.v2"] - ["gocb2", "github.com/couchbaselabs/gocb/v2"] + - addsTo: + pack: codeql/go-all + extensible: sourceModel + data: + - ["group:gocb1", "Cluster", True, "ExecuteAnalyticsQuery", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb1", "Cluster", True, "ExecuteN1qlQuery", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb1", "Cluster", True, "ExecuteSearchQuery", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Cluster", True, "AnalyticsQuery", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Cluster", True, "Query", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "Get", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "GetAndLock", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "GetAndTouch", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "GetAnyReplica", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "LookupIn", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "LookupInAllReplicas", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "LookupInAnyReplica", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Collection", True, "Scan", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Scope", True, "AnalyticsQuery", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "Scope", True, "Query", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "TransactionAttemptContext", True, "Get", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "TransactionAttemptContext", True, "GetReplicaFromPreferredServerGroup", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "TransactionAttemptContext", True, "Insert", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "TransactionAttemptContext", True, "Query", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "TransactionAttemptContext", True, "Replace", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "ViewIndexManager", True, "GetAllDesignDocuments", "", "", "ReturnValue[0]", "database", "manual"] + - ["group:gocb2", "ViewIndexManager", True, "GetDesignDocument", "", "", "ReturnValue[0]", "database", "manual"] - addsTo: pack: codeql/go-all extensible: sinkModel @@ -27,6 +53,9 @@ extensions: data: - ["group:gocb1", "", False, "NewAnalyticsQuery", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - ["group:gocb1", "", False, "NewN1qlQuery", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:gocb1", "AnalyticsResults", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb1", "AnalyticsResults", True, "Next", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb1", "AnalyticsResults", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb1", "AnalyticsQuery", True, "ContextId", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb1", "AnalyticsQuery", True, "Deferred", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb1", "AnalyticsQuery", True, "Pretty", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] @@ -43,3 +72,31 @@ extensions: - ["group:gocb1", "N1qlQuery", True, "ReadOnly", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb1", "N1qlQuery", True, "ScanCap", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb1", "N1qlQuery", True, "Timeout", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb1", "QueryResults", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb1", "QueryResults", True, "Next", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb1", "QueryResults", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb1", "SearchResults", True, "Hits", "", "", "Argument[receiver]", "ReturnValue.ArrayElement", "taint", "manual"] + - ["group:gocb2", "AnalyticsResult", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "AnalyticsResult", True, "Raw", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "AnalyticsResult", True, "Row", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "AnalyticsResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "GetResult", True, "Content", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "LookupInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] + - ["group:gocb2", "LookupInReplicaResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] + - ["group:gocb2", "LookupInAllReplicasResult", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "MutateInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] + - ["group:gocb2", "QueryResult", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "QueryResult", True, "Raw", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "QueryResult", True, "Row", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "QueryResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "ScanResult", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "ScanResultItem", True, "Content", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "SearchResult", True, "Raw", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "SearchResult", True, "Row", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "SearchResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "TransactionGetResult", True, "Content", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "TransactionQueryResult", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "TransactionQueryResult", True, "Row", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "ViewResult", True, "Raw", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "ViewResult", True, "Row", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:gocb2", "ViewResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"] From 04d9c941aad5cc10266819f52fce5b71800e24ea Mon Sep 17 00:00:00 2001 From: Ed Minnix Date: Mon, 3 Mar 2025 13:25:37 -0500 Subject: [PATCH 2/9] [test] Add couchbase database model tests --- .../local/database/test_couchbase_gocb_v1.go | 54 + .../local/database/test_couchbase_gocb_v2.go | 247 ++ .../vendor/github.com/couchbase/gocb/stub.go | 107 + .../github.com/couchbase/gocb/v2/stub.go | 3073 +++++++++++++++++ 4 files changed, 3481 insertions(+) create mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go create mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go create mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go create mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go new file mode 100644 index 000000000000..57e5dc26bbbd --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go @@ -0,0 +1,54 @@ +package test + +import "github.com/couchbase/gocb" + +func test_couchbase_gocb_v1_Cluster(cluster *gocb.Cluster, aq *gocb.AnalyticsQuery, n1ql *gocb.N1qlQuery, sq *gocb.SearchQuery) { + // Analytics + r1, err := cluster.ExecuteAnalyticsQuery(aq, nil) // $ source + + if err != nil { + return + } + + var user1, user2 User + + r1.One(&user1) + sink(user1) // $ hasTaintFlow="user1" + + for r1.Next(user2) { + sink(user2) // $ hasTaintFlow="user2" + } + + var b1 []byte + b1 = r1.NextBytes() + sink(b1) // $ hasTaintFlow="b1" + + // N1QL + r2, err := cluster.ExecuteN1qlQuery(n1ql, nil) // $ source + + if err != nil { + return + } + + var user3, user4 User + + r2.One(&user3) + sink(user3) // $ hasTaintFlow="user3" + + for r2.Next(user4) { + sink(user4) // $ hasTaintFlow="user4" + } + + var b2 []byte + b2 = r2.NextBytes() + sink(b2) // $ hasTaintFlow="b2" + + // Search + r3, err := cluster.ExecuteSearchQuery(sq) // $ source + + if err != nil { + return + } + + sink(r3) // $ hasTaintFlow="r3" +} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go new file mode 100644 index 000000000000..3309403688e4 --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go @@ -0,0 +1,247 @@ +package test + +//go:generate depstubber -vendor github.com/couchbase/gocb/v2 Cluster,Scope,Collection,TransactionAttemptContext,ViewIndexManager + +import "github.com/couchbase/gocb/v2" + +func test_couchbase_gocb_v2_Cluster(cluster *gocb.Cluster) { + r1, err := cluster.AnalyticsQuery("SELECT * FROM `travel-sample`", nil) // $ source + + if err != nil { + return + } + + for r1.Next() { + var name1, name2 string + + r1.One(&name1) + + sink(name1) // $ hasTaintFlow="name1" + + r1.Row(&name2) + sink(name2) // $ hasTaintFlow="name2" + + b := r1.Raw().NextBytes() + sink(b) // $ hasTaintFlow="b" + } + + r2, err := cluster.Query("SELECT * FROM `travel-sample`", nil) // $ source + + if err != nil { + return + } + + for r2.Next() { + var name1, name2 string + + r2.One(&name1) + + sink(name1) // $ hasTaintFlow="name1" + + r2.Row(&name2) + sink(name2) // $ hasTaintFlow="name2" + + b := r2.Raw().NextBytes() + sink(b) // $ hasTaintFlow="b" + } +} + +func test_couchbase_gocb_v2_Scope(scope *gocb.Scope) { + r1, err := scope.Query("SELECT * FROM `travel-sample`", nil) // $ source + + if err != nil { + return + } + + for r1.Next() { + var name1, name2 string + + r1.One(&name1) + + sink(name1) // $ hasTaintFlow="name1" + + r1.Row(&name2) + sink(name2) // $ hasTaintFlow="name2" + + b := r1.Raw().NextBytes() + sink(b) // $ hasTaintFlow="b" + } + + r2, err := scope.Query("SELECT * FROM `travel-sample`", nil) // $ source + + if err != nil { + return + } + + for r2.Next() { + var name1, name2 string + + r2.One(&name1) + + sink(name1) // $ hasTaintFlow="name1" + + r2.Row(&name2) + sink(name2) // $ hasTaintFlow="name2" + + b := r2.Raw().NextBytes() + sink(b) // $ hasTaintFlow="b" + } +} + +func test_couchbase_gocb_v2_Collection(coll *gocb.Collection) { + type User struct { + Name string + } + + var user User + + r1, err := coll.Get("documentID", nil) // $ source + + if err != nil { + return + } + + r1.Content(&user) + + sink(user) // $ hasTaintFlow="user" + + r2, err := coll.GetAndLock("documentID", 30, nil) // $ source + + if err != nil { + return + } + + sink(r2) // $ hasTaintFlow="r2" + + r3, err := coll.GetAndTouch("documentID", 30, nil) // $ source + + if err != nil { + return + } + + var user3 User + r3.Content(&user3) + sink(user3) // $ hasTaintFlow="user3" + + r4, err := coll.GetAnyReplica("documentID", nil) // $ source + + if err != nil { + return + } + + sink(r4) // $ hasTaintFlow="r4" + + r5, err := coll.LookupIn("documentID", []gocb.LookupInSpec{}, nil) // $ source + + if err != nil { + return + } + + var user5 User + r5.ContentAt(0, &user5) + sink(user5) // $ hasTaintFlow="user5" + + r6, err := coll.LookupInAllReplicas("documentID", []gocb.LookupInSpec{}, nil) // $ source + + if err != nil { + return + } + + var user6 User + r6.Next().ContentAt(0, &user6) + sink(user6) // $ hasTaintFlow="user6" + + r7, err := coll.LookupInAnyReplica("documentID", []gocb.LookupInSpec{}, nil) // $ source + + if err != nil { + return + } + + var user7 User + r7.ContentAt(0, &user7) + sink(user7) // $ hasTaintFlow="user7" + + r8, err := coll.Scan(nil, nil) // $ source + + if err != nil { + return + } + + var user8 User + r8.Next().Content(&user8) + sink(user8) // $ hasTaintFlow="user8" +} + +func test_couchbase_gocb_v2_TransactionAttemptContext(tam *gocb.TransactionAttemptContext, coll *gocb.Collection) { + r1, err := tam.Get(coll, "documentID") // $ source + + if err != nil { + return + } + + var user User + r1.Content(&user) + + sink(user) // $ hasTaintFlow="user" + + r2, err := tam.GetReplicaFromPreferredServerGroup(coll, "documentID") // $ source + + if err != nil { + return + } + + var user2 User + r2.Content(&user2) + sink(user2) // $ hasTaintFlow="user2" + + var user3 User + + r3, err := tam.Insert(coll, "documentID", &user3) // $ source + if err != nil { + return + } + + var user4 User + r3.Content(&user4) + sink(user4) // $ hasTaintFlow="user4" + + r4, err := tam.Query("SELECT * FROM `travel-sample`", nil) // $ source + if err != nil { + return + } + + for r4.Next() { + var user5 User + r4.One(&user5) + sink(user5) // $ hasTaintFlow="user5" + + var user6 User + r4.Row(&user6) + sink(user6) // $ hasTaintFlow="user6" + } + + r5, err := tam.Replace(r3, user4) // $ source + if err != nil { + return + } + + sink(r5) // $ hasTaintFlow="r5" +} + +func test_couchbase_gocb_v2_ViewIndexManager(v *gocb.ViewIndexManager) { + doc, err := v.GetDesignDocument("name", 0, nil) // $ source + + if err != nil { + return + } + + sink(doc) // $ hasTaintFlow="doc" + + docs, err := v.GetAllDesignDocuments(0, nil) // $ source + + if err != nil { + return + } + + sink(docs) // $ hasTaintFlow="docs" +} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go new file mode 100644 index 000000000000..58b61190f496 --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go @@ -0,0 +1,107 @@ +package gocb + +import "time" + +type Cluster struct{} + +func (c *Cluster) ExecuteAnalyticsQuery(q *AnalyticsQuery, options *AnalyticsOptions) (AnalyticsResult, error) { + return nil, nil +} + +func (c *Cluster) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (QueryResults, error) { + return nil, nil +} + +func (c *Cluster) ExecuteSearchQuery(q *SearchQuery) (SearchResult, error) { + return nil, nil +} + +type AnalyticsOptions struct{} + +type AnalyticsResult interface { + One(valuePtr interface{}) error + Next(valuePtr interface{}) bool + NextBytes() []byte + Close() error +} + +type AnalyticsQuery struct{} + +type N1qlQuery struct{} + +type QueryResults interface { + One(valuePtr interface{}) error + Next(valuePtr interface{}) bool + NextBytes() []byte + Close() error +} + +type SearchQuery struct{} + +type SearchResult interface { + Status() SearchResultStatus + Errors() []string + TotalHits() int + Hits() []SearchResultHit + Facets() map[string]SearchResultFacet + Took() time.Duration + MaxScore() float64 +} + +type SearchResultDateFacet struct { + Name string `json:"name,omitempty"` + Min string `json:"min,omitempty"` + Max string `json:"max,omitempty"` + Count int `json:"count,omitempty"` +} + +type SearchResultFacet struct { + Field string `json:"field,omitempty"` + Total int `json:"total,omitempty"` + Missing int `json:"missing,omitempty"` + Other int `json:"other,omitempty"` + Terms []SearchResultTermFacet `json:"terms,omitempty"` + NumericRanges []SearchResultNumericFacet `json:"numeric_ranges,omitempty"` + DateRanges []SearchResultDateFacet `json:"date_ranges,omitempty"` +} + +type SearchResultHit struct { + Index string `json:"index,omitempty"` + Id string `json:"id,omitempty"` + Score float64 `json:"score,omitempty"` + Explanation map[string]interface{} `json:"explanation,omitempty"` + Locations map[string]map[string][]SearchResultLocation `json:"locations,omitempty"` + Fragments map[string][]string `json:"fragments,omitempty"` + // Deprecated: See AllFields + Fields map[string]string `json:"-"` + // AllFields is to avoid making a breaking change changing the type of Fields. Only + // fields in the response that are of type string will be put into Fields, all + // field types will be placed into AllFields. + AllFields map[string]interface{} `json:"fields,omitempty"` +} + +type SearchResultLocation struct { + Position int `json:"position,omitempty"` + Start int `json:"start,omitempty"` + End int `json:"end,omitempty"` + ArrayPositions []uint `json:"array_positions,omitempty"` +} + +type SearchResultNumericFacet struct { + Name string `json:"name,omitempty"` + Min float64 `json:"min,omitempty"` + Max float64 `json:"max,omitempty"` + Count int `json:"count,omitempty"` +} + +type SearchResultStatus struct { + Total int `json:"total,omitempty"` + Failed int `json:"failed,omitempty"` + Successful int `json:"successful,omitempty"` + Errors interface{} `json:"errors,omitempty"` +} + +type SearchResultTermFacet struct { + Term string `json:"term,omitempty"` + Count int `json:"count,omitempty"` +} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go new file mode 100644 index 000000000000..e51d4d780ede --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go @@ -0,0 +1,3073 @@ +// Code generated by depstubber. DO NOT EDIT. +// This is a simple stub for github.com/couchbase/gocb/v2, strictly for use in testing. + +// See the LICENSE file for information about the licensing of the original library. +// Source: github.com/couchbase/gocb/v2 (exports: Cluster,Scope,Collection,TransactionAttemptContext,ViewIndexManager; functions: ) + +// Package gocb is a stub of github.com/couchbase/gocb/v2, generated by depstubber. +package gocb + +import ( + context "context" + time "time" +) + +type AllowQueryingSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type AnalyticsDataset struct { + Name string + DataverseName string + LinkName string + BucketName string +} + +type AnalyticsIndex struct { + Name string + DatasetName string + DataverseName string + IsPrimary bool +} + +type AnalyticsIndexManager struct{} + +func (_ *AnalyticsIndexManager) ConnectLink(_ *ConnectAnalyticsLinkOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) CreateDataset(_ string, _ string, _ *CreateAnalyticsDatasetOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) CreateDataverse(_ string, _ *CreateAnalyticsDataverseOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) CreateIndex(_ string, _ string, _ map[string]string, _ *CreateAnalyticsIndexOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) CreateLink(_ AnalyticsLink, _ *CreateAnalyticsLinkOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) DisconnectLink(_ *DisconnectAnalyticsLinkOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) DropDataset(_ string, _ *DropAnalyticsDatasetOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) DropDataverse(_ string, _ *DropAnalyticsDataverseOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) DropIndex(_ string, _ string, _ *DropAnalyticsIndexOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) DropLink(_ string, _ string, _ *DropAnalyticsLinkOptions) error { + return nil +} + +func (_ *AnalyticsIndexManager) GetAllDatasets(_ *GetAllAnalyticsDatasetsOptions) ([]AnalyticsDataset, error) { + return nil, nil +} + +func (_ *AnalyticsIndexManager) GetAllIndexes(_ *GetAllAnalyticsIndexesOptions) ([]AnalyticsIndex, error) { + return nil, nil +} + +func (_ *AnalyticsIndexManager) GetLinks(_ *GetAnalyticsLinksOptions) ([]AnalyticsLink, error) { + return nil, nil +} + +func (_ *AnalyticsIndexManager) GetPendingMutations(_ *GetPendingMutationsAnalyticsOptions) (map[string]map[string]int, error) { + return nil, nil +} + +func (_ *AnalyticsIndexManager) ReplaceLink(_ AnalyticsLink, _ *ReplaceAnalyticsLinkOptions) error { + return nil +} + +type AnalyticsLink interface { + DataverseName() string + FormEncode() ([]byte, error) + LinkType() AnalyticsLinkType + Name() string + Validate() error +} + +type AnalyticsLinkType string + +type AnalyticsMetaData struct { + RequestID string + ClientContextID string + Metrics AnalyticsMetrics + Signature interface{} + Warnings []AnalyticsWarning +} + +type AnalyticsMetrics struct { + ElapsedTime time.Duration + ExecutionTime time.Duration + ResultCount uint64 + ResultSize uint64 + MutationCount uint64 + SortCount uint64 + ErrorCount uint64 + WarningCount uint64 + ProcessedObjects uint64 +} + +type AnalyticsOptions struct { + ClientContextID string + Priority bool + PositionalParameters []interface{} + NamedParameters map[string]interface{} + Readonly bool + ScanConsistency AnalyticsScanConsistency + Raw map[string]interface{} + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type AnalyticsResult struct{} + +func (_ *AnalyticsResult) Close() error { + return nil +} + +func (_ *AnalyticsResult) Err() error { + return nil +} + +func (_ *AnalyticsResult) MetaData() (*AnalyticsMetaData, error) { + return nil, nil +} + +func (_ *AnalyticsResult) Next() bool { + return false +} + +func (_ *AnalyticsResult) One(_ interface{}) error { + return nil +} + +func (_ *AnalyticsResult) Raw() *AnalyticsResultRaw { + return nil +} + +func (_ *AnalyticsResult) Row(_ interface{}) error { + return nil +} + +type AnalyticsResultRaw struct{} + +func (_ *AnalyticsResultRaw) Close() error { + return nil +} + +func (_ *AnalyticsResultRaw) Err() error { + return nil +} + +func (_ *AnalyticsResultRaw) MetaData() ([]byte, error) { + return nil, nil +} + +func (_ *AnalyticsResultRaw) NextBytes() []byte { + return nil +} + +type AnalyticsScanConsistency uint + +type AnalyticsWarning struct { + Code uint32 + Message string +} + +type AnalyzeDocumentOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type AppendOptions struct { + Timeout time.Duration + DurabilityLevel DurabilityLevel + PersistTo uint + ReplicateTo uint + Cas Cas + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type AttemptFunc func(*TransactionAttemptContext) error + +type AuthDomain string + +type BinaryCollection struct{} + +func (_ *BinaryCollection) Append(_ string, _ []byte, _ *AppendOptions) (*MutationResult, error) { + return nil, nil +} + +func (_ *BinaryCollection) Decrement(_ string, _ *DecrementOptions) (*CounterResult, error) { + return nil, nil +} + +func (_ *BinaryCollection) Increment(_ string, _ *IncrementOptions) (*CounterResult, error) { + return nil, nil +} + +func (_ *BinaryCollection) Prepend(_ string, _ []byte, _ *PrependOptions) (*MutationResult, error) { + return nil, nil +} + +type Bucket struct{} + +func (_ *Bucket) Collection(_ string) *Collection { + return nil +} + +func (_ *Bucket) Collections() *CollectionManager { + return nil +} + +func (_ *Bucket) CollectionsV2() *CollectionManagerV2 { + return nil +} + +func (_ *Bucket) DefaultCollection() *Collection { + return nil +} + +func (_ *Bucket) DefaultScope() *Scope { + return nil +} + +func (_ *Bucket) Internal() *InternalBucket { + return nil +} + +func (_ *Bucket) Name() string { + return "" +} + +func (_ *Bucket) Ping(_ *PingOptions) (*PingResult, error) { + return nil, nil +} + +func (_ *Bucket) Scope(_ string) *Scope { + return nil +} + +func (_ *Bucket) ViewIndexes() *ViewIndexManager { + return nil +} + +func (_ *Bucket) ViewQuery(_ string, _ string, _ *ViewOptions) (*ViewResult, error) { + return nil, nil +} + +func (_ *Bucket) WaitUntilReady(_ time.Duration, _ *WaitUntilReadyOptions) error { + return nil +} + +type BucketManager struct{} + +func (_ *BucketManager) CreateBucket(_ CreateBucketSettings, _ *CreateBucketOptions) error { + return nil +} + +func (_ *BucketManager) DropBucket(_ string, _ *DropBucketOptions) error { + return nil +} + +func (_ *BucketManager) FlushBucket(_ string, _ *FlushBucketOptions) error { + return nil +} + +func (_ *BucketManager) GetAllBuckets(_ *GetAllBucketsOptions) (map[string]BucketSettings, error) { + return nil, nil +} + +func (_ *BucketManager) GetBucket(_ string, _ *GetBucketOptions) (*BucketSettings, error) { + return nil, nil +} + +func (_ *BucketManager) UpdateBucket(_ BucketSettings, _ *UpdateBucketOptions) error { + return nil +} + +type BucketSettings struct { + Name string + FlushEnabled bool + ReplicaIndexDisabled bool + RAMQuotaMB uint64 + NumReplicas uint32 + BucketType BucketType + EvictionPolicy EvictionPolicyType + MaxTTL time.Duration + MaxExpiry time.Duration + CompressionMode CompressionMode + MinimumDurabilityLevel DurabilityLevel + StorageBackend StorageBackend + HistoryRetentionCollectionDefault HistoryRetentionCollectionDefault + HistoryRetentionBytes uint64 + HistoryRetentionDuration time.Duration +} + +type BucketType string + +type BuildDeferredQueryIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} + +type BulkOp interface{} + +type BulkOpOptions struct { + Timeout time.Duration + Transcoder Transcoder + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type Capability uint32 + +type CapabilityStatus uint32 + +type Cas uint64 + +type ChangePasswordOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type Cluster struct{} + +func (_ *Cluster) AnalyticsIndexes() *AnalyticsIndexManager { + return nil +} + +func (_ *Cluster) AnalyticsQuery(_ string, _ *AnalyticsOptions) (*AnalyticsResult, error) { + return nil, nil +} + +func (_ *Cluster) Bucket(_ string) *Bucket { + return nil +} + +func (_ *Cluster) Buckets() *BucketManager { + return nil +} + +func (_ *Cluster) Close(_ *ClusterCloseOptions) error { + return nil +} + +func (_ *Cluster) Diagnostics(_ *DiagnosticsOptions) (*DiagnosticsResult, error) { + return nil, nil +} + +func (_ *Cluster) EventingFunctions() *EventingFunctionManager { + return nil +} + +func (_ *Cluster) Internal() *InternalCluster { + return nil +} + +func (_ *Cluster) Ping(_ *PingOptions) (*PingResult, error) { + return nil, nil +} + +func (_ *Cluster) Query(_ string, _ *QueryOptions) (*QueryResult, error) { + return nil, nil +} + +func (_ *Cluster) QueryIndexes() *QueryIndexManager { + return nil +} + +func (_ *Cluster) Search(_ string, _ SearchRequest, _ *SearchOptions) (*SearchResult, error) { + return nil, nil +} + +func (_ *Cluster) SearchIndexes() *SearchIndexManager { + return nil +} + +func (_ *Cluster) SearchQuery(_ string, _ interface{}, _ *SearchOptions) (*SearchResult, error) { + return nil, nil +} + +func (_ *Cluster) Transactions() *Transactions { + return nil +} + +func (_ *Cluster) Users() *UserManager { + return nil +} + +func (_ *Cluster) WaitUntilReady(_ time.Duration, _ *WaitUntilReadyOptions) error { + return nil +} + +type ClusterCloseOptions struct{} + +type ClusterState uint + +type Collection struct{} + +func (_ *Collection) Binary() *BinaryCollection { + return nil +} + +func (_ *Collection) Bucket() *Bucket { + return nil +} + +func (_ *Collection) Do(_ []BulkOp, _ *BulkOpOptions) error { + return nil +} + +func (_ *Collection) Exists(_ string, _ *ExistsOptions) (*ExistsResult, error) { + return nil, nil +} + +func (_ *Collection) Get(_ string, _ *GetOptions) (*GetResult, error) { + return nil, nil +} + +func (_ *Collection) GetAllReplicas(_ string, _ *GetAllReplicaOptions) (*GetAllReplicasResult, error) { + return nil, nil +} + +func (_ *Collection) GetAndLock(_ string, _ time.Duration, _ *GetAndLockOptions) (*GetResult, error) { + return nil, nil +} + +func (_ *Collection) GetAndTouch(_ string, _ time.Duration, _ *GetAndTouchOptions) (*GetResult, error) { + return nil, nil +} + +func (_ *Collection) GetAnyReplica(_ string, _ *GetAnyReplicaOptions) (*GetReplicaResult, error) { + return nil, nil +} + +func (_ *Collection) Insert(_ string, _ interface{}, _ *InsertOptions) (*MutationResult, error) { + return nil, nil +} + +func (_ *Collection) List(_ string) *CouchbaseList { + return nil +} + +func (_ *Collection) LookupIn(_ string, _ []LookupInSpec, _ *LookupInOptions) (*LookupInResult, error) { + return nil, nil +} + +func (_ *Collection) LookupInAllReplicas(_ string, _ []LookupInSpec, _ *LookupInAllReplicaOptions) (*LookupInAllReplicasResult, error) { + return nil, nil +} + +func (_ *Collection) LookupInAnyReplica(_ string, _ []LookupInSpec, _ *LookupInAnyReplicaOptions) (*LookupInReplicaResult, error) { + return nil, nil +} + +func (_ *Collection) Map(_ string) *CouchbaseMap { + return nil +} + +func (_ *Collection) MutateIn(_ string, _ []MutateInSpec, _ *MutateInOptions) (*MutateInResult, error) { + return nil, nil +} + +func (_ *Collection) Name() string { + return "" +} + +func (_ *Collection) QueryIndexes() *CollectionQueryIndexManager { + return nil +} + +func (_ *Collection) Queue(_ string) *CouchbaseQueue { + return nil +} + +func (_ *Collection) Remove(_ string, _ *RemoveOptions) (*MutationResult, error) { + return nil, nil +} + +func (_ *Collection) Replace(_ string, _ interface{}, _ *ReplaceOptions) (*MutationResult, error) { + return nil, nil +} + +func (_ *Collection) Scan(_ ScanType, _ *ScanOptions) (*ScanResult, error) { + return nil, nil +} + +func (_ *Collection) ScopeName() string { + return "" +} + +func (_ *Collection) Set(_ string) *CouchbaseSet { + return nil +} + +func (_ *Collection) Touch(_ string, _ time.Duration, _ *TouchOptions) (*MutationResult, error) { + return nil, nil +} + +func (_ *Collection) Unlock(_ string, _ Cas, _ *UnlockOptions) error { + return nil +} + +func (_ *Collection) Upsert(_ string, _ interface{}, _ *UpsertOptions) (*MutationResult, error) { + return nil, nil +} + +type CollectionHistorySettings struct { + Enabled bool +} + +type CollectionManager struct{} + +func (_ *CollectionManager) CreateCollection(_ CollectionSpec, _ *CreateCollectionOptions) error { + return nil +} + +func (_ *CollectionManager) CreateScope(_ string, _ *CreateScopeOptions) error { + return nil +} + +func (_ *CollectionManager) DropCollection(_ CollectionSpec, _ *DropCollectionOptions) error { + return nil +} + +func (_ *CollectionManager) DropScope(_ string, _ *DropScopeOptions) error { + return nil +} + +func (_ *CollectionManager) GetAllScopes(_ *GetAllScopesOptions) ([]ScopeSpec, error) { + return nil, nil +} + +func (_ *CollectionManager) UpdateCollection(_ CollectionSpec, _ *UpdateCollectionOptions) error { + return nil +} + +type CollectionManagerV2 struct{} + +func (_ *CollectionManagerV2) CreateCollection(_ string, _ string, _ *CreateCollectionSettings, _ *CreateCollectionOptions) error { + return nil +} + +func (_ *CollectionManagerV2) CreateScope(_ string, _ *CreateScopeOptions) error { + return nil +} + +func (_ *CollectionManagerV2) DropCollection(_ string, _ string, _ *DropCollectionOptions) error { + return nil +} + +func (_ *CollectionManagerV2) DropScope(_ string, _ *DropScopeOptions) error { + return nil +} + +func (_ *CollectionManagerV2) GetAllScopes(_ *GetAllScopesOptions) ([]ScopeSpec, error) { + return nil, nil +} + +func (_ *CollectionManagerV2) UpdateCollection(_ string, _ string, _ UpdateCollectionSettings, _ *UpdateCollectionOptions) error { + return nil +} + +type CollectionQueryIndexManager struct{} + +func (_ *CollectionQueryIndexManager) BuildDeferredIndexes(_ *BuildDeferredQueryIndexOptions) ([]string, error) { + return nil, nil +} + +func (_ *CollectionQueryIndexManager) CreateIndex(_ string, _ []string, _ *CreateQueryIndexOptions) error { + return nil +} + +func (_ *CollectionQueryIndexManager) CreatePrimaryIndex(_ *CreatePrimaryQueryIndexOptions) error { + return nil +} + +func (_ *CollectionQueryIndexManager) DropIndex(_ string, _ *DropQueryIndexOptions) error { + return nil +} + +func (_ *CollectionQueryIndexManager) DropPrimaryIndex(_ *DropPrimaryQueryIndexOptions) error { + return nil +} + +func (_ *CollectionQueryIndexManager) GetAllIndexes(_ *GetAllQueryIndexesOptions) ([]QueryIndex, error) { + return nil, nil +} + +func (_ *CollectionQueryIndexManager) WatchIndexes(_ []string, _ time.Duration, _ *WatchQueryIndexOptions) error { + return nil +} + +type CollectionSpec struct { + Name string + ScopeName string + MaxExpiry time.Duration + History *CollectionHistorySettings +} + +type CompressionMode string + +type ConflictResolutionType string + +type ConnectAnalyticsLinkOptions struct { + LinkName string + DataverseName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CouchbaseList struct{} + +func (_ *CouchbaseList) Append(_ interface{}) error { + return nil +} + +func (_ *CouchbaseList) At(_ int, _ interface{}) error { + return nil +} + +func (_ *CouchbaseList) Clear() error { + return nil +} + +func (_ *CouchbaseList) IndexOf(_ interface{}) (int, error) { + return 0, nil +} + +func (_ *CouchbaseList) Iterator() ([]interface{}, error) { + return nil, nil +} + +func (_ *CouchbaseList) Prepend(_ interface{}) error { + return nil +} + +func (_ *CouchbaseList) RemoveAt(_ int) error { + return nil +} + +func (_ *CouchbaseList) Size() (int, error) { + return 0, nil +} + +type CouchbaseMap struct{} + +func (_ *CouchbaseMap) Add(_ string, _ interface{}) error { + return nil +} + +func (_ *CouchbaseMap) At(_ string, _ interface{}) error { + return nil +} + +func (_ *CouchbaseMap) Clear() error { + return nil +} + +func (_ *CouchbaseMap) Exists(_ string) (bool, error) { + return false, nil +} + +func (_ *CouchbaseMap) Iterator() (map[string]interface{}, error) { + return nil, nil +} + +func (_ *CouchbaseMap) Keys() ([]string, error) { + return nil, nil +} + +func (_ *CouchbaseMap) Remove(_ string) error { + return nil +} + +func (_ *CouchbaseMap) Size() (int, error) { + return 0, nil +} + +func (_ *CouchbaseMap) Values() ([]interface{}, error) { + return nil, nil +} + +type CouchbaseQueue struct{} + +func (_ *CouchbaseQueue) Clear() error { + return nil +} + +func (_ *CouchbaseQueue) Iterator() ([]interface{}, error) { + return nil, nil +} + +func (_ *CouchbaseQueue) Pop(_ interface{}) error { + return nil +} + +func (_ *CouchbaseQueue) Push(_ interface{}) error { + return nil +} + +func (_ *CouchbaseQueue) Size() (int, error) { + return 0, nil +} + +type CouchbaseSet struct{} + +func (_ *CouchbaseSet) Add(_ interface{}) error { + return nil +} + +func (_ *CouchbaseSet) Clear() error { + return nil +} + +func (_ *CouchbaseSet) Contains(_ string) (bool, error) { + return false, nil +} + +func (_ *CouchbaseSet) Iterator() ([]interface{}, error) { + return nil, nil +} + +func (_ *CouchbaseSet) Remove(_ string) error { + return nil +} + +func (_ *CouchbaseSet) Size() (int, error) { + return 0, nil +} + +func (_ *CouchbaseSet) Values() ([]interface{}, error) { + return nil, nil +} + +type CounterResult struct { + MutationResult MutationResult +} + +func (_ CounterResult) Cas() Cas { + return 0 +} + +func (_ CounterResult) Content() uint64 { + return 0 +} + +func (_ CounterResult) MutationToken() *MutationToken { + return nil +} + +type CreateAnalyticsDatasetOptions struct { + IgnoreIfExists bool + Condition string + DataverseName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CreateAnalyticsDataverseOptions struct { + IgnoreIfExists bool + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CreateAnalyticsIndexOptions struct { + IgnoreIfExists bool + DataverseName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CreateAnalyticsLinkOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CreateBucketOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CreateBucketSettings struct { + BucketSettings BucketSettings + ConflictResolutionType ConflictResolutionType +} + +type CreateCollectionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type CreateCollectionSettings struct { + MaxExpiry time.Duration + History *CollectionHistorySettings +} + +type CreatePrimaryQueryIndexOptions struct { + IgnoreIfExists bool + Deferred bool + CustomName string + NumReplicas int + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} + +type CreateQueryIndexOptions struct { + IgnoreIfExists bool + Deferred bool + NumReplicas int + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} + +type CreateScopeOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DecrementOptions struct { + Timeout time.Duration + Expiry time.Duration + Initial int64 + Delta uint64 + DurabilityLevel DurabilityLevel + PersistTo uint + ReplicateTo uint + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Cas Cas + Context context.Context + Internal struct { + User string + } +} + +type DeployEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DesignDocument struct { + Name string + Views map[string]View +} + +type DesignDocumentNamespace uint + +type DiagnosticsOptions struct { + ReportID string +} + +type DiagnosticsResult struct { + ID string + Services map[string][]EndPointDiagnostics + State ClusterState +} + +func (_ *DiagnosticsResult) MarshalJSON() ([]byte, error) { + return nil, nil +} + +type DisallowQueryingSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DisconnectAnalyticsLinkOptions struct { + LinkName string + DataverseName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropAnalyticsDatasetOptions struct { + IgnoreIfNotExists bool + DataverseName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropAnalyticsDataverseOptions struct { + IgnoreIfNotExists bool + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropAnalyticsIndexOptions struct { + IgnoreIfNotExists bool + DataverseName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropAnalyticsLinkOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropBucketOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropCollectionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropDesignDocumentOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropGroupOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropPrimaryQueryIndexOptions struct { + IgnoreIfNotExists bool + CustomName string + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} + +type DropQueryIndexOptions struct { + IgnoreIfNotExists bool + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} + +type DropScopeOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type DropUserOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + DomainName string + ParentSpan RequestSpan + Context context.Context +} + +type DurabilityLevel uint8 + +type EndPointDiagnostics struct { + Type ServiceType + ID string + Local string + Remote string + LastActivity time.Time + State EndpointState + Namespace string +} + +type EndpointPingReport struct { + ID string + Local string + Remote string + State PingState + Error string + Namespace string + Latency time.Duration +} + +type EndpointState uint + +type EventingFunction struct { + Name string + Code string + Version string + EnforceSchema bool + HandlerUUID int + FunctionInstanceID string + MetadataKeyspace EventingFunctionKeyspace + SourceKeyspace EventingFunctionKeyspace + BucketBindings []EventingFunctionBucketBinding + UrlBindings []EventingFunctionUrlBinding + ConstantBindings []EventingFunctionConstantBinding + Settings EventingFunctionSettings +} + +func (_ *EventingFunction) MarshalJSON() ([]byte, error) { + return nil, nil +} + +func (_ *EventingFunction) UnmarshalJSON(_ []byte) error { + return nil +} + +type EventingFunctionBucketAccess string + +type EventingFunctionBucketBinding struct { + Alias string + Name EventingFunctionKeyspace + Access EventingFunctionBucketAccess +} + +type EventingFunctionConstantBinding struct { + Alias string + Literal string +} + +type EventingFunctionDCPBoundary string + +type EventingFunctionDeploymentStatus bool + +type EventingFunctionKeyspace struct { + Bucket string + Scope string + Collection string +} + +type EventingFunctionLanguageCompatibility string + +type EventingFunctionLogLevel string + +type EventingFunctionManager struct{} + +func (_ *EventingFunctionManager) DeployFunction(_ string, _ *DeployEventingFunctionOptions) error { + return nil +} + +func (_ *EventingFunctionManager) DropFunction(_ string, _ *DropEventingFunctionOptions) error { + return nil +} + +func (_ *EventingFunctionManager) FunctionsStatus(_ *EventingFunctionsStatusOptions) (*EventingStatus, error) { + return nil, nil +} + +func (_ *EventingFunctionManager) GetAllFunctions(_ *GetAllEventingFunctionsOptions) ([]EventingFunction, error) { + return nil, nil +} + +func (_ *EventingFunctionManager) GetFunction(_ string, _ *GetEventingFunctionOptions) (*EventingFunction, error) { + return nil, nil +} + +func (_ *EventingFunctionManager) PauseFunction(_ string, _ *PauseEventingFunctionOptions) error { + return nil +} + +func (_ *EventingFunctionManager) ResumeFunction(_ string, _ *ResumeEventingFunctionOptions) error { + return nil +} + +func (_ *EventingFunctionManager) UndeployFunction(_ string, _ *UndeployEventingFunctionOptions) error { + return nil +} + +func (_ *EventingFunctionManager) UpsertFunction(_ EventingFunction, _ *UpsertEventingFunctionOptions) error { + return nil +} + +type EventingFunctionProcessingStatus bool + +type EventingFunctionSettings struct { + CPPWorkerThreadCount int + DCPStreamBoundary EventingFunctionDCPBoundary + Description string + DeploymentStatus EventingFunctionDeploymentStatus + ProcessingStatus EventingFunctionProcessingStatus + LanguageCompatibility EventingFunctionLanguageCompatibility + LogLevel EventingFunctionLogLevel + ExecutionTimeout time.Duration + LCBInstCapacity int + LCBRetryCount int + LCBTimeout time.Duration + QueryConsistency QueryScanConsistency + NumTimerPartitions int + SockBatchSize int + TickDuration time.Duration + TimerContextSize int + UserPrefix string + BucketCacheSize int + BucketCacheAge int + CurlMaxAllowedRespSize int + QueryPrepareAll bool + WorkerCount int + HandlerHeaders []string + HandlerFooters []string + EnableAppLogRotation bool + AppLogDir string + AppLogMaxSize int + AppLogMaxFiles int + CheckpointInterval time.Duration +} + +type EventingFunctionState struct { + Name string + Status EventingFunctionStatus + NumBootstrappingNodes int + NumDeployedNodes int + DeploymentStatus EventingFunctionDeploymentStatus + ProcessingStatus EventingFunctionProcessingStatus +} + +type EventingFunctionStatus string + +type EventingFunctionUrlAuth interface { + Key() string + Method() string + Password() string + Username() string +} + +type EventingFunctionUrlBinding struct { + Hostname string + Alias string + Auth EventingFunctionUrlAuth + AllowCookies bool + ValidateSSLCertificate bool +} + +type EventingFunctionsStatusOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type EventingStatus struct { + NumEventingNodes int + Functions []EventingFunctionState +} + +func (_ *EventingStatus) UnmarshalJSON(_ []byte) error { + return nil +} + +type EvictionPolicyType string + +type ExistsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type ExistsResult struct { + Result Result +} + +func (_ *ExistsResult) Cas() Cas { + return 0 +} + +func (_ *ExistsResult) Exists() bool { + return false +} + +type FlushBucketOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type FreezePlanSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllAnalyticsDatasetsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllAnalyticsIndexesOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllBucketsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllDesignDocumentsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllEventingFunctionsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllGroupsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllQueryIndexesOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} + +type GetAllReplicaOptions struct { + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ReadPreference ReadPreference + Context context.Context + Internal struct { + User string + } +} + +type GetAllReplicasResult struct{} + +func (_ *GetAllReplicasResult) Close() error { + return nil +} + +func (_ *GetAllReplicasResult) Next() *GetReplicaResult { + return nil +} + +type GetAllScopesOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetAllUsersOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + DomainName string + ParentSpan RequestSpan + Context context.Context +} + +type GetAnalyticsLinksOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Dataverse string + LinkType AnalyticsLinkType + Name string + Context context.Context +} + +type GetAndLockOptions struct { + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type GetAndTouchOptions struct { + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type GetAnyReplicaOptions struct { + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ReadPreference ReadPreference + Context context.Context + Internal struct { + User string + } +} + +type GetBucketOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetDesignDocumentOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetGroupOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetIndexedDocumentsCountOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetNodesMetadataOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetOptions struct { + WithExpiry bool + Project []string + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type GetPendingMutationsAnalyticsOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetReplicaResult struct { + GetResult GetResult +} + +func (_ *GetReplicaResult) Cas() Cas { + return 0 +} + +func (_ *GetReplicaResult) Content(_ interface{}) error { + return nil +} + +func (_ *GetReplicaResult) Expiry() *time.Duration { + return nil +} + +func (_ *GetReplicaResult) ExpiryTime() time.Time { + return time.Time{} +} + +func (_ *GetReplicaResult) IsReplica() bool { + return false +} + +type GetResult struct { + Result Result +} + +func (_ *GetResult) Cas() Cas { + return 0 +} + +func (_ *GetResult) Content(_ interface{}) error { + return nil +} + +func (_ *GetResult) Expiry() *time.Duration { + return nil +} + +func (_ *GetResult) ExpiryTime() time.Time { + return time.Time{} +} + +type GetRolesOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type GetUserOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + DomainName string + ParentSpan RequestSpan + Context context.Context +} + +type Group struct { + Name string + Description string + Roles []Role + LDAPGroupReference string +} + +type HistoryRetentionCollectionDefault uint8 + +type IncrementOptions struct { + Timeout time.Duration + Expiry time.Duration + Initial int64 + Delta uint64 + DurabilityLevel DurabilityLevel + PersistTo uint + ReplicateTo uint + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Cas Cas + Context context.Context + Internal struct { + User string + } +} + +type InsertOptions struct { + Expiry time.Duration + PersistTo uint + ReplicateTo uint + DurabilityLevel DurabilityLevel + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type InternalBucket struct{} + +func (_ *InternalBucket) CapabilityStatus(_ Capability) (CapabilityStatus, error) { + return 0, nil +} + +func (_ *InternalBucket) IORouter() (interface{}, error) { + return nil, nil +} + +type InternalCluster struct{} + +func (_ *InternalCluster) GetNodesMetadata(_ *GetNodesMetadataOptions) ([]NodeMetadata, error) { + return nil, nil +} + +type InternalTransactionAttemptContext struct{} + +func (_ *InternalTransactionAttemptContext) IsExpired() bool { + return false +} + +type LogLevel int + +type LookupInAllReplicaOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ReadPreference ReadPreference + Context context.Context + Internal struct { + DocFlags SubdocDocFlag + User string + } +} + +type LookupInAllReplicasResult struct{} + +func (_ *LookupInAllReplicasResult) Close() error { + return nil +} + +func (_ *LookupInAllReplicasResult) Next() *LookupInReplicaResult { + return nil +} + +type LookupInAnyReplicaOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ReadPreference ReadPreference + Context context.Context + Internal struct { + DocFlags SubdocDocFlag + User string + } +} + +type LookupInOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + DocFlags SubdocDocFlag + User string + } +} + +type LookupInReplicaResult struct { + LookupInResult *LookupInResult +} + +func (_ LookupInReplicaResult) Cas() Cas { + return 0 +} + +func (_ LookupInReplicaResult) ContentAt(_ uint, _ interface{}) error { + return nil +} + +func (_ LookupInReplicaResult) Exists(_ uint) bool { + return false +} + +func (_ *LookupInReplicaResult) IsReplica() bool { + return false +} + +type LookupInResult struct { + Result Result +} + +func (_ *LookupInResult) Cas() Cas { + return 0 +} + +func (_ *LookupInResult) ContentAt(_ uint, _ interface{}) error { + return nil +} + +func (_ *LookupInResult) Exists(_ uint) bool { + return false +} + +type LookupInSpec struct{} + +type MutateInOptions struct { + Expiry time.Duration + Cas Cas + PersistTo uint + ReplicateTo uint + DurabilityLevel DurabilityLevel + StoreSemantic StoreSemantics + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + PreserveExpiry bool + Context context.Context + Internal struct { + DocFlags SubdocDocFlag + User string + } +} + +type MutateInResult struct { + MutationResult MutationResult +} + +func (_ MutateInResult) ContentAt(_ uint, _ interface{}) error { + return nil +} + +func (_ MutateInResult) MutationToken() *MutationToken { + return nil +} + +func (_ *MutateInResult) Cas() Cas { + return 0 +} + +type MutateInSpec struct{} + +type MutationResult struct { + Result Result +} + +func (_ MutationResult) MutationToken() *MutationToken { + return nil +} + +func (_ *MutationResult) Cas() Cas { + return 0 +} + +type MutationState struct{} + +func (_ *MutationState) Add(_ ...MutationToken) {} + +func (_ *MutationState) Internal() *MutationStateInternal { + return nil +} + +func (_ *MutationState) MarshalJSON() ([]byte, error) { + return nil, nil +} + +func (_ *MutationState) UnmarshalJSON(_ []byte) error { + return nil +} + +type MutationStateInternal struct{} + +func (_ *MutationStateInternal) Add(_ string, _ ...interface{}) {} + +func (_ *MutationStateInternal) Tokens() []MutationToken { + return nil +} + +type MutationToken struct{} + +func (_ MutationToken) BucketName() string { + return "" +} + +func (_ MutationToken) PartitionID() uint64 { + return 0 +} + +func (_ MutationToken) PartitionUUID() uint64 { + return 0 +} + +func (_ MutationToken) SequenceNumber() uint64 { + return 0 +} + +type NodeMetadata struct { + ClusterCompatibility int + ClusterMembership string + CouchAPIBase string + Hostname string + InterestingStats map[string]float64 + MCDMemoryAllocated float64 + MCDMemoryReserved float64 + MemoryFree float64 + MemoryTotal float64 + OS string + Ports map[string]int + Status string + Uptime int + Version string + ThisNode bool +} + +type Origin struct { + Type string + Name string +} + +type PauseEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type PauseIngestSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type PingOptions struct { + ServiceTypes []ServiceType + ReportID string + Timeout time.Duration + ParentSpan RequestSpan + Context context.Context +} + +type PingResult struct { + ID string + Services map[ServiceType][]EndpointPingReport +} + +func (_ *PingResult) MarshalJSON() ([]byte, error) { + return nil, nil +} + +type PingState uint + +type PrependOptions struct { + Timeout time.Duration + DurabilityLevel DurabilityLevel + PersistTo uint + ReplicateTo uint + Cas Cas + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type PublishDesignDocumentOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type QueryIndex struct { + Name string + IsPrimary bool + Type QueryIndexType + State string + Keyspace string + Namespace string + IndexKey []string + Condition string + Partition string + CollectionName string + ScopeName string + BucketName string +} + +type QueryIndexManager struct{} + +func (_ *QueryIndexManager) BuildDeferredIndexes(_ string, _ *BuildDeferredQueryIndexOptions) ([]string, error) { + return nil, nil +} + +func (_ *QueryIndexManager) CreateIndex(_ string, _ string, _ []string, _ *CreateQueryIndexOptions) error { + return nil +} + +func (_ *QueryIndexManager) CreatePrimaryIndex(_ string, _ *CreatePrimaryQueryIndexOptions) error { + return nil +} + +func (_ *QueryIndexManager) DropIndex(_ string, _ string, _ *DropQueryIndexOptions) error { + return nil +} + +func (_ *QueryIndexManager) DropPrimaryIndex(_ string, _ *DropPrimaryQueryIndexOptions) error { + return nil +} + +func (_ *QueryIndexManager) GetAllIndexes(_ string, _ *GetAllQueryIndexesOptions) ([]QueryIndex, error) { + return nil, nil +} + +func (_ *QueryIndexManager) WatchIndexes(_ string, _ []string, _ time.Duration, _ *WatchQueryIndexOptions) error { + return nil +} + +type QueryIndexType string + +type QueryMetaData struct { + RequestID string + ClientContextID string + Status QueryStatus + Metrics QueryMetrics + Signature interface{} + Warnings []QueryWarning + Profile interface{} +} + +type QueryMetrics struct { + ElapsedTime time.Duration + ExecutionTime time.Duration + ResultCount uint64 + ResultSize uint64 + MutationCount uint64 + SortCount uint64 + ErrorCount uint64 + WarningCount uint64 +} + +type QueryOptions struct { + ScanConsistency QueryScanConsistency + ConsistentWith *MutationState + Profile QueryProfileMode + ScanCap uint32 + PipelineBatch uint32 + PipelineCap uint32 + ScanWait time.Duration + Readonly bool + MaxParallelism uint32 + ClientContextID string + PositionalParameters []interface{} + NamedParameters map[string]interface{} + Metrics bool + Raw map[string]interface{} + Adhoc bool + Timeout time.Duration + RetryStrategy RetryStrategy + FlexIndex bool + PreserveExpiry bool + ParentSpan RequestSpan + Context context.Context + AsTransaction *SingleQueryTransactionOptions + UseReplica QueryUseReplicaLevel + Internal struct { + User string + Endpoint string + } +} + +type QueryProfileMode string + +type QueryResult struct{} + +func (_ *QueryResult) Close() error { + return nil +} + +func (_ *QueryResult) Err() error { + return nil +} + +func (_ *QueryResult) Internal() *QueryResultInternal { + return nil +} + +func (_ *QueryResult) MetaData() (*QueryMetaData, error) { + return nil, nil +} + +func (_ *QueryResult) Next() bool { + return false +} + +func (_ *QueryResult) One(_ interface{}) error { + return nil +} + +func (_ *QueryResult) Raw() *QueryResultRaw { + return nil +} + +func (_ *QueryResult) Row(_ interface{}) error { + return nil +} + +type QueryResultInternal struct{} + +func (_ *QueryResultInternal) Endpoint() string { + return "" +} + +type QueryResultRaw struct{} + +func (_ *QueryResultRaw) Close() error { + return nil +} + +func (_ *QueryResultRaw) Err() error { + return nil +} + +func (_ *QueryResultRaw) MetaData() ([]byte, error) { + return nil, nil +} + +func (_ *QueryResultRaw) NextBytes() []byte { + return nil +} + +type QueryScanConsistency uint + +type QueryStatus string + +type QueryUseReplicaLevel uint + +type QueryWarning struct { + Code uint32 + Message string +} + +type ReadPreference uint8 + +type RemoveOptions struct { + Cas Cas + PersistTo uint + ReplicateTo uint + DurabilityLevel DurabilityLevel + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type ReplaceAnalyticsLinkOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type ReplaceOptions struct { + Expiry time.Duration + Cas Cas + PersistTo uint + ReplicateTo uint + DurabilityLevel DurabilityLevel + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + PreserveExpiry bool + Context context.Context + Internal struct { + User string + } +} + +type RequestSpan interface { + AddEvent(_ string, _ time.Time) + Context() RequestSpanContext + End() + SetAttribute(_ string, _ interface{}) +} + +type RequestSpanContext interface{} + +type Result struct{} + +func (_ *Result) Cas() Cas { + return 0 +} + +type ResumeEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type ResumeIngestSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type RetryAction interface { + Duration() time.Duration +} + +type RetryReason interface { + AllowsNonIdempotentRetry() bool + AlwaysRetry() bool + Description() string +} + +type RetryRequest interface { + Idempotent() bool + Identifier() string + RetryAttempts() uint32 + RetryReasons() []RetryReason +} + +type RetryStrategy interface { + RetryAfter(_ RetryRequest, _ RetryReason) RetryAction +} + +type Role struct { + Name string + Bucket string + Scope string + Collection string +} + +type RoleAndDescription struct { + Role Role + DisplayName string + Description string +} + +type RoleAndOrigins struct { + Role Role + Origins []Origin +} + +type ScanOptions struct { + Transcoder Transcoder + Timeout time.Duration + ParentSpan RequestSpan + Context context.Context + IDsOnly bool + ConsistentWith *MutationState + BatchByteLimit *uint32 + BatchItemLimit *uint32 + Concurrency uint16 + Internal struct { + User string + } +} + +type ScanResult struct{} + +func (_ *ScanResult) Close() error { + return nil +} + +func (_ *ScanResult) Err() error { + return nil +} + +func (_ *ScanResult) Next() *ScanResultItem { + return nil +} + +type ScanResultItem struct { + Result Result +} + +func (_ *ScanResultItem) Cas() Cas { + return 0 +} + +func (_ *ScanResultItem) Content(_ interface{}) error { + return nil +} + +func (_ *ScanResultItem) ExpiryTime() time.Time { + return time.Time{} +} + +func (_ *ScanResultItem) ID() string { + return "" +} + +func (_ *ScanResultItem) IDOnly() bool { + return false +} + +type ScanType interface{} + +type Scope struct{} + +func (_ *Scope) AnalyticsQuery(_ string, _ *AnalyticsOptions) (*AnalyticsResult, error) { + return nil, nil +} + +func (_ *Scope) BucketName() string { + return "" +} + +func (_ *Scope) Collection(_ string) *Collection { + return nil +} + +func (_ *Scope) EventingFunctions() *ScopeEventingFunctionManager { + return nil +} + +func (_ *Scope) Name() string { + return "" +} + +func (_ *Scope) Query(_ string, _ *QueryOptions) (*QueryResult, error) { + return nil, nil +} + +func (_ *Scope) Search(_ string, _ SearchRequest, _ *SearchOptions) (*SearchResult, error) { + return nil, nil +} + +func (_ *Scope) SearchIndexes() *ScopeSearchIndexManager { + return nil +} + +type ScopeEventingFunctionManager struct{} + +func (_ *ScopeEventingFunctionManager) DeployFunction(_ string, _ *DeployEventingFunctionOptions) error { + return nil +} + +func (_ *ScopeEventingFunctionManager) DropFunction(_ string, _ *DropEventingFunctionOptions) error { + return nil +} + +func (_ *ScopeEventingFunctionManager) FunctionsStatus(_ *EventingFunctionsStatusOptions) (*EventingStatus, error) { + return nil, nil +} + +func (_ *ScopeEventingFunctionManager) GetAllFunctions(_ *GetAllEventingFunctionsOptions) ([]EventingFunction, error) { + return nil, nil +} + +func (_ *ScopeEventingFunctionManager) GetFunction(_ string, _ *GetEventingFunctionOptions) (*EventingFunction, error) { + return nil, nil +} + +func (_ *ScopeEventingFunctionManager) PauseFunction(_ string, _ *PauseEventingFunctionOptions) error { + return nil +} + +func (_ *ScopeEventingFunctionManager) ResumeFunction(_ string, _ *ResumeEventingFunctionOptions) error { + return nil +} + +func (_ *ScopeEventingFunctionManager) UndeployFunction(_ string, _ *UndeployEventingFunctionOptions) error { + return nil +} + +func (_ *ScopeEventingFunctionManager) UpsertFunction(_ EventingFunction, _ *UpsertEventingFunctionOptions) error { + return nil +} + +type ScopeSearchIndexManager struct{} + +func (_ *ScopeSearchIndexManager) AllowQuerying(_ string, _ *AllowQueryingSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) AnalyzeDocument(_ string, _ interface{}, _ *AnalyzeDocumentOptions) ([]interface{}, error) { + return nil, nil +} + +func (_ *ScopeSearchIndexManager) DisallowQuerying(_ string, _ *DisallowQueryingSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) DropIndex(_ string, _ *DropSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) FreezePlan(_ string, _ *FreezePlanSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) GetAllIndexes(_ *GetAllSearchIndexOptions) ([]SearchIndex, error) { + return nil, nil +} + +func (_ *ScopeSearchIndexManager) GetIndex(_ string, _ *GetSearchIndexOptions) (*SearchIndex, error) { + return nil, nil +} + +func (_ *ScopeSearchIndexManager) GetIndexedDocumentsCount(_ string, _ *GetIndexedDocumentsCountOptions) (uint64, error) { + return 0, nil +} + +func (_ *ScopeSearchIndexManager) PauseIngest(_ string, _ *PauseIngestSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) ResumeIngest(_ string, _ *ResumeIngestSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) UnfreezePlan(_ string, _ *UnfreezePlanSearchIndexOptions) error { + return nil +} + +func (_ *ScopeSearchIndexManager) UpsertIndex(_ SearchIndex, _ *UpsertSearchIndexOptions) error { + return nil +} + +type ScopeSpec struct { + Name string + Collections []CollectionSpec +} + +type SearchDateRangeFacetResult struct { + Name string + Start string + End string + Count int +} + +type SearchFacetResult struct { + Name string + Field string + Total uint64 + Missing uint64 + Other uint64 + Terms []SearchTermFacetResult + NumericRanges []SearchNumericRangeFacetResult + DateRanges []SearchDateRangeFacetResult +} + +type SearchHighlightOptions struct { + Style SearchHighlightStyle + Fields []string +} + +type SearchHighlightStyle string + +type SearchIndex struct { + UUID string + Name string + SourceName string + Type string + Params map[string]interface{} + SourceUUID string + SourceParams map[string]interface{} + SourceType string + PlanParams map[string]interface{} +} + +func (_ *SearchIndex) MarshalJSON() ([]byte, error) { + return nil, nil +} + +func (_ *SearchIndex) UnmarshalJSON(_ []byte) error { + return nil +} + +type SearchIndexManager struct{} + +func (_ *SearchIndexManager) AllowQuerying(_ string, _ *AllowQueryingSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) AnalyzeDocument(_ string, _ interface{}, _ *AnalyzeDocumentOptions) ([]interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) DisallowQuerying(_ string, _ *AllowQueryingSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) DropIndex(_ string, _ *DropSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) FreezePlan(_ string, _ *AllowQueryingSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) GetAllIndexes(_ *GetAllSearchIndexOptions) ([]SearchIndex, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetIndex(_ string, _ *GetSearchIndexOptions) (*SearchIndex, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetIndexedDocumentsCount(_ string, _ *GetIndexedDocumentsCountOptions) (uint64, error) { + return 0, nil +} + +func (_ *SearchIndexManager) PauseIngest(_ string, _ *PauseIngestSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) ResumeIngest(_ string, _ *ResumeIngestSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) UnfreezePlan(_ string, _ *AllowQueryingSearchIndexOptions) error { + return nil +} + +func (_ *SearchIndexManager) UpsertIndex(_ SearchIndex, _ *UpsertSearchIndexOptions) error { + return nil +} + +type SearchMetaData struct { + Metrics SearchMetrics + Errors map[string]string +} + +type SearchMetrics struct { + Took time.Duration + TotalRows uint64 + MaxScore float64 + TotalPartitionCount uint64 + SuccessPartitionCount uint64 + ErrorPartitionCount uint64 +} + +type SearchNumericRangeFacetResult struct { + Name string + Min float64 + Max float64 + Count int +} + +type SearchOptions struct { + ScanConsistency SearchScanConsistency + Limit uint32 + Skip uint32 + Explain bool + Highlight *SearchHighlightOptions + Fields []string + Sort []interface{} + Facets map[string]interface{} + ConsistentWith *MutationState + Raw map[string]interface{} + Timeout time.Duration + RetryStrategy RetryStrategy + DisableScoring bool + Collections []string + ParentSpan RequestSpan + Context context.Context + IncludeLocations bool + Internal struct { + User string + } +} + +type SearchRequest struct { + SearchQuery interface{} + VectorSearch interface{} +} + +type SearchResult struct{} + +func (_ *SearchResult) Close() error { + return nil +} + +func (_ *SearchResult) Err() error { + return nil +} + +func (_ *SearchResult) Facets() (map[string]SearchFacetResult, error) { + return nil, nil +} + +func (_ *SearchResult) MetaData() (*SearchMetaData, error) { + return nil, nil +} + +func (_ *SearchResult) Next() bool { + return false +} + +func (_ *SearchResult) Raw() *SearchResultRaw { + return nil +} + +func (_ *SearchResult) Row() SearchRow { + return SearchRow{} +} + +type SearchResultRaw struct{} + +func (_ *SearchResultRaw) Close() error { + return nil +} + +func (_ *SearchResultRaw) Err() error { + return nil +} + +func (_ *SearchResultRaw) MetaData() ([]byte, error) { + return nil, nil +} + +func (_ *SearchResultRaw) NextBytes() []byte { + return nil +} + +type SearchRow struct { + Index string + ID string + Score float64 + Explanation interface{} + Locations map[string]map[string][]SearchRowLocation + Fragments map[string][]string +} + +func (_ *SearchRow) Fields(_ interface{}) error { + return nil +} + +type SearchRowLocation struct { + Position uint32 + Start uint32 + End uint32 + ArrayPositions []uint32 +} + +type SearchScanConsistency uint + +type SearchTermFacetResult struct { + Term string + Count int +} + +type ServiceType int + +type SingleQueryTransactionOptions struct { + DurabilityLevel DurabilityLevel + Internal struct { + Hooks TransactionHooks + } +} + +type StorageBackend string + +type StoreSemantics uint8 + +type SubdocDocFlag uint8 + +type TouchOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type TransactionAttemptContext struct{} + +func (_ *TransactionAttemptContext) Get(_ *Collection, _ string) (*TransactionGetResult, error) { + return nil, nil +} + +func (_ *TransactionAttemptContext) GetReplicaFromPreferredServerGroup(_ *Collection, _ string) (*TransactionGetResult, error) { + return nil, nil +} + +func (_ *TransactionAttemptContext) Insert(_ *Collection, _ string, _ interface{}) (*TransactionGetResult, error) { + return nil, nil +} + +func (_ *TransactionAttemptContext) Internal() *InternalTransactionAttemptContext { + return nil +} + +func (_ *TransactionAttemptContext) Query(_ string, _ *TransactionQueryOptions) (*TransactionQueryResult, error) { + return nil, nil +} + +func (_ *TransactionAttemptContext) Remove(_ *TransactionGetResult) error { + return nil +} + +func (_ *TransactionAttemptContext) Replace(_ *TransactionGetResult, _ interface{}) (*TransactionGetResult, error) { + return nil, nil +} + +type TransactionAttemptState int + +type TransactionCleanupAttempt struct { + Success bool + IsReqular bool + AttemptID string + AtrID string + AtrCollectionName string + AtrScopeName string + AtrBucketName string + Request *TransactionCleanupRequest +} + +type TransactionCleanupRequest struct { + AttemptID string + AtrID string + AtrCollectionName string + AtrScopeName string + AtrBucketName string + Inserts []TransactionDocRecord + Replaces []TransactionDocRecord + Removes []TransactionDocRecord + State TransactionAttemptState + ForwardCompat map[string][]TransactionsForwardCompatibilityEntry +} + +type TransactionDocRecord struct { + CollectionName string + ScopeName string + BucketName string + ID string +} + +type TransactionGetResult struct{} + +func (_ *TransactionGetResult) Content(_ interface{}) error { + return nil +} + +type TransactionHooks interface { + AfterATRAborted(_ TransactionAttemptContext) error + AfterATRCommit(_ TransactionAttemptContext) error + AfterATRComplete(_ TransactionAttemptContext) error + AfterATRPending(_ TransactionAttemptContext) error + AfterATRRolledBack(_ TransactionAttemptContext) error + AfterDocCommitted(_ TransactionAttemptContext, _ string) error + AfterDocCommittedBeforeSavingCAS(_ TransactionAttemptContext, _ string) error + AfterDocRemovedPostRetry(_ TransactionAttemptContext, _ string) error + AfterDocRemovedPreRetry(_ TransactionAttemptContext, _ string) error + AfterDocsCommitted(_ TransactionAttemptContext) error + AfterDocsRemoved(_ TransactionAttemptContext) error + AfterGetComplete(_ TransactionAttemptContext, _ string) error + AfterQuery(_ TransactionAttemptContext, _ string) error + AfterRemoveStagedInsert(_ TransactionAttemptContext, _ string) error + AfterRollbackDeleteInserted(_ TransactionAttemptContext, _ string) error + AfterRollbackReplaceOrRemove(_ TransactionAttemptContext, _ string) error + AfterStagedInsertComplete(_ TransactionAttemptContext, _ string) error + AfterStagedRemoveComplete(_ TransactionAttemptContext, _ string) error + AfterStagedReplaceComplete(_ TransactionAttemptContext, _ string) error + BeforeATRAborted(_ TransactionAttemptContext) error + BeforeATRCommit(_ TransactionAttemptContext) error + BeforeATRCommitAmbiguityResolution(_ TransactionAttemptContext) error + BeforeATRComplete(_ TransactionAttemptContext) error + BeforeATRPending(_ TransactionAttemptContext) error + BeforeATRRolledBack(_ TransactionAttemptContext) error + BeforeCheckATREntryForBlockingDoc(_ TransactionAttemptContext, _ string) error + BeforeDocCommitted(_ TransactionAttemptContext, _ string) error + BeforeDocGet(_ TransactionAttemptContext, _ string) error + BeforeDocRemoved(_ TransactionAttemptContext, _ string) error + BeforeDocRolledBack(_ TransactionAttemptContext, _ string) error + BeforeGetDocInExistsDuringStagedInsert(_ TransactionAttemptContext, _ string) error + BeforeQuery(_ TransactionAttemptContext, _ string) error + BeforeRemoveStagedInsert(_ TransactionAttemptContext, _ string) error + BeforeRemovingDocDuringStagedInsert(_ TransactionAttemptContext, _ string) error + BeforeRollbackDeleteInserted(_ TransactionAttemptContext, _ string) error + BeforeStagedInsert(_ TransactionAttemptContext, _ string) error + BeforeStagedRemove(_ TransactionAttemptContext, _ string) error + BeforeStagedReplace(_ TransactionAttemptContext, _ string) error + HasExpiredClientSideHook(_ TransactionAttemptContext, _ string, _ string) (bool, error) + RandomATRIDForVbucket(_ TransactionAttemptContext) (string, error) +} + +type TransactionLogItem struct { + Level LogLevel +} + +func (_ TransactionLogItem) String() string { + return "" +} + +type TransactionOptions struct { + DurabilityLevel DurabilityLevel + Timeout time.Duration + MetadataCollection *Collection + Internal struct { + Hooks TransactionHooks + } +} + +type TransactionQueryOptions struct { + ScanConsistency QueryScanConsistency + Profile QueryProfileMode + ScanCap uint32 + PipelineBatch uint32 + PipelineCap uint32 + ScanWait time.Duration + Readonly bool + ClientContextID string + PositionalParameters []interface{} + NamedParameters map[string]interface{} + FlexIndex bool + Raw map[string]interface{} + Prepared bool + Scope *Scope +} + +type TransactionQueryResult struct{} + +func (_ *TransactionQueryResult) MetaData() (*QueryMetaData, error) { + return nil, nil +} + +func (_ *TransactionQueryResult) Next() bool { + return false +} + +func (_ *TransactionQueryResult) One(_ interface{}) error { + return nil +} + +func (_ *TransactionQueryResult) Row(_ interface{}) error { + return nil +} + +type TransactionResult struct { + TransactionID string + UnstagingComplete bool + Logs []TransactionLogItem +} + +type Transactions struct{} + +func (_ *Transactions) Internal() *TransactionsInternal { + return nil +} + +func (_ *Transactions) Run(_ AttemptFunc, _ *TransactionOptions) (*TransactionResult, error) { + return nil, nil +} + +type TransactionsForwardCompatibilityEntry struct { + ProtocolVersion string + ProtocolExtension string + Behaviour string + RetryInterval int +} + +type TransactionsInternal struct{} + +func (_ *TransactionsInternal) CleanupLocations() []interface{} { + return nil +} + +func (_ *TransactionsInternal) CleanupQueueLength() int32 { + return 0 +} + +func (_ *TransactionsInternal) ClientCleanupEnabled() bool { + return false +} + +func (_ *TransactionsInternal) ForceCleanupQueue() []TransactionCleanupAttempt { + return nil +} + +type Transcoder interface { + Decode(_ []byte, _ uint32, _ interface{}) error + Encode(_ interface{}) ([]byte, uint32, error) +} + +type UndeployEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UnfreezePlanSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UnlockOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context + Internal struct { + User string + } +} + +type UpdateBucketOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UpdateCollectionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UpdateCollectionSettings struct { + MaxExpiry time.Duration + History *CollectionHistorySettings +} + +type UpsertDesignDocumentOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UpsertEventingFunctionOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UpsertGroupOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UpsertOptions struct { + Expiry time.Duration + PersistTo uint + ReplicateTo uint + DurabilityLevel DurabilityLevel + Transcoder Transcoder + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + PreserveExpiry bool + Context context.Context + Internal struct { + User string + } +} + +type UpsertSearchIndexOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + ParentSpan RequestSpan + Context context.Context +} + +type UpsertUserOptions struct { + Timeout time.Duration + RetryStrategy RetryStrategy + DomainName string + ParentSpan RequestSpan + Context context.Context +} + +type User struct { + Username string + DisplayName string + Roles []Role + Groups []string + Password string +} + +type UserAndMetadata struct { + User User + Domain AuthDomain + EffectiveRoles []RoleAndOrigins + ExternalGroups []string + PasswordChanged time.Time +} + +type UserManager struct{} + +func (_ *UserManager) ChangePassword(_ string, _ *ChangePasswordOptions) error { + return nil +} + +func (_ *UserManager) DropGroup(_ string, _ *DropGroupOptions) error { + return nil +} + +func (_ *UserManager) DropUser(_ string, _ *DropUserOptions) error { + return nil +} + +func (_ *UserManager) GetAllGroups(_ *GetAllGroupsOptions) ([]Group, error) { + return nil, nil +} + +func (_ *UserManager) GetAllUsers(_ *GetAllUsersOptions) ([]UserAndMetadata, error) { + return nil, nil +} + +func (_ *UserManager) GetGroup(_ string, _ *GetGroupOptions) (*Group, error) { + return nil, nil +} + +func (_ *UserManager) GetRoles(_ *GetRolesOptions) ([]RoleAndDescription, error) { + return nil, nil +} + +func (_ *UserManager) GetUser(_ string, _ *GetUserOptions) (*UserAndMetadata, error) { + return nil, nil +} + +func (_ *UserManager) UpsertGroup(_ Group, _ *UpsertGroupOptions) error { + return nil +} + +func (_ *UserManager) UpsertUser(_ User, _ *UpsertUserOptions) error { + return nil +} + +type View struct { + Map string + Reduce string +} + +type ViewErrorMode uint + +type ViewIndexManager struct{} + +func (_ *ViewIndexManager) DropDesignDocument(_ string, _ DesignDocumentNamespace, _ *DropDesignDocumentOptions) error { + return nil +} + +func (_ *ViewIndexManager) GetAllDesignDocuments(_ DesignDocumentNamespace, _ *GetAllDesignDocumentsOptions) ([]DesignDocument, error) { + return nil, nil +} + +func (_ *ViewIndexManager) GetDesignDocument(_ string, _ DesignDocumentNamespace, _ *GetDesignDocumentOptions) (*DesignDocument, error) { + return nil, nil +} + +func (_ *ViewIndexManager) PublishDesignDocument(_ string, _ *PublishDesignDocumentOptions) error { + return nil +} + +func (_ *ViewIndexManager) UpsertDesignDocument(_ DesignDocument, _ DesignDocumentNamespace, _ *UpsertDesignDocumentOptions) error { + return nil +} + +type ViewMetaData struct { + TotalRows uint64 + Debug interface{} +} + +type ViewOptions struct { + ScanConsistency ViewScanConsistency + Skip uint32 + Limit uint32 + Order ViewOrdering + Reduce bool + Group bool + GroupLevel uint32 + Key interface{} + Keys []interface{} + StartKey interface{} + EndKey interface{} + InclusiveEnd bool + StartKeyDocID string + EndKeyDocID string + OnError ViewErrorMode + Debug bool + ParentSpan RequestSpan + Raw map[string]string + Namespace DesignDocumentNamespace + Timeout time.Duration + RetryStrategy RetryStrategy + Context context.Context + Internal struct { + User string + } +} + +type ViewOrdering uint + +type ViewResult struct{} + +func (_ *ViewResult) Close() error { + return nil +} + +func (_ *ViewResult) Err() error { + return nil +} + +func (_ *ViewResult) MetaData() (*ViewMetaData, error) { + return nil, nil +} + +func (_ *ViewResult) Next() bool { + return false +} + +func (_ *ViewResult) Raw() *ViewResultRaw { + return nil +} + +func (_ *ViewResult) Row() ViewRow { + return ViewRow{} +} + +type ViewResultRaw struct{} + +func (_ *ViewResultRaw) Close() error { + return nil +} + +func (_ *ViewResultRaw) Err() error { + return nil +} + +func (_ *ViewResultRaw) MetaData() ([]byte, error) { + return nil, nil +} + +func (_ *ViewResultRaw) NextBytes() []byte { + return nil +} + +type ViewRow struct { + ID string +} + +func (_ *ViewRow) Key(_ interface{}) error { + return nil +} + +func (_ *ViewRow) Value(_ interface{}) error { + return nil +} + +type ViewScanConsistency uint + +type WaitUntilReadyOptions struct { + DesiredState ClusterState + ServiceTypes []ServiceType + Context context.Context + RetryStrategy RetryStrategy +} + +type WatchQueryIndexOptions struct { + WatchPrimary bool + RetryStrategy RetryStrategy + ParentSpan RequestSpan + ScopeName string + CollectionName string + Context context.Context +} From e6198baccb24f00d705d68229f12d8bb706209a4 Mon Sep 17 00:00:00 2001 From: Ed Minnix Date: Mon, 3 Mar 2025 13:28:37 -0500 Subject: [PATCH 3/9] [change-note] couchbase source models --- go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md diff --git a/go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md b/go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md new file mode 100644 index 000000000000..cb5fd1f12841 --- /dev/null +++ b/go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md @@ -0,0 +1,5 @@ +--- +category: minorAnalysis +--- +* `database` source models have been added for v1 and v2 of the `github.com/couchbase/gocb` package. + From 166d5230f70b6aaae8ce2bae0843682cf0e07570 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:14:22 +0000 Subject: [PATCH 4/9] Apply suggestions from code review --- go/ql/lib/ext/github.com.couchbase.gocb.model.yml | 1 - .../flowsources/local/database/test_couchbase_gocb_v1.go | 3 ++- .../flowsources/local/database/test_couchbase_gocb_v2.go | 2 +- .../local/database/vendor/github.com/couchbase/gocb/stub.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml index 0881a2c966b6..2672c78aaf0a 100644 --- a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml +++ b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml @@ -82,7 +82,6 @@ extensions: - ["group:gocb2", "AnalyticsResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb2", "GetResult", True, "Content", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] - ["group:gocb2", "LookupInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - - ["group:gocb2", "LookupInReplicaResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - ["group:gocb2", "LookupInAllReplicasResult", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb2", "MutateInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - ["group:gocb2", "QueryResult", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go index 57e5dc26bbbd..7967de2af471 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go @@ -50,5 +50,6 @@ func test_couchbase_gocb_v1_Cluster(cluster *gocb.Cluster, aq *gocb.AnalyticsQue return } - sink(r3) // $ hasTaintFlow="r3" + hit := r3.Hits()[0] + sink(hit) // $ hasTaintFlow="hit" } diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go index 3309403688e4..1b9dd62ae729 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go @@ -47,7 +47,7 @@ func test_couchbase_gocb_v2_Cluster(cluster *gocb.Cluster) { } func test_couchbase_gocb_v2_Scope(scope *gocb.Scope) { - r1, err := scope.Query("SELECT * FROM `travel-sample`", nil) // $ source + r1, err := scope.AnalyticsQuery("SELECT * FROM `travel-sample`", nil) // $ source if err != nil { return diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go index 58b61190f496..ec4488c2a273 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go @@ -12,7 +12,7 @@ func (c *Cluster) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (QueryResul return nil, nil } -func (c *Cluster) ExecuteSearchQuery(q *SearchQuery) (SearchResult, error) { +func (c *Cluster) ExecuteSearchQuery(q *SearchQuery) (SearchResults, error) { return nil, nil } @@ -38,7 +38,7 @@ type QueryResults interface { type SearchQuery struct{} -type SearchResult interface { +type SearchResults interface { Status() SearchResultStatus Errors() []string TotalHits() int From 88e96829fb7197a76cfceef9b0e85f027979d893 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com> Date: Fri, 7 Mar 2025 23:11:01 +0000 Subject: [PATCH 5/9] Apply suggestions from code review --- .../lib/ext/github.com.couchbase.gocb.model.yml | 1 - .../vendor/github.com/couchbase/gocb/v2/stub.go | 16 ++++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml index 2672c78aaf0a..d7260c55055a 100644 --- a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml +++ b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml @@ -82,7 +82,6 @@ extensions: - ["group:gocb2", "AnalyticsResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb2", "GetResult", True, "Content", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] - ["group:gocb2", "LookupInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - - ["group:gocb2", "LookupInAllReplicasResult", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb2", "MutateInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - ["group:gocb2", "QueryResult", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] - ["group:gocb2", "QueryResult", True, "Raw", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go index e51d4d780ede..3f520311f17d 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go @@ -1261,7 +1261,7 @@ type ExistsOptions struct { } type ExistsResult struct { - Result Result + Result } func (_ *ExistsResult) Cas() Cas { @@ -1512,7 +1512,7 @@ func (_ *GetReplicaResult) IsReplica() bool { } type GetResult struct { - Result Result + Result } func (_ *GetResult) Cas() Cas { @@ -1664,17 +1664,13 @@ type LookupInOptions struct { } type LookupInReplicaResult struct { - LookupInResult *LookupInResult + *LookupInResult } func (_ LookupInReplicaResult) Cas() Cas { return 0 } -func (_ LookupInReplicaResult) ContentAt(_ uint, _ interface{}) error { - return nil -} - func (_ LookupInReplicaResult) Exists(_ uint) bool { return false } @@ -1684,7 +1680,7 @@ func (_ *LookupInReplicaResult) IsReplica() bool { } type LookupInResult struct { - Result Result + Result } func (_ *LookupInResult) Cas() Cas { @@ -1738,7 +1734,7 @@ func (_ *MutateInResult) Cas() Cas { type MutateInSpec struct{} type MutationResult struct { - Result Result + Result } func (_ MutationResult) MutationToken() *MutationToken { @@ -2175,7 +2171,7 @@ func (_ *ScanResult) Next() *ScanResultItem { } type ScanResultItem struct { - Result Result + Result } func (_ *ScanResultItem) Cas() Cas { From 820aa90a0f478c3f2b30541883b1e6b5af27b4ab Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 19 Mar 2025 10:26:11 +0000 Subject: [PATCH 6/9] Add missing model to make tests pass --- go/ql/lib/ext/github.com.couchbase.gocb.model.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml index d7260c55055a..d485c5a25286 100644 --- a/go/ql/lib/ext/github.com.couchbase.gocb.model.yml +++ b/go/ql/lib/ext/github.com.couchbase.gocb.model.yml @@ -81,6 +81,7 @@ extensions: - ["group:gocb2", "AnalyticsResult", True, "Row", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] - ["group:gocb2", "AnalyticsResultRaw", True, "NextBytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb2", "GetResult", True, "Content", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] + - ["group:gocb2", "LookupInAllReplicasResult", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - ["group:gocb2", "LookupInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - ["group:gocb2", "MutateInResult", True, "ContentAt", "", "", "Argument[receiver]", "Argument[1]", "taint", "manual"] - ["group:gocb2", "QueryResult", True, "One", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"] From fee380f9702278671f4fc5ba5c5adbf8c42ae801 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 19 Mar 2025 10:26:31 +0000 Subject: [PATCH 7/9] Update go.mod --- .../flowsources/local/database/go.mod | 54 +++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod index 36491d136fac..a1e2457ba137 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod @@ -1,9 +1,57 @@ module test -go 1.22.5 +go 1.24.1 require ( - gorm.io/gorm v1.23.0 + github.com/astaxie/beego v1.12.3 + github.com/beego/beego/v2 v2.3.5 + github.com/couchbase/gocb v1.6.7 + github.com/couchbase/gocb/v2 v2.9.4 github.com/jmoiron/sqlx v1.4.0 - go.mongodb.org/mongo-driver/mongo v1.17.2 + github.com/rqlite/gorqlite v0.0.0-20250128004930-114c7828b55a + go.mongodb.org/mongo-driver v1.17.3 + gorm.io/gorm v1.25.12 +) + +require ( + github.com/couchbase/gocbcore/v10 v10.5.4 // indirect + github.com/couchbase/gocbcoreps v0.1.3 // indirect + github.com/couchbase/goprotostellar v1.0.2 // indirect + github.com/couchbaselabs/gocbconnstr/v2 v2.0.0-20240607131231-fb385523de28 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/montanaflynn/stats v0.7.1 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect + github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect + google.golang.org/protobuf v1.34.2 // indirect + 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.1 // indirect ) From 84872c8c7f91775a914d6732ca3a830c275a175c Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 21 Mar 2025 10:15:08 +0000 Subject: [PATCH 8/9] Use depstubber for stubs (with manual edits) I had to remove quite a few incorrect method declarations for promoted methods. --- .../flowsources/local/database/go.mod | 2 +- .../local/database/test_beego_orm.go | 3 + .../local/database/test_couchbase_gocb_v1.go | 2 + .../local/database/test_couchbase_gocb_v2.go | 2 +- .../flowsources/local/database/test_gorm.go | 2 + .../local/database/test_jmoiron_sqlx.go | 2 + .../beego/beego/v2/client/orm/stub.go | 26 +- .../vendor/github.com/couchbase/gocb/stub.go | 1288 ++++++++++++++++- .../github.com/couchbase/gocb/v2/stub.go | 32 +- .../vendor/github.com/jmoiron/sqlx/conn.go | 26 - .../vendor/github.com/jmoiron/sqlx/db.go | 52 - .../github.com/jmoiron/sqlx/namedstmt.go | 60 - .../vendor/github.com/jmoiron/sqlx/row.go | 21 - .../vendor/github.com/jmoiron/sqlx/rows.go | 22 - .../vendor/github.com/jmoiron/sqlx/stmt.go | 42 - .../vendor/github.com/jmoiron/sqlx/stub.go | 523 ++++++- .../vendor/github.com/jmoiron/sqlx/tx.go | 47 - .../database/vendor/gorm.io/gorm/stub.go | 873 ++++++++++- .../local/database/vendor/modules.txt | 141 +- 19 files changed, 2718 insertions(+), 448 deletions(-) delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/conn.go delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/db.go delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/namedstmt.go delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/row.go delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/rows.go delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stmt.go delete mode 100644 go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/tx.go diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod index a1e2457ba137..9a16d637f9b1 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod @@ -1,6 +1,6 @@ module test -go 1.24.1 +go 1.24 require ( github.com/astaxie/beego v1.12.3 diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_beego_orm.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_beego_orm.go index 93138c69a580..1f5e31ebf72c 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_beego_orm.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_beego_orm.go @@ -1,5 +1,8 @@ package test +//go:generate depstubber -vendor github.com/astaxie/beego/orm Ormer NewOrm +//go:generate depstubber -vendor github.com/beego/beego/v2/client/orm DB,DQL,Ormer NewOrm + import ( oldOrm "github.com/astaxie/beego/orm" "github.com/beego/beego/v2/client/orm" diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go index 7967de2af471..5bddde4b2383 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go @@ -1,5 +1,7 @@ package test +//go:generate depstubber -vendor github.com/couchbase/gocb Cluster,AnalyticsResults,QueryResults,SearchResults + import "github.com/couchbase/gocb" func test_couchbase_gocb_v1_Cluster(cluster *gocb.Cluster, aq *gocb.AnalyticsQuery, n1ql *gocb.N1qlQuery, sq *gocb.SearchQuery) { diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go index 1b9dd62ae729..151b90056605 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go @@ -1,6 +1,6 @@ package test -//go:generate depstubber -vendor github.com/couchbase/gocb/v2 Cluster,Scope,Collection,TransactionAttemptContext,ViewIndexManager +//go:generate depstubber -vendor github.com/couchbase/gocb/v2 AnalyticsResult,AnalyticsResultRaw,Cluster,Collection,ExistsResult,GetResult,LookupInReplicaResult,LookupInResult,MutateInResult,MutationResult,QueryResult,QueryResultRaw,Result,ScanResult,ScanResultItem,Scope,SearchResult,SearchResultRaw,TransactionAttemptContext,TransactionGetResult,TransactionQueryResult,ViewIndexManager,ViewResult,ViewResultRaw import "github.com/couchbase/gocb/v2" diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_gorm.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_gorm.go index 9fc1de0de4ef..e0c5a1182e22 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_gorm.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_gorm.go @@ -1,5 +1,7 @@ package test +//go:generate depstubber -vendor gorm.io/gorm Association,ConnPool,DB + import "gorm.io/gorm" // test querying an Association diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_jmoiron_sqlx.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_jmoiron_sqlx.go index ce3dea5b532c..ecb99305cb75 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_jmoiron_sqlx.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_jmoiron_sqlx.go @@ -1,5 +1,7 @@ package test +//go:generate depstubber -vendor github.com/jmoiron/sqlx Conn,DB,NamedStmt,Stmt,Tx Get,GetContext,NamedQuery,NamedQueryContext,Select,SelectContext + import ( "context" diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/beego/beego/v2/client/orm/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/beego/beego/v2/client/orm/stub.go index 4dfcd2aefc85..58000359ed5d 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/beego/beego/v2/client/orm/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/beego/beego/v2/client/orm/stub.go @@ -2,7 +2,7 @@ // This is a simple stub for github.com/beego/beego/v2/client/orm, strictly for use in testing. // See the LICENSE file for information about the licensing of the original library. -// Source: github.com/beego/beego/v2/client/orm (exports: DQL,DB,Ormer; functions: NewOrm) +// Source: github.com/beego/beego/v2/client/orm (exports: DB,DQL,Ormer; functions: NewOrm) // Package orm is a stub of github.com/beego/beego/v2/client/orm, generated by depstubber. package orm @@ -56,30 +56,10 @@ func (_ *Condition) OrNotCond(_ *Condition) *Condition { } type DB struct { - RWMutex *sync.RWMutex - DB *sql.DB + *sync.RWMutex + DB *sql.DB } -func (_ DB) Lock() {} - -func (_ DB) RLock() {} - -func (_ DB) RLocker() sync.Locker { - return nil -} - -func (_ DB) RUnlock() {} - -func (_ DB) TryLock() bool { - return false -} - -func (_ DB) TryRLock() bool { - return false -} - -func (_ DB) Unlock() {} - func (_ *DB) Begin() (*sql.Tx, error) { return nil, nil } diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go index ec4488c2a273..ba230f183b4f 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go @@ -1,107 +1,1273 @@ +// Code generated by depstubber. DO NOT EDIT. +// This is a simple stub for github.com/couchbase/gocb, strictly for use in testing. + +// See the LICENSE file for information about the licensing of the original library. +// Source: github.com/couchbase/gocb (exports: Cluster,AnalyticsResults,QueryResults,SearchResults; functions: ) + +// Package gocb is a stub of github.com/couchbase/gocb, generated by depstubber. package gocb -import "time" +import ( + time "time" +) + +type AnalyticsDeferredResultHandle interface { + Close() error + Next(_ interface{}) bool + NextBytes() []byte + One(_ interface{}) error + Status() (string, error) +} + +type AnalyticsIngestOptions struct{} + +func (_ *AnalyticsIngestOptions) AnalyticsTimeout(_ time.Duration) *AnalyticsIngestOptions { + return nil +} + +func (_ *AnalyticsIngestOptions) DataConverter(_ DataConverterFunction) *AnalyticsIngestOptions { + return nil +} + +func (_ *AnalyticsIngestOptions) IdGenerator(_ IdGeneratorFunction) *AnalyticsIngestOptions { + return nil +} + +func (_ *AnalyticsIngestOptions) IgnoreIngestError(_ bool) *AnalyticsIngestOptions { + return nil +} + +func (_ *AnalyticsIngestOptions) IngestMethod(_ interface{}) *AnalyticsIngestOptions { + return nil +} + +func (_ *AnalyticsIngestOptions) KVRetryBehavior(_ QueryRetryBehavior) *AnalyticsIngestOptions { + return nil +} + +func (_ *AnalyticsIngestOptions) KVRetryOn(_ []error) *AnalyticsIngestOptions { + return nil +} + +type AnalyticsQuery struct{} + +func (_ *AnalyticsQuery) ContextId(_ string) *AnalyticsQuery { + return nil +} + +func (_ *AnalyticsQuery) Deferred(_ bool) *AnalyticsQuery { + return nil +} + +func (_ *AnalyticsQuery) Pretty(_ bool) *AnalyticsQuery { + return nil +} + +func (_ *AnalyticsQuery) Priority(_ bool) *AnalyticsQuery { + return nil +} + +func (_ *AnalyticsQuery) RawParam(_ string, _ interface{}) *AnalyticsQuery { + return nil +} + +func (_ *AnalyticsQuery) ServerSideTimeout(_ time.Duration) *AnalyticsQuery { + return nil +} + +type AnalyticsResultMetrics struct { + ElapsedTime time.Duration + ExecutionTime time.Duration + ResultCount uint + ResultSize uint + MutationCount uint + SortCount uint + ErrorCount uint + WarningCount uint + ProcessedObjects uint +} + +type AnalyticsResults interface { + ClientContextId() string + Close() error + Handle() AnalyticsDeferredResultHandle + Metrics() AnalyticsResultMetrics + Next(_ interface{}) bool + NextBytes() []byte + One(_ interface{}) error + RequestId() string + Signature() interface{} + Status() string + Warnings() []AnalyticsWarning +} + +type AnalyticsWarning struct { + Code uint32 + Message string +} + +type AuthCredsRequest struct { + Service ServiceType + Endpoint string + Bucket string +} + +type AuthDomain string + +type Authenticator interface { + Credentials(_ AuthCredsRequest) ([]UserPassPair, error) +} + +type Bucket struct{} + +func (_ *Bucket) AnalyticsIngest(_ *AnalyticsQuery, _ []interface{}, _ *AnalyticsIngestOptions) error { + return nil +} + +func (_ *Bucket) AnalyticsTimeout() time.Duration { + return 0 +} + +func (_ *Bucket) Append(_ string, _ string) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) AppendDura(_ string, _ string, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) AppendMt(_ string, _ string) (Cas, MutationToken, error) { + return 0, MutationToken{}, nil +} + +func (_ *Bucket) BulkOperationTimeout() time.Duration { + return 0 +} + +func (_ *Bucket) Close() error { + return nil +} + +func (_ *Bucket) Counter(_ string, _ int64, _ int64, _ uint32) (uint64, Cas, error) { + return 0, 0, nil +} + +func (_ *Bucket) CounterDura(_ string, _ int64, _ int64, _ uint32, _ uint, _ uint) (uint64, Cas, error) { + return 0, 0, nil +} + +func (_ *Bucket) CounterMt(_ string, _ int64, _ int64, _ uint32) (uint64, Cas, MutationToken, error) { + return 0, 0, MutationToken{}, nil +} + +func (_ *Bucket) Diagnostics() (*DiagnosticReport, error) { + return nil, nil +} + +func (_ *Bucket) Do(_ []BulkOp) error { + return nil +} + +func (_ *Bucket) DurabilityPollTimeout() time.Duration { + return 0 +} + +func (_ *Bucket) DurabilityTimeout() time.Duration { + return 0 +} + +func (_ *Bucket) ExecuteAnalyticsQuery(_ *AnalyticsQuery, _ interface{}) (AnalyticsResults, error) { + return nil, nil +} + +func (_ *Bucket) ExecuteN1qlQuery(_ *N1qlQuery, _ interface{}) (QueryResults, error) { + return nil, nil +} + +func (_ *Bucket) ExecuteSearchQuery(_ *SearchQuery) (SearchResults, error) { + return nil, nil +} + +func (_ *Bucket) ExecuteSpatialQuery(_ *SpatialQuery) (ViewResults, error) { + return nil, nil +} + +func (_ *Bucket) ExecuteViewQuery(_ *ViewQuery) (ViewResults, error) { + return nil, nil +} + +func (_ *Bucket) Get(_ string, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) GetAndLock(_ string, _ uint32, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) GetAndTouch(_ string, _ uint32, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) GetReplica(_ string, _ interface{}, _ int) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) Insert(_ string, _ interface{}, _ uint32) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) InsertDura(_ string, _ interface{}, _ uint32, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) InsertMt(_ string, _ interface{}, _ uint32) (Cas, MutationToken, error) { + return 0, MutationToken{}, nil +} + +func (_ *Bucket) Internal() *BucketInternal { + return nil +} + +func (_ *Bucket) InvalidateQueryCache() {} + +func (_ *Bucket) IoRouter() interface{} { + return nil +} + +func (_ *Bucket) ListAppend(_ string, _ interface{}, _ bool) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ListGet(_ string, _ uint, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ListPrepend(_ string, _ interface{}, _ bool) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ListRemove(_ string, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ListSet(_ string, _ uint, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ListSize(_ string) (uint, Cas, error) { + return 0, 0, nil +} + +func (_ *Bucket) LookupIn(_ string) *LookupInBuilder { + return nil +} + +func (_ *Bucket) LookupInEx(_ string, _ SubdocDocFlag) *LookupInBuilder { + return nil +} + +func (_ *Bucket) Manager(_ string, _ string) *BucketManager { + return nil +} + +func (_ *Bucket) MapAdd(_ string, _ string, _ interface{}, _ bool) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) MapGet(_ string, _ string, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) MapRemove(_ string, _ string) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) MapSize(_ string) (uint, Cas, error) { + return 0, 0, nil +} + +func (_ *Bucket) MutateIn(_ string, _ Cas, _ uint32) *MutateInBuilder { + return nil +} + +func (_ *Bucket) MutateInEx(_ string, _ SubdocDocFlag, _ Cas, _ uint32) *MutateInBuilder { + return nil +} + +func (_ *Bucket) MutateInExDura(_ string, _ SubdocDocFlag, _ Cas, _ uint32, _ uint, _ uint) *MutateInBuilder { + return nil +} + +func (_ *Bucket) N1qlTimeout() time.Duration { + return 0 +} + +func (_ *Bucket) Name() string { + return "" +} + +func (_ *Bucket) OperationTimeout() time.Duration { + return 0 +} + +func (_ *Bucket) Ping(_ []ServiceType) (*PingReport, error) { + return nil, nil +} + +func (_ *Bucket) Prepend(_ string, _ string) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) PrependDura(_ string, _ string, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) PrependMt(_ string, _ string) (Cas, MutationToken, error) { + return 0, MutationToken{}, nil +} + +func (_ *Bucket) QueuePop(_ string, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) QueuePush(_ string, _ interface{}, _ bool) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) QueueSize(_ string) (uint, Cas, error) { + return 0, 0, nil +} + +func (_ *Bucket) Remove(_ string, _ Cas) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) RemoveDura(_ string, _ Cas, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) RemoveMt(_ string, _ Cas) (Cas, MutationToken, error) { + return 0, MutationToken{}, nil +} + +func (_ *Bucket) Replace(_ string, _ interface{}, _ Cas, _ uint32) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ReplaceDura(_ string, _ interface{}, _ Cas, _ uint32, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) ReplaceMt(_ string, _ interface{}, _ Cas, _ uint32) (Cas, MutationToken, error) { + return 0, MutationToken{}, nil +} + +func (_ *Bucket) SetAdd(_ string, _ interface{}, _ bool) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) SetAnalyticsQueryRetryBehavior(_ QueryRetryBehavior) {} + +func (_ *Bucket) SetAnalyticsTimeout(_ time.Duration) {} + +func (_ *Bucket) SetBulkOperationTimeout(_ time.Duration) {} + +func (_ *Bucket) SetDurabilityPollTimeout(_ time.Duration) {} + +func (_ *Bucket) SetDurabilityTimeout(_ time.Duration) {} + +func (_ *Bucket) SetExists(_ string, _ interface{}) (bool, Cas, error) { + return false, 0, nil +} + +func (_ *Bucket) SetN1qlTimeout(_ time.Duration) {} + +func (_ *Bucket) SetOperationTimeout(_ time.Duration) {} + +func (_ *Bucket) SetRemove(_ string, _ interface{}) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) SetSearchQueryRetryBehavior(_ QueryRetryBehavior) {} + +func (_ *Bucket) SetSize(_ string) (uint, Cas, error) { + return 0, 0, nil +} + +func (_ *Bucket) SetTranscoder(_ Transcoder) {} + +func (_ *Bucket) SetViewTimeout(_ time.Duration) {} + +func (_ *Bucket) Stats(_ string) (ServerStats, error) { + return nil, nil +} + +func (_ *Bucket) Touch(_ string, _ Cas, _ uint32) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) TouchDura(_ string, _ Cas, _ uint32, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) UUID() string { + return "" +} + +func (_ *Bucket) Unlock(_ string, _ Cas) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) Upsert(_ string, _ interface{}, _ uint32) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) UpsertDura(_ string, _ interface{}, _ uint32, _ uint, _ uint) (Cas, error) { + return 0, nil +} + +func (_ *Bucket) UpsertMt(_ string, _ interface{}, _ uint32) (Cas, MutationToken, error) { + return 0, MutationToken{}, nil +} + +func (_ *Bucket) ViewTimeout() time.Duration { + return 0 +} + +type BucketInternal struct{} + +func (_ *BucketInternal) GetRandom(_ interface{}) (string, Cas, error) { + return "", 0, nil +} + +func (_ *BucketInternal) RemoveMeta(_ string, _ []byte, _ []byte, _ byte, _ uint32, _ uint32, _ uint32, _ uint64, _ uint64) (Cas, error) { + return 0, nil +} + +func (_ *BucketInternal) UpsertMeta(_ string, _ []byte, _ []byte, _ byte, _ uint32, _ uint32, _ uint32, _ uint64, _ uint64) (Cas, error) { + return 0, nil +} + +type BucketManager struct{} + +func (_ *BucketManager) BuildDeferredIndexes() ([]string, error) { + return nil, nil +} + +func (_ *BucketManager) CreateIndex(_ string, _ []string, _ bool, _ bool) error { + return nil +} + +func (_ *BucketManager) CreatePrimaryIndex(_ string, _ bool, _ bool) error { + return nil +} + +func (_ *BucketManager) DropIndex(_ string, _ bool) error { + return nil +} + +func (_ *BucketManager) DropPrimaryIndex(_ string, _ bool) error { + return nil +} + +func (_ *BucketManager) Flush() error { + return nil +} + +func (_ *BucketManager) GetDesignDocument(_ string) (*DesignDocument, error) { + return nil, nil +} + +func (_ *BucketManager) GetDesignDocuments() ([]*DesignDocument, error) { + return nil, nil +} + +func (_ *BucketManager) GetIndexes() ([]IndexInfo, error) { + return nil, nil +} + +func (_ *BucketManager) InsertDesignDocument(_ *DesignDocument) error { + return nil +} + +func (_ *BucketManager) RemoveDesignDocument(_ string) error { + return nil +} + +func (_ *BucketManager) UpsertDesignDocument(_ *DesignDocument) error { + return nil +} + +func (_ *BucketManager) WatchIndexes(_ []string, _ bool, _ time.Duration) error { + return nil +} + +type BucketSettings struct { + FlushEnabled bool + IndexReplicas bool + Name string + Password string + Quota int + Replicas int + Type BucketType +} + +type BucketType int + +type BulkOp interface{} + +type Cas uint64 + +type Cluster struct{} + +func (_ *Cluster) AnalyticsTimeout() time.Duration { + return 0 +} + +func (_ *Cluster) Authenticate(_ Authenticator) error { + return nil +} + +func (_ *Cluster) Close() error { + return nil +} + +func (_ *Cluster) ConnectTimeout() time.Duration { + return 0 +} + +func (_ *Cluster) EnhancedErrors() bool { + return false +} + +func (_ *Cluster) ExecuteAnalyticsQuery(_ *AnalyticsQuery, _ interface{}) (AnalyticsResults, error) { + return nil, nil +} + +func (_ *Cluster) ExecuteN1qlQuery(_ *N1qlQuery, _ interface{}) (QueryResults, error) { + return nil, nil +} + +func (_ *Cluster) ExecuteSearchQuery(_ *SearchQuery) (SearchResults, error) { + return nil, nil +} + +func (_ *Cluster) FtsTimeout() time.Duration { + return 0 +} + +func (_ *Cluster) InvalidateQueryCache() {} + +func (_ *Cluster) Manager(_ string, _ string) *ClusterManager { + return nil +} + +func (_ *Cluster) N1qlTimeout() time.Duration { + return 0 +} + +func (_ *Cluster) NmvRetryDelay() time.Duration { + return 0 +} + +func (_ *Cluster) OpenBucket(_ string, _ string) (*Bucket, error) { + return nil, nil +} + +func (_ *Cluster) OpenBucketWithMt(_ string, _ string) (*Bucket, error) { + return nil, nil +} + +func (_ *Cluster) OpenStreamingBucket(_ string, _ string, _ string) (*StreamingBucket, error) { + return nil, nil +} + +func (_ *Cluster) ServerConnectTimeout() time.Duration { + return 0 +} + +func (_ *Cluster) SetAnalyticsTimeout(_ time.Duration) {} + +func (_ *Cluster) SetConnectTimeout(_ time.Duration) {} + +func (_ *Cluster) SetEnhancedErrors(_ bool) {} + +func (_ *Cluster) SetFtsTimeout(_ time.Duration) {} + +func (_ *Cluster) SetN1qlTimeout(_ time.Duration) {} + +func (_ *Cluster) SetNmvRetryDelay(_ time.Duration) {} + +func (_ *Cluster) SetServerConnectTimeout(_ time.Duration) {} + +func (_ *Cluster) SetTracer(_ interface{}) {} + +type ClusterManager struct{} + +func (_ *ClusterManager) GetBuckets() ([]*BucketSettings, error) { + return nil, nil +} + +func (_ *ClusterManager) GetUser(_ AuthDomain, _ string) (*User, error) { + return nil, nil +} + +func (_ *ClusterManager) GetUsers(_ AuthDomain) ([]*User, error) { + return nil, nil +} + +func (_ *ClusterManager) InsertBucket(_ *BucketSettings) error { + return nil +} + +func (_ *ClusterManager) Internal() *ClusterManagerInternal { + return nil +} + +func (_ *ClusterManager) RemoveBucket(_ string) error { + return nil +} + +func (_ *ClusterManager) RemoveUser(_ AuthDomain, _ string) error { + return nil +} + +func (_ *ClusterManager) SearchIndexManager() *SearchIndexManager { + return nil +} + +func (_ *ClusterManager) UpdateBucket(_ *BucketSettings) error { + return nil +} + +func (_ *ClusterManager) UpsertUser(_ AuthDomain, _ string, _ *UserSettings) error { + return nil +} + +type ClusterManagerInternal struct{} + +func (_ *ClusterManagerInternal) GetNodesMetadata() ([]NodeMetadata, error) { + return nil, nil +} + +type ConsistencyMode int + +type DataConverterFunction func([]byte) (interface{}, error) + +type DesignDocument struct { + Name string + Views map[string]View + SpatialViews map[string]View +} + +type DiagConnState int + +type DiagnosticEntry struct { + Service ServiceType + State DiagConnState + LocalAddr string + RemoteAddr string + LastActivity time.Time +} + +type DiagnosticReport struct { + ConfigRev int64 + Services []DiagnosticEntry +} + +func (_ *DiagnosticReport) MarshalJSON() ([]byte, error) { + return nil, nil +} + +type DocumentFragment struct{} -type Cluster struct{} +func (_ *DocumentFragment) Cas() Cas { + return 0 +} -func (c *Cluster) ExecuteAnalyticsQuery(q *AnalyticsQuery, options *AnalyticsOptions) (AnalyticsResult, error) { - return nil, nil +func (_ *DocumentFragment) Content(_ string, _ interface{}) error { + return nil +} + +func (_ *DocumentFragment) ContentByIndex(_ int, _ interface{}) error { + return nil +} + +func (_ *DocumentFragment) Exists(_ string) bool { + return false +} + +func (_ *DocumentFragment) MutationToken() MutationToken { + return MutationToken{} +} + +type IdGeneratorFunction func(interface{}) (string, error) + +type IndexInfo struct { + Name string + IsPrimary bool + Type IndexType + State string + Keyspace string + Namespace string + IndexKey []string } -func (c *Cluster) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (QueryResults, error) { +type IndexType string + +type LookupInBuilder struct{} + +func (_ *LookupInBuilder) Execute() (*DocumentFragment, error) { return nil, nil } -func (c *Cluster) ExecuteSearchQuery(q *SearchQuery) (SearchResults, error) { +func (_ *LookupInBuilder) Exists(_ string) *LookupInBuilder { + return nil +} + +func (_ *LookupInBuilder) ExistsEx(_ string, _ SubdocFlag) *LookupInBuilder { + return nil +} + +func (_ *LookupInBuilder) Get(_ string) *LookupInBuilder { + return nil +} + +func (_ *LookupInBuilder) GetCount(_ string) *LookupInBuilder { + return nil +} + +func (_ *LookupInBuilder) GetCountEx(_ string, _ SubdocFlag) *LookupInBuilder { + return nil +} + +func (_ *LookupInBuilder) GetEx(_ string, _ SubdocFlag) *LookupInBuilder { + return nil +} + +type MutateInBuilder struct{} + +func (_ *MutateInBuilder) ArrayAddUnique(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayAddUniqueEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayAppend(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayAppendEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayAppendMulti(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayAppendMultiEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayInsert(_ string, _ interface{}) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayInsertEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayInsertMulti(_ string, _ interface{}) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayInsertMultiEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayPrepend(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayPrependEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayPrependMulti(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ArrayPrependMultiEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) Counter(_ string, _ int64, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) CounterEx(_ string, _ int64, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) Execute() (*DocumentFragment, error) { return nil, nil } -type AnalyticsOptions struct{} +func (_ *MutateInBuilder) Insert(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} -type AnalyticsResult interface { - One(valuePtr interface{}) error - Next(valuePtr interface{}) bool - NextBytes() []byte - Close() error +func (_ *MutateInBuilder) InsertEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil } -type AnalyticsQuery struct{} +func (_ *MutateInBuilder) Remove(_ string) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) RemoveEx(_ string, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) Replace(_ string, _ interface{}) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) ReplaceEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) Upsert(_ string, _ interface{}, _ bool) *MutateInBuilder { + return nil +} + +func (_ *MutateInBuilder) UpsertEx(_ string, _ interface{}, _ SubdocFlag) *MutateInBuilder { + return nil +} + +type MutationState struct{} + +func (_ *MutationState) Add(_ ...MutationToken) {} + +func (_ *MutationState) MarshalJSON() ([]byte, error) { + return nil, nil +} + +func (_ *MutationState) UnmarshalJSON(_ []byte) error { + return nil +} + +type MutationToken struct{} type N1qlQuery struct{} +func (_ *N1qlQuery) AdHoc(_ bool) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) Consistency(_ ConsistencyMode) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) ConsistentWith(_ *MutationState) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) Custom(_ string, _ interface{}) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) PipelineBatch(_ int) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) PipelineCap(_ int) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) Profile(_ QueryProfileType) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) ReadOnly(_ bool) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) ScanCap(_ int) *N1qlQuery { + return nil +} + +func (_ *N1qlQuery) Timeout(_ time.Duration) *N1qlQuery { + return nil +} + +type NodeMetadata struct { + ClusterCompatibility int + ClusterMembership string + CouchAPIBase string + Hostname string + InterestingStats map[string]float64 + MCDMemoryAllocated float64 + MCDMemoryReserved float64 + MemoryFree float64 + MemoryTotal float64 + OS string + Ports map[string]int + Status string + Uptime int + Version string + ThisNode bool +} + +type PingReport struct { + Services []PingServiceEntry +} + +func (_ *PingReport) MarshalJSON() ([]byte, error) { + return nil, nil +} + +type PingServiceEntry struct { + Service ServiceType + Endpoint string + Success bool + Latency time.Duration +} + +type QueryProfileType string + +type QueryResultMetrics struct { + ElapsedTime time.Duration + ExecutionTime time.Duration + ResultCount uint + ResultSize uint + MutationCount uint + SortCount uint + ErrorCount uint + WarningCount uint +} + type QueryResults interface { - One(valuePtr interface{}) error - Next(valuePtr interface{}) bool - NextBytes() []byte + ClientContextId() string Close() error + Metrics() QueryResultMetrics + Next(_ interface{}) bool + NextBytes() []byte + One(_ interface{}) error + Profile() interface{} + RequestId() string + SourceEndpoint() string +} + +type QueryRetryBehavior interface { + CanRetry(_ uint) bool + NextInterval(_ uint) time.Duration +} + +type SearchHighlightStyle string + +type SearchIndexDefinitionBuilder struct{} + +func (_ *SearchIndexDefinitionBuilder) AddField(_ string, _ interface{}) *SearchIndexDefinitionBuilder { + return nil +} + +type SearchIndexManager struct{} + +func (_ *SearchIndexManager) CreateIndex(_ SearchIndexDefinitionBuilder) error { + return nil +} + +func (_ *SearchIndexManager) DeleteIndex(_ string) (bool, error) { + return false, nil +} + +func (_ *SearchIndexManager) GetAllIndexDefinitions() ([]interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetAllIndexPartitionInfo() (interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetAllIndexStats() (interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetIndexDefinition(_ string) (interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetIndexPartitionIndexedDocumentCount(_ string) (int, error) { + return 0, nil +} + +func (_ *SearchIndexManager) GetIndexPartitionInfo(_ string) (interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetIndexStats(_ string) (interface{}, error) { + return nil, nil +} + +func (_ *SearchIndexManager) GetIndexedDocumentCount(_ string) (int, error) { + return 0, nil +} + +func (_ *SearchIndexManager) SetIndexIngestion(_ string, _ string) (bool, error) { + return false, nil +} + +func (_ *SearchIndexManager) SetIndexPlanFreeze(_ string, _ string) (bool, error) { + return false, nil +} + +func (_ *SearchIndexManager) SetIndexQuerying(_ string, _ string) (bool, error) { + return false, nil } type SearchQuery struct{} -type SearchResults interface { - Status() SearchResultStatus - Errors() []string - TotalHits() int - Hits() []SearchResultHit - Facets() map[string]SearchResultFacet - Took() time.Duration - MaxScore() float64 +func (_ *SearchQuery) AddFacet(_ string, _ interface{}) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Consistency(_ ConsistencyMode) *SearchQuery { + return nil +} + +func (_ *SearchQuery) ConsistentWith(_ *MutationState) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Explain(_ bool) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Fields(_ ...string) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Highlight(_ SearchHighlightStyle, _ ...string) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Limit(_ int) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Skip(_ int) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Sort(_ ...interface{}) *SearchQuery { + return nil +} + +func (_ *SearchQuery) Timeout(_ time.Duration) *SearchQuery { + return nil } type SearchResultDateFacet struct { - Name string `json:"name,omitempty"` - Min string `json:"min,omitempty"` - Max string `json:"max,omitempty"` - Count int `json:"count,omitempty"` + Name string + Min string + Max string + Count int } type SearchResultFacet struct { - Field string `json:"field,omitempty"` - Total int `json:"total,omitempty"` - Missing int `json:"missing,omitempty"` - Other int `json:"other,omitempty"` - Terms []SearchResultTermFacet `json:"terms,omitempty"` - NumericRanges []SearchResultNumericFacet `json:"numeric_ranges,omitempty"` - DateRanges []SearchResultDateFacet `json:"date_ranges,omitempty"` + Field string + Total int + Missing int + Other int + Terms []SearchResultTermFacet + NumericRanges []SearchResultNumericFacet + DateRanges []SearchResultDateFacet } type SearchResultHit struct { - Index string `json:"index,omitempty"` - Id string `json:"id,omitempty"` - Score float64 `json:"score,omitempty"` - Explanation map[string]interface{} `json:"explanation,omitempty"` - Locations map[string]map[string][]SearchResultLocation `json:"locations,omitempty"` - Fragments map[string][]string `json:"fragments,omitempty"` - // Deprecated: See AllFields - Fields map[string]string `json:"-"` - // AllFields is to avoid making a breaking change changing the type of Fields. Only - // fields in the response that are of type string will be put into Fields, all - // field types will be placed into AllFields. - AllFields map[string]interface{} `json:"fields,omitempty"` + Index string + Id string + Score float64 + Explanation map[string]interface{} + Locations map[string]map[string][]SearchResultLocation + Fragments map[string][]string + Fields map[string]string + AllFields map[string]interface{} } type SearchResultLocation struct { - Position int `json:"position,omitempty"` - Start int `json:"start,omitempty"` - End int `json:"end,omitempty"` - ArrayPositions []uint `json:"array_positions,omitempty"` + Position int + Start int + End int + ArrayPositions []uint } type SearchResultNumericFacet struct { - Name string `json:"name,omitempty"` - Min float64 `json:"min,omitempty"` - Max float64 `json:"max,omitempty"` - Count int `json:"count,omitempty"` + Name string + Min float64 + Max float64 + Count int } type SearchResultStatus struct { - Total int `json:"total,omitempty"` - Failed int `json:"failed,omitempty"` - Successful int `json:"successful,omitempty"` - Errors interface{} `json:"errors,omitempty"` + Total int + Failed int + Successful int + Errors interface{} } type SearchResultTermFacet struct { - Term string `json:"term,omitempty"` - Count int `json:"count,omitempty"` + Term string + Count int +} + +type SearchResults interface { + Errors() []string + Facets() map[string]SearchResultFacet + Hits() []SearchResultHit + MaxScore() float64 + Status() SearchResultStatus + Took() time.Duration + TotalHits() int +} + +type ServerStats map[string]map[string]string + +type ServiceType int + +type SortOrder int + +type SpatialQuery struct{} + +func (_ *SpatialQuery) Bbox(_ []float64) *SpatialQuery { + return nil +} + +func (_ *SpatialQuery) Custom(_ string, _ string) *SpatialQuery { + return nil +} + +func (_ *SpatialQuery) Development(_ bool) *SpatialQuery { + return nil +} + +func (_ *SpatialQuery) Limit(_ uint) *SpatialQuery { + return nil +} + +func (_ *SpatialQuery) Skip(_ uint) *SpatialQuery { + return nil +} + +func (_ *SpatialQuery) Stale(_ StaleMode) *SpatialQuery { + return nil +} + +type StaleMode int + +type StreamingBucket struct{} + +func (_ *StreamingBucket) IoRouter() interface{} { + return nil +} + +type SubdocDocFlag uint8 + +type SubdocFlag uint8 + +type Transcoder interface { + Decode(_ []byte, _ uint32, _ interface{}) error + Encode(_ interface{}) ([]byte, uint32, error) +} + +type User struct { + Id string + Name string + Type string + Roles []UserRole +} + +type UserPassPair struct { + Username string + Password string +} + +type UserRole struct { + Role string + BucketName string +} + +type UserSettings struct { + Name string + Password string + Roles []UserRole +} + +type View struct { + Map string + Reduce string +} + +type ViewQuery struct{} + +func (_ *ViewQuery) Custom(_ string, _ string) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Development(_ bool) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Group(_ bool) *ViewQuery { + return nil +} + +func (_ *ViewQuery) GroupLevel(_ uint) *ViewQuery { + return nil +} + +func (_ *ViewQuery) IdRange(_ string, _ string) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Key(_ interface{}) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Keys(_ []interface{}) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Limit(_ uint) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Order(_ SortOrder) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Range(_ interface{}, _ interface{}, _ bool) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Reduce(_ bool) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Skip(_ uint) *ViewQuery { + return nil +} + +func (_ *ViewQuery) Stale(_ StaleMode) *ViewQuery { + return nil +} + +type ViewResults interface { + Close() error + Next(_ interface{}) bool + NextBytes() []byte + One(_ interface{}) error } diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go index 3f520311f17d..d04a5d768c47 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go @@ -2,7 +2,7 @@ // This is a simple stub for github.com/couchbase/gocb/v2, strictly for use in testing. // See the LICENSE file for information about the licensing of the original library. -// Source: github.com/couchbase/gocb/v2 (exports: Cluster,Scope,Collection,TransactionAttemptContext,ViewIndexManager; functions: ) +// Source: github.com/couchbase/gocb/v2 (exports: AnalyticsResult,AnalyticsResultRaw,Cluster,Collection,ExistsResult,GetResult,LookupInReplicaResult,LookupInResult,MutateInResult,MutationResult,QueryResult,QueryResultRaw,Result,ScanResult,ScanResultItem,Scope,SearchResult,SearchResultRaw,TransactionAttemptContext,TransactionGetResult,TransactionQueryResult,ViewIndexManager,ViewResult,ViewResultRaw; functions: ) // Package gocb is a stub of github.com/couchbase/gocb/v2, generated by depstubber. package gocb @@ -783,7 +783,7 @@ func (_ *CouchbaseSet) Values() ([]interface{}, error) { } type CounterResult struct { - MutationResult MutationResult + MutationResult } func (_ CounterResult) Cas() Cas { @@ -840,7 +840,7 @@ type CreateBucketOptions struct { } type CreateBucketSettings struct { - BucketSettings BucketSettings + BucketSettings ConflictResolutionType ConflictResolutionType } @@ -1488,7 +1488,7 @@ type GetPendingMutationsAnalyticsOptions struct { } type GetReplicaResult struct { - GetResult GetResult + GetResult } func (_ *GetReplicaResult) Cas() Cas { @@ -1667,14 +1667,6 @@ type LookupInReplicaResult struct { *LookupInResult } -func (_ LookupInReplicaResult) Cas() Cas { - return 0 -} - -func (_ LookupInReplicaResult) Exists(_ uint) bool { - return false -} - func (_ *LookupInReplicaResult) IsReplica() bool { return false } @@ -1716,21 +1708,13 @@ type MutateInOptions struct { } type MutateInResult struct { - MutationResult MutationResult + MutationResult } func (_ MutateInResult) ContentAt(_ uint, _ interface{}) error { return nil } -func (_ MutateInResult) MutationToken() *MutationToken { - return nil -} - -func (_ *MutateInResult) Cas() Cas { - return 0 -} - type MutateInSpec struct{} type MutationResult struct { @@ -2131,13 +2115,13 @@ type Role struct { } type RoleAndDescription struct { - Role Role + Role DisplayName string Description string } type RoleAndOrigins struct { - Role Role + Role Origins []Origin } @@ -2881,7 +2865,7 @@ type User struct { } type UserAndMetadata struct { - User User + User Domain AuthDomain EffectiveRoles []RoleAndOrigins ExternalGroups []string diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/conn.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/conn.go deleted file mode 100644 index 28a0f913062f..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/conn.go +++ /dev/null @@ -1,26 +0,0 @@ -package sqlx - -import ( - "context" - "database/sql" -) - -type Conn struct { - *sql.Conn -} - -func (c *Conn) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { - return nil -} - -func (c *Conn) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { - return nil -} - -func (c *Conn) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *Row { - return nil -} - -func (c *Conn) QueryxContext(ctx context.Context, query string, args ...interface{}) (*Rows, error) { - return nil, nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/db.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/db.go deleted file mode 100644 index 4d50616a732f..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/db.go +++ /dev/null @@ -1,52 +0,0 @@ -package sqlx - -import ( - "context" - "database/sql" -) - -type DB struct { - *sql.DB - - // Mapper *reflectx.Mapper -} - -func (db *DB) Get(dest interface{}, query string, args ...interface{}) error { - return nil -} - -func (db *DB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { - return nil -} - -func (db *DB) QueryRowx(query string, args ...interface{}) *Row { - return nil -} - -func (db *DB) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *Row { - return nil -} - -func (db *DB) Queryx(query string, args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (db *DB) QueryxContext(ctx context.Context, query string, args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (db *DB) Select(dest interface{}, query string, args ...interface{}) error { - return nil -} - -func (db *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { - return nil -} - -func (db *DB) NamedQuery(query string, arg interface{}) (*Rows, error) { - return nil, nil -} - -func (db *DB) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*Rows, error) { - return nil, nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/namedstmt.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/namedstmt.go deleted file mode 100644 index 59b647ff48e6..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/namedstmt.go +++ /dev/null @@ -1,60 +0,0 @@ -package sqlx - -import ( - "context" - "database/sql" -) - -type NamedStmt struct { - Params []string - QueryString string - Stmt *sql.Stmt -} - -func (s *NamedStmt) Get(dest interface{}, args ...interface{}) error { - return nil -} - -func (s *NamedStmt) GetContext(ctx context.Context, dest interface{}, args ...interface{}) error { - return nil -} - -func (s *NamedStmt) QueryRow(args ...interface{}) *Row { - return nil -} - -func (s *NamedStmt) QueryRowContext(ctx context.Context, args ...interface{}) *Row { - return nil -} - -func (s *NamedStmt) Query(args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (s *NamedStmt) QueryContext(ctx context.Context, args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (s *NamedStmt) QueryRowx(args ...interface{}) *Row { - return nil -} - -func (s *NamedStmt) QueryRowxContext(ctx context.Context, args ...interface{}) *Row { - return nil -} - -func (s *NamedStmt) Queryx(args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (s *NamedStmt) QueryxContext(ctx context.Context, args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (s *NamedStmt) Select(dest interface{}, args ...interface{}) error { - return nil -} - -func (s *NamedStmt) SelectContext(ctx context.Context, dest interface{}, args ...interface{}) error { - return nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/row.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/row.go deleted file mode 100644 index fb427e8f6579..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/row.go +++ /dev/null @@ -1,21 +0,0 @@ -package sqlx - -type Row struct { - // Mapper *reflectx.Mapper -} - -func (r *Row) MapScan(dest map[string]interface{}) error { - return nil -} - -func (r *Row) StructScan(dest interface{}) error { - return nil -} - -func (r *Row) SliceScan(dest []interface{}) error { - return nil -} - -func (r *Row) Scan(dest ...interface{}) error { - return nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/rows.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/rows.go deleted file mode 100644 index e70af447c4f0..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/rows.go +++ /dev/null @@ -1,22 +0,0 @@ -package sqlx - -import "database/sql" - -type Rows struct { - *sql.Rows - - // Mapper *reflectx.Mapper - // contains filtered or unexported fields -} - -func (r *Rows) MapScan(dest map[string]interface{}) error { - return nil -} - -func (r *Rows) StructScan(dest interface{}) error { - return nil -} - -func (r *Rows) SliceScan(dest []interface{}) error { - return nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stmt.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stmt.go deleted file mode 100644 index c634566d3ea8..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stmt.go +++ /dev/null @@ -1,42 +0,0 @@ -package sqlx - -import ( - "context" - "database/sql" -) - -type Stmt struct { - *sql.Stmt -} - -func (s *Stmt) Get(dest interface{}, args ...interface{}) error { - return nil -} - -func (s *Stmt) GetContext(ctx context.Context, dest interface{}, args ...interface{}) error { - return nil -} - -func (s *Stmt) QueryRowx(args ...interface{}) *Row { - return nil -} - -func (s *Stmt) QueryRowxContext(ctx context.Context, args ...interface{}) *Row { - return nil -} - -func (s *Stmt) Queryx(args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (s *Stmt) QueryxContext(ctx context.Context, args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (s *Stmt) Select(dest interface{}, args ...interface{}) error { - return nil -} - -func (s *Stmt) SelectContext(ctx context.Context, dest interface{}, args ...interface{}) error { - return nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go index 888df0079618..b5584ee21540 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go @@ -1,67 +1,532 @@ +// Code generated by depstubber. DO NOT EDIT. +// This is a simple stub for github.com/jmoiron/sqlx, strictly for use in testing. + +// See the LICENSE file for information about the licensing of the original library. +// Source: github.com/jmoiron/sqlx (exports: Conn,DB,NamedStmt,Stmt,Tx; functions: Get,GetContext,NamedQuery,NamedQueryContext,Select,SelectContext) + +// Package sqlx is a stub of github.com/jmoiron/sqlx, generated by depstubber. package sqlx import ( - "context" - "database/sql" + context "context" + sql "database/sql" + driver "database/sql/driver" + time "time" ) -type ColScanner interface { - Columns() ([]string, error) - Scan(dest ...interface{}) error - Err() error +type Conn struct { + *sql.Conn + Mapper interface{} +} + +func (_ Conn) BeginTx(_ context.Context, _ *sql.TxOptions) (*sql.Tx, error) { + return nil, nil +} + +func (_ Conn) Close() error { + return nil +} + +func (_ Conn) ExecContext(_ context.Context, _ string, _ ...interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ Conn) PingContext(_ context.Context) error { + return nil +} + +func (_ Conn) PrepareContext(_ context.Context, _ string) (*sql.Stmt, error) { + return nil, nil +} + +func (_ Conn) QueryContext(_ context.Context, _ string, _ ...interface{}) (*sql.Rows, error) { + return nil, nil +} + +func (_ Conn) QueryRowContext(_ context.Context, _ string, _ ...interface{}) *sql.Row { + return nil +} + +func (_ Conn) Raw(_ func(interface{}) error) error { + return nil +} + +func (_ *Conn) BeginTxx(_ context.Context, _ *sql.TxOptions) (*Tx, error) { + return nil, nil +} + +func (_ *Conn) GetContext(_ context.Context, _ interface{}, _ string, _ ...interface{}) error { + return nil } -type Execer interface { - Exec(query string, args ...interface{}) (sql.Result, error) +func (_ *Conn) PreparexContext(_ context.Context, _ string) (*Stmt, error) { + return nil, nil } -type ExecerContext interface { - ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) +func (_ *Conn) QueryRowxContext(_ context.Context, _ string, _ ...interface{}) *Row { + return nil +} + +func (_ *Conn) QueryxContext(_ context.Context, _ string, _ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *Conn) Rebind(_ string) string { + return "" +} + +func (_ *Conn) SelectContext(_ context.Context, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +type DB struct { + *sql.DB + Mapper interface{} +} + +func (_ *DB) BeginTxx(_ context.Context, _ *sql.TxOptions) (*Tx, error) { + return nil, nil +} + +func (_ *DB) Beginx() (*Tx, error) { + return nil, nil +} + +func (_ *DB) BindNamed(_ string, _ interface{}) (string, []interface{}, error) { + return "", nil, nil +} + +func (_ *DB) Connx(_ context.Context) (*Conn, error) { + return nil, nil +} + +func (_ *DB) DriverName() string { + return "" +} + +func (_ *DB) Get(_ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func (_ *DB) GetContext(_ context.Context, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func (_ *DB) MapperFunc(_ func(string) string) {} + +func (_ *DB) MustBegin() *Tx { + return nil +} + +func (_ *DB) MustBeginTx(_ context.Context, _ *sql.TxOptions) *Tx { + return nil +} + +func (_ *DB) MustExec(_ string, _ ...interface{}) sql.Result { + return nil +} + +func (_ *DB) MustExecContext(_ context.Context, _ string, _ ...interface{}) sql.Result { + return nil +} + +func (_ *DB) NamedExec(_ string, _ interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ *DB) NamedExecContext(_ context.Context, _ string, _ interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ *DB) NamedQuery(_ string, _ interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *DB) NamedQueryContext(_ context.Context, _ string, _ interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *DB) PrepareNamed(_ string) (*NamedStmt, error) { + return nil, nil +} + +func (_ *DB) PrepareNamedContext(_ context.Context, _ string) (*NamedStmt, error) { + return nil, nil +} + +func (_ *DB) Preparex(_ string) (*Stmt, error) { + return nil, nil +} + +func (_ *DB) PreparexContext(_ context.Context, _ string) (*Stmt, error) { + return nil, nil +} + +func (_ *DB) QueryRowx(_ string, _ ...interface{}) *Row { + return nil +} + +func (_ *DB) QueryRowxContext(_ context.Context, _ string, _ ...interface{}) *Row { + return nil +} + +func (_ *DB) Queryx(_ string, _ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *DB) QueryxContext(_ context.Context, _ string, _ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *DB) Rebind(_ string) string { + return "" +} + +func (_ *DB) Select(_ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func (_ *DB) SelectContext(_ context.Context, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func (_ *DB) Unsafe() *DB { + return nil } type Ext interface { - Queryer - Execer + BindNamed(_ string, _ interface{}) (string, []interface{}, error) + DriverName() string + Exec(_ string, _ ...interface{}) (sql.Result, error) + Query(_ string, _ ...interface{}) (*sql.Rows, error) + QueryRowx(_ string, _ ...interface{}) *Row + Queryx(_ string, _ ...interface{}) (*Rows, error) + Rebind(_ string) string } type ExtContext interface { - QueryerContext - ExecerContext - // contains filtered or unexported methods + BindNamed(_ string, _ interface{}) (string, []interface{}, error) + DriverName() string + ExecContext(_ context.Context, _ string, _ ...interface{}) (sql.Result, error) + QueryContext(_ context.Context, _ string, _ ...interface{}) (*sql.Rows, error) + QueryRowxContext(_ context.Context, _ string, _ ...interface{}) *Row + QueryxContext(_ context.Context, _ string, _ ...interface{}) (*Rows, error) + Rebind(_ string) string +} + +func Get(_ Queryer, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func GetContext(_ context.Context, _ QueryerContext, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func NamedQuery(_ Ext, _ string, _ interface{}) (*Rows, error) { + return nil, nil +} + +func NamedQueryContext(_ context.Context, _ ExtContext, _ string, _ interface{}) (*Rows, error) { + return nil, nil +} + +type NamedStmt struct { + Params []string + QueryString string + Stmt *Stmt +} + +func (_ *NamedStmt) Close() error { + return nil +} + +func (_ *NamedStmt) Exec(_ interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ *NamedStmt) ExecContext(_ context.Context, _ interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ *NamedStmt) Get(_ interface{}, _ interface{}) error { + return nil +} + +func (_ *NamedStmt) GetContext(_ context.Context, _ interface{}, _ interface{}) error { + return nil +} + +func (_ *NamedStmt) MustExec(_ interface{}) sql.Result { + return nil +} + +func (_ *NamedStmt) MustExecContext(_ context.Context, _ interface{}) sql.Result { + return nil +} + +func (_ *NamedStmt) Query(_ interface{}) (*sql.Rows, error) { + return nil, nil +} + +func (_ *NamedStmt) QueryContext(_ context.Context, _ interface{}) (*sql.Rows, error) { + return nil, nil +} + +func (_ *NamedStmt) QueryRow(_ interface{}) *Row { + return nil +} + +func (_ *NamedStmt) QueryRowContext(_ context.Context, _ interface{}) *Row { + return nil +} + +func (_ *NamedStmt) QueryRowx(_ interface{}) *Row { + return nil +} + +func (_ *NamedStmt) QueryRowxContext(_ context.Context, _ interface{}) *Row { + return nil +} + +func (_ *NamedStmt) Queryx(_ interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *NamedStmt) QueryxContext(_ context.Context, _ interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *NamedStmt) Select(_ interface{}, _ interface{}) error { + return nil +} + +func (_ *NamedStmt) SelectContext(_ context.Context, _ interface{}, _ interface{}) error { + return nil +} + +func (_ *NamedStmt) Unsafe() *NamedStmt { + return nil } type Queryer interface { - Query(query string, args ...interface{}) (*sql.Rows, error) - Queryx(query string, args ...interface{}) (*Rows, error) - QueryRowx(query string, args ...interface{}) *Row + Query(_ string, _ ...interface{}) (*sql.Rows, error) + QueryRowx(_ string, _ ...interface{}) *Row + Queryx(_ string, _ ...interface{}) (*Rows, error) } type QueryerContext interface { - QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) - QueryxContext(ctx context.Context, query string, args ...interface{}) (*Rows, error) - QueryRowxContext(ctx context.Context, query string, args ...interface{}) *Row + QueryContext(_ context.Context, _ string, _ ...interface{}) (*sql.Rows, error) + QueryRowxContext(_ context.Context, _ string, _ ...interface{}) *Row + QueryxContext(_ context.Context, _ string, _ ...interface{}) (*Rows, error) +} + +type Row struct { + Mapper interface{} +} + +func (_ *Row) ColumnTypes() ([]*sql.ColumnType, error) { + return nil, nil +} + +func (_ *Row) Columns() ([]string, error) { + return nil, nil +} + +func (_ *Row) Err() error { + return nil +} + +func (_ *Row) MapScan(_ map[string]interface{}) error { + return nil +} + +func (_ *Row) Scan(_ ...interface{}) error { + return nil +} + +func (_ *Row) SliceScan() ([]interface{}, error) { + return nil, nil +} + +func (_ *Row) StructScan(_ interface{}) error { + return nil +} + +type Rows struct { + *sql.Rows + Mapper interface{} +} + +func (_ *Rows) MapScan(_ map[string]interface{}) error { + return nil +} + +func (_ *Rows) SliceScan() ([]interface{}, error) { + return nil, nil +} + +func (_ *Rows) StructScan(_ interface{}) error { + return nil +} + +func Select(_ Queryer, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func SelectContext(_ context.Context, _ QueryerContext, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +type Stmt struct { + *sql.Stmt + Mapper interface{} +} + +func (_ *Stmt) Get(_ interface{}, _ ...interface{}) error { + return nil +} + +func (_ *Stmt) GetContext(_ context.Context, _ interface{}, _ ...interface{}) error { + return nil +} + +func (_ *Stmt) MustExec(_ ...interface{}) sql.Result { + return nil +} + +func (_ *Stmt) MustExecContext(_ context.Context, _ ...interface{}) sql.Result { + return nil +} + +func (_ *Stmt) QueryRowx(_ ...interface{}) *Row { + return nil +} + +func (_ *Stmt) QueryRowxContext(_ context.Context, _ ...interface{}) *Row { + return nil +} + +func (_ *Stmt) Queryx(_ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *Stmt) QueryxContext(_ context.Context, _ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *Stmt) Select(_ interface{}, _ ...interface{}) error { + return nil +} + +func (_ *Stmt) SelectContext(_ context.Context, _ interface{}, _ ...interface{}) error { + return nil +} + +func (_ *Stmt) Unsafe() *Stmt { + return nil +} + +type Tx struct { + *sql.Tx + Mapper interface{} +} + +func (_ *Tx) BindNamed(_ string, _ interface{}) (string, []interface{}, error) { + return "", nil, nil +} + +func (_ *Tx) DriverName() string { + return "" +} + +func (_ *Tx) Get(_ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func (_ *Tx) GetContext(_ context.Context, _ interface{}, _ string, _ ...interface{}) error { + return nil +} + +func (_ *Tx) MustExec(_ string, _ ...interface{}) sql.Result { + return nil +} + +func (_ *Tx) MustExecContext(_ context.Context, _ string, _ ...interface{}) sql.Result { + return nil +} + +func (_ *Tx) NamedExec(_ string, _ interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ *Tx) NamedExecContext(_ context.Context, _ string, _ interface{}) (sql.Result, error) { + return nil, nil +} + +func (_ *Tx) NamedQuery(_ string, _ interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *Tx) NamedStmt(_ *NamedStmt) *NamedStmt { + return nil +} + +func (_ *Tx) NamedStmtContext(_ context.Context, _ *NamedStmt) *NamedStmt { + return nil +} + +func (_ *Tx) PrepareNamed(_ string) (*NamedStmt, error) { + return nil, nil } -func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) { - return e.Queryx(query, arg) +func (_ *Tx) PrepareNamedContext(_ context.Context, _ string) (*NamedStmt, error) { + return nil, nil } -func NamedQueryContext(ctx context.Context, e ExtContext, query string, arg interface{}) (*Rows, error) { - return e.QueryxContext(ctx, query, arg) +func (_ *Tx) Preparex(_ string) (*Stmt, error) { + return nil, nil +} + +func (_ *Tx) PreparexContext(_ context.Context, _ string) (*Stmt, error) { + return nil, nil +} + +func (_ *Tx) QueryRowx(_ string, _ ...interface{}) *Row { + return nil +} + +func (_ *Tx) QueryRowxContext(_ context.Context, _ string, _ ...interface{}) *Row { + return nil +} + +func (_ *Tx) Queryx(_ string, _ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *Tx) QueryxContext(_ context.Context, _ string, _ ...interface{}) (*Rows, error) { + return nil, nil +} + +func (_ *Tx) Rebind(_ string) string { + return "" +} + +func (_ *Tx) Select(_ interface{}, _ string, _ ...interface{}) error { + return nil } -func Get(q Queryer, dest interface{}, query string, args ...interface{}) error { +func (_ *Tx) SelectContext(_ context.Context, _ interface{}, _ string, _ ...interface{}) error { return nil } -func GetContext(ctx context.Context, q QueryerContext, dest interface{}, query string, args ...interface{}) error { +func (_ *Tx) Stmtx(_ interface{}) *Stmt { return nil } -func Select(q Queryer, dest interface{}, query string, args ...interface{}) error { +func (_ *Tx) StmtxContext(_ context.Context, _ interface{}) *Stmt { return nil } -func SelectContext(ctx context.Context, q QueryerContext, dest interface{}, query string, args ...interface{}) error { +func (_ *Tx) Unsafe() *Tx { return nil } diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/tx.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/tx.go deleted file mode 100644 index 38ca8b535314..000000000000 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/tx.go +++ /dev/null @@ -1,47 +0,0 @@ -package sqlx - -import ( - "context" - "database/sql" -) - -type Tx struct { - *sql.Tx -} - -func (tx *Tx) Get(dest interface{}, args ...interface{}) error { - return nil -} - -func (tx *Tx) GetContext(ctx context.Context, dest interface{}, args ...interface{}) error { - return nil -} - -func (tx *Tx) QueryRowx(args ...interface{}) *Row { - return nil -} - -func (tx *Tx) QueryRowxContext(ctx context.Context, args ...interface{}) *Row { - - return nil -} - -func (tx *Tx) Queryx(args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (tx *Tx) QueryxContext(ctx context.Context, args ...interface{}) (*Rows, error) { - return nil, nil -} - -func (tx *Tx) Select(dest interface{}, args ...interface{}) error { - return nil -} - -func (tx *Tx) SelectContext(ctx context.Context, dest interface{}, args ...interface{}) error { - return nil -} - -func (tx *Tx) NamedQuery(query string, arg interface{}) (*Rows, error) { - return nil, nil -} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/gorm.io/gorm/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/gorm.io/gorm/stub.go index d17686106452..50b332b2a95a 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/gorm.io/gorm/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/gorm.io/gorm/stub.go @@ -1,77 +1,878 @@ +// Code generated by depstubber. DO NOT EDIT. +// This is a simple stub for gorm.io/gorm, strictly for use in testing. + +// See the LICENSE file for information about the licensing of the original library. +// Source: gorm.io/gorm (exports: Association,ConnPool,DB; functions: ) + +// Package gorm is a stub of gorm.io/gorm, generated by depstubber. package gorm import ( - "context" - "database/sql" + context "context" + sql "database/sql" + reflect "reflect" + strings "strings" + sync "sync" + time "time" ) -type DB struct{} +type Association struct { + DB *DB + Relationship interface{} + Unscope bool + Error error +} -func (db *DB) Find(dest interface{}, conds ...interface{}) *DB { - return db +func (_ *Association) Append(_ ...interface{}) error { + return nil } -func (db *DB) FindInBatches(dest interface{}, batchSize int, fc func(tx *DB, batch int) error) *DB { - return db +func (_ *Association) Clear() error { + return nil } -func (db *DB) FirstOrCreate(dest interface{}, conds ...interface{}) *DB { - return db +func (_ *Association) Count() int64 { + return 0 } -func (db *DB) FirstOrInit(dest interface{}, conds ...interface{}) *DB { - return db +func (_ *Association) Delete(_ ...interface{}) error { + return nil } -func (db *DB) First(dest interface{}, conds ...interface{}) *DB { - return db +func (_ *Association) Find(_ interface{}, _ ...interface{}) error { + return nil } -func (db *DB) Model(value interface{}) *DB { - return db +func (_ *Association) Replace(_ ...interface{}) error { + return nil } -func (db *DB) Last(dest interface{}, conds ...interface{}) *DB { - return db +func (_ *Association) Unscoped() *Association { + return nil } -func (db *DB) Pluck(column string, dest interface{}) *DB { - return db +type ColumnType interface { + AutoIncrement() (bool, bool) + ColumnType() (string, bool) + Comment() (string, bool) + DatabaseTypeName() string + DecimalSize() (int64, int64, bool) + DefaultValue() (string, bool) + Length() (int64, bool) + Name() string + Nullable() (bool, bool) + PrimaryKey() (bool, bool) + ScanType() reflect.Type + Unique() (bool, bool) } -func (db *DB) Take(dest interface{}, conds ...interface{}) *DB { - return db +type Config struct { + SkipDefaultTransaction bool + NamingStrategy interface{} + FullSaveAssociations bool + Logger interface{} + NowFunc func() time.Time + DryRun bool + PrepareStmt bool + DisableAutomaticPing bool + DisableForeignKeyConstraintWhenMigrating bool + IgnoreRelationshipsWhenMigrating bool + DisableNestedTransaction bool + AllowGlobalUpdate bool + QueryFields bool + CreateBatchSize int + TranslateError bool + PropagateUnscoped bool + ClauseBuilders map[string]interface{} + ConnPool ConnPool + Dialector + Plugins map[string]Plugin } -func (db *DB) Scan(dest interface{}) *DB { - return db +func (_ Config) BindVarTo(_ interface{}, _ *Statement, _ interface{}) {} + +func (_ Config) DataTypeOf(_ interface{}) string { + return "" } -func (db *DB) ScanRows(rows *sql.Rows, result interface{}) error { +func (_ Config) DefaultValueOf(_ interface{}) interface{} { return nil } -func (db *DB) Row() *sql.Row { +func (_ Config) Explain(_ string, _ ...interface{}) string { + return "" +} + +func (_ Config) Initialize(_ *DB) error { return nil } -func (db *DB) Rows() (*sql.Rows, error) { - return nil, nil +func (_ Config) Migrator(_ *DB) Migrator { + return nil } -type Association struct { - DB *DB +func (_ Config) Name() string { + return "" } -func (a *Association) Find(dest interface{}) *Association { - return a +func (_ Config) QuoteTo(_ interface{}, _ string) {} + +func (_ *Config) AfterInitialize(_ *DB) error { + return nil +} + +func (_ *Config) Apply(_ *Config) error { + return nil } type ConnPool interface { - PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) - ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) - QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) - QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + ExecContext(_ context.Context, _ string, _ ...interface{}) (sql.Result, error) + PrepareContext(_ context.Context, _ string) (*sql.Stmt, error) + QueryContext(_ context.Context, _ string, _ ...interface{}) (*sql.Rows, error) + QueryRowContext(_ context.Context, _ string, _ ...interface{}) *sql.Row +} + +type DB struct { + *Config + Error error + RowsAffected int64 + Statement *Statement +} + +func (_ DB) AfterInitialize(_ *DB) error { + return nil +} + +func (_ DB) Apply(_ *Config) error { + return nil +} + +func (_ DB) BindVarTo(_ interface{}, _ *Statement, _ interface{}) {} + +func (_ DB) DataTypeOf(_ interface{}) string { + return "" +} + +func (_ DB) DefaultValueOf(_ interface{}) interface{} { + return nil +} + +func (_ DB) Explain(_ string, _ ...interface{}) string { + return "" +} + +func (_ DB) Initialize(_ *DB) error { + return nil +} + +func (_ DB) Name() string { + return "" +} + +func (_ DB) QuoteTo(_ interface{}, _ string) {} + +func (_ *DB) AddError(_ error) error { + return nil +} + +func (_ *DB) Assign(_ ...interface{}) *DB { + return nil +} + +func (_ *DB) Association(_ string) *Association { + return nil +} + +func (_ *DB) Attrs(_ ...interface{}) *DB { + return nil +} + +func (_ *DB) AutoMigrate(_ ...interface{}) error { + return nil +} + +func (_ *DB) Begin(_ ...*sql.TxOptions) *DB { + return nil } -type Model interface{} +func (_ *DB) Callback() interface{} { + return nil +} + +func (_ *DB) Clauses(_ ...interface{}) *DB { + return nil +} + +func (_ *DB) Commit() *DB { + return nil +} + +func (_ *DB) Connection(_ func(*DB) error) error { + return nil +} + +func (_ *DB) Count(_ *int64) *DB { + return nil +} + +func (_ *DB) Create(_ interface{}) *DB { + return nil +} + +func (_ *DB) CreateInBatches(_ interface{}, _ int) *DB { + return nil +} + +func (_ *DB) DB() (*sql.DB, error) { + return nil, nil +} + +func (_ *DB) Debug() *DB { + return nil +} + +func (_ *DB) Delete(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Distinct(_ ...interface{}) *DB { + return nil +} + +func (_ *DB) Exec(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Find(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) FindInBatches(_ interface{}, _ int, _ func(*DB, int) error) *DB { + return nil +} + +func (_ *DB) First(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) FirstOrCreate(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) FirstOrInit(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Get(_ string) (interface{}, bool) { + return nil, false +} + +func (_ *DB) Group(_ string) *DB { + return nil +} + +func (_ *DB) Having(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) InnerJoins(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) InstanceGet(_ string) (interface{}, bool) { + return nil, false +} + +func (_ *DB) InstanceSet(_ string, _ interface{}) *DB { + return nil +} + +func (_ *DB) Joins(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Last(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Limit(_ int) *DB { + return nil +} + +func (_ *DB) MapColumns(_ map[string]string) *DB { + return nil +} + +func (_ *DB) Migrator() Migrator { + return nil +} + +func (_ *DB) Model(_ interface{}) *DB { + return nil +} + +func (_ *DB) Not(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Offset(_ int) *DB { + return nil +} + +func (_ *DB) Omit(_ ...string) *DB { + return nil +} + +func (_ *DB) Or(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Order(_ interface{}) *DB { + return nil +} + +func (_ *DB) Pluck(_ string, _ interface{}) *DB { + return nil +} + +func (_ *DB) Preload(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Raw(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Rollback() *DB { + return nil +} + +func (_ *DB) RollbackTo(_ string) *DB { + return nil +} + +func (_ *DB) Row() *sql.Row { + return nil +} + +func (_ *DB) Rows() (*sql.Rows, error) { + return nil, nil +} + +func (_ *DB) Save(_ interface{}) *DB { + return nil +} + +func (_ *DB) SavePoint(_ string) *DB { + return nil +} + +func (_ *DB) Scan(_ interface{}) *DB { + return nil +} + +func (_ *DB) ScanRows(_ *sql.Rows, _ interface{}) error { + return nil +} + +func (_ *DB) Scopes(_ ...func(*DB) *DB) *DB { + return nil +} + +func (_ *DB) Select(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Session(_ *Session) *DB { + return nil +} + +func (_ *DB) Set(_ string, _ interface{}) *DB { + return nil +} + +func (_ *DB) SetupJoinTable(_ interface{}, _ string, _ interface{}) error { + return nil +} + +func (_ *DB) Table(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) Take(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) ToSQL(_ func(*DB) *DB) string { + return "" +} + +func (_ *DB) Transaction(_ func(*DB) error, _ ...*sql.TxOptions) error { + return nil +} + +func (_ *DB) Unscoped() *DB { + return nil +} + +func (_ *DB) Update(_ string, _ interface{}) *DB { + return nil +} + +func (_ *DB) UpdateColumn(_ string, _ interface{}) *DB { + return nil +} + +func (_ *DB) UpdateColumns(_ interface{}) *DB { + return nil +} + +func (_ *DB) Updates(_ interface{}) *DB { + return nil +} + +func (_ *DB) Use(_ Plugin) error { + return nil +} + +func (_ *DB) Where(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ *DB) WithContext(_ context.Context) *DB { + return nil +} + +type Dialector interface { + BindVarTo(_ interface{}, _ *Statement, _ interface{}) + DataTypeOf(_ interface{}) string + DefaultValueOf(_ interface{}) interface{} + Explain(_ string, _ ...interface{}) string + Initialize(_ *DB) error + Migrator(_ *DB) Migrator + Name() string + QuoteTo(_ interface{}, _ string) +} + +type Index interface { + Columns() []string + Name() string + Option() string + PrimaryKey() (bool, bool) + Table() string + Unique() (bool, bool) +} + +type Migrator interface { + AddColumn(_ interface{}, _ string) error + AlterColumn(_ interface{}, _ string) error + AutoMigrate(_ ...interface{}) error + ColumnTypes(_ interface{}) ([]ColumnType, error) + CreateConstraint(_ interface{}, _ string) error + CreateIndex(_ interface{}, _ string) error + CreateTable(_ ...interface{}) error + CreateView(_ string, _ ViewOption) error + CurrentDatabase() string + DropColumn(_ interface{}, _ string) error + DropConstraint(_ interface{}, _ string) error + DropIndex(_ interface{}, _ string) error + DropTable(_ ...interface{}) error + DropView(_ string) error + FullDataTypeOf(_ interface{}) interface{} + GetIndexes(_ interface{}) ([]Index, error) + GetTables() ([]string, error) + GetTypeAliases(_ string) []string + HasColumn(_ interface{}, _ string) bool + HasConstraint(_ interface{}, _ string) bool + HasIndex(_ interface{}, _ string) bool + HasTable(_ interface{}) bool + MigrateColumn(_ interface{}, _ interface{}, _ ColumnType) error + MigrateColumnUnique(_ interface{}, _ interface{}, _ ColumnType) error + RenameColumn(_ interface{}, _ string, _ string) error + RenameIndex(_ interface{}, _ string, _ string) error + RenameTable(_ interface{}, _ interface{}) error + TableType(_ interface{}) (TableType, error) +} + +type Plugin interface { + Initialize(_ *DB) error + Name() string +} + +type Session struct { + DryRun bool + PrepareStmt bool + NewDB bool + Initialized bool + SkipHooks bool + SkipDefaultTransaction bool + DisableNestedTransaction bool + AllowGlobalUpdate bool + FullSaveAssociations bool + PropagateUnscoped bool + QueryFields bool + Context context.Context + Logger interface{} + NowFunc func() time.Time + CreateBatchSize int +} + +type Statement struct { + *DB + TableExpr interface{} + Table string + Model interface{} + Unscoped bool + Dest interface{} + ReflectValue reflect.Value + Clauses map[string]interface{} + BuildClauses []string + Distinct bool + Selects []string + Omits []string + ColumnMapping map[string]string + Joins []interface{} + Preloads map[string][]interface{} + Settings sync.Map + ConnPool ConnPool + Schema interface{} + Context context.Context + RaiseErrorOnNotFound bool + SkipHooks bool + SQL strings.Builder + Vars []interface{} + CurDestIndex int +} + +func (_ Statement) AddError(_ error) error { + return nil +} + +func (_ Statement) AfterInitialize(_ *DB) error { + return nil +} + +func (_ Statement) Apply(_ *Config) error { + return nil +} + +func (_ Statement) Assign(_ ...interface{}) *DB { + return nil +} + +func (_ Statement) Association(_ string) *Association { + return nil +} + +func (_ Statement) Attrs(_ ...interface{}) *DB { + return nil +} + +func (_ Statement) AutoMigrate(_ ...interface{}) error { + return nil +} + +func (_ Statement) Begin(_ ...*sql.TxOptions) *DB { + return nil +} + +func (_ Statement) BindVarTo(_ interface{}, _ *Statement, _ interface{}) {} + +func (_ Statement) Callback() interface{} { + return nil +} + +func (_ Statement) Commit() *DB { + return nil +} + +func (_ Statement) Connection(_ func(*DB) error) error { + return nil +} + +func (_ Statement) Count(_ *int64) *DB { + return nil +} + +func (_ Statement) Create(_ interface{}) *DB { + return nil +} + +func (_ Statement) CreateInBatches(_ interface{}, _ int) *DB { + return nil +} + +func (_ Statement) DataTypeOf(_ interface{}) string { + return "" +} + +func (_ Statement) Debug() *DB { + return nil +} + +func (_ Statement) DefaultValueOf(_ interface{}) interface{} { + return nil +} + +func (_ Statement) Delete(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Exec(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Explain(_ string, _ ...interface{}) string { + return "" +} + +func (_ Statement) Find(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) FindInBatches(_ interface{}, _ int, _ func(*DB, int) error) *DB { + return nil +} + +func (_ Statement) First(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) FirstOrCreate(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) FirstOrInit(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Get(_ string) (interface{}, bool) { + return nil, false +} + +func (_ Statement) Group(_ string) *DB { + return nil +} + +func (_ Statement) Having(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Initialize(_ *DB) error { + return nil +} + +func (_ Statement) InnerJoins(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) InstanceGet(_ string) (interface{}, bool) { + return nil, false +} + +func (_ Statement) InstanceSet(_ string, _ interface{}) *DB { + return nil +} + +func (_ Statement) Last(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Limit(_ int) *DB { + return nil +} + +func (_ Statement) MapColumns(_ map[string]string) *DB { + return nil +} + +func (_ Statement) Migrator() Migrator { + return nil +} + +func (_ Statement) Name() string { + return "" +} + +func (_ Statement) Not(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Offset(_ int) *DB { + return nil +} + +func (_ Statement) Omit(_ ...string) *DB { + return nil +} + +func (_ Statement) Or(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Order(_ interface{}) *DB { + return nil +} + +func (_ Statement) Pluck(_ string, _ interface{}) *DB { + return nil +} + +func (_ Statement) Preload(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Raw(_ string, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Rollback() *DB { + return nil +} + +func (_ Statement) RollbackTo(_ string) *DB { + return nil +} + +func (_ Statement) Row() *sql.Row { + return nil +} + +func (_ Statement) Rows() (*sql.Rows, error) { + return nil, nil +} + +func (_ Statement) Save(_ interface{}) *DB { + return nil +} + +func (_ Statement) SavePoint(_ string) *DB { + return nil +} + +func (_ Statement) Scan(_ interface{}) *DB { + return nil +} + +func (_ Statement) ScanRows(_ *sql.Rows, _ interface{}) error { + return nil +} + +func (_ Statement) Scopes(_ ...func(*DB) *DB) *DB { + return nil +} + +func (_ Statement) Select(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) Session(_ *Session) *DB { + return nil +} + +func (_ Statement) Set(_ string, _ interface{}) *DB { + return nil +} + +func (_ Statement) SetupJoinTable(_ interface{}, _ string, _ interface{}) error { + return nil +} + +func (_ Statement) Take(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) ToSQL(_ func(*DB) *DB) string { + return "" +} + +func (_ Statement) Transaction(_ func(*DB) error, _ ...*sql.TxOptions) error { + return nil +} + +func (_ Statement) Update(_ string, _ interface{}) *DB { + return nil +} + +func (_ Statement) UpdateColumn(_ string, _ interface{}) *DB { + return nil +} + +func (_ Statement) UpdateColumns(_ interface{}) *DB { + return nil +} + +func (_ Statement) Updates(_ interface{}) *DB { + return nil +} + +func (_ Statement) Use(_ Plugin) error { + return nil +} + +func (_ Statement) Where(_ interface{}, _ ...interface{}) *DB { + return nil +} + +func (_ Statement) WithContext(_ context.Context) *DB { + return nil +} + +func (_ *Statement) AddClause(_ interface{}) {} + +func (_ *Statement) AddClauseIfNotExists(_ interface{}) {} + +func (_ *Statement) AddVar(_ interface{}, _ ...interface{}) {} + +func (_ *Statement) Build(_ ...string) {} + +func (_ *Statement) BuildCondition(_ interface{}, _ ...interface{}) []interface{} { + return nil +} + +func (_ *Statement) Changed(_ ...string) bool { + return false +} + +func (_ *Statement) Parse(_ interface{}) error { + return nil +} + +func (_ *Statement) ParseWithSpecialTableName(_ interface{}, _ string) error { + return nil +} + +func (_ *Statement) Quote(_ interface{}) string { + return "" +} + +func (_ *Statement) QuoteTo(_ interface{}, _ interface{}) {} + +func (_ *Statement) SelectAndOmitColumns(_ bool, _ bool) (map[string]bool, bool) { + return nil, false +} + +func (_ *Statement) SetColumn(_ string, _ interface{}, _ ...bool) {} + +func (_ *Statement) WriteByte(_ byte) error { + return nil +} + +func (_ *Statement) WriteQuoted(_ interface{}) {} + +func (_ *Statement) WriteString(_ string) (int, error) { + return 0, nil +} + +type TableType interface { + Comment() (string, bool) + Name() string + Schema() string + Type() string +} + +type ViewOption struct { + Replace bool + CheckOption string + Query *DB +} diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/modules.txt index 333381508d66..874a14a52882 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/modules.txt @@ -1,9 +1,144 @@ -# gorm.io/gorm v1.23.0 +# github.com/astaxie/beego v1.12.3 ## explicit -gorm.io/gorm +github.com/astaxie/beego/orm +# github.com/beego/beego/v2 v2.3.5 +## explicit +github.com/beego/beego/v2/client/orm +# github.com/couchbase/gocb v1.6.7 +## explicit +github.com/couchbase/gocb +# github.com/couchbase/gocb/v2 v2.9.4 +## explicit +github.com/couchbase/gocb/v2 # github.com/jmoiron/sqlx v1.4.0 ## explicit github.com/jmoiron/sqlx -# go.mongodb.org/mongo-driver/mongo v1.17.2 +# github.com/rqlite/gorqlite v0.0.0-20250128004930-114c7828b55a +## explicit +github.com/rqlite/gorqlite +# go.mongodb.org/mongo-driver v1.17.3 ## explicit go.mongodb.org/mongo-driver/mongo +# gorm.io/gorm v1.25.12 +## explicit +gorm.io/gorm +# github.com/couchbase/gocbcore/v10 v10.5.4 +## explicit +github.com/couchbase/gocbcore/v10 +# github.com/couchbase/gocbcoreps v0.1.3 +## explicit +github.com/couchbase/gocbcoreps +# github.com/couchbase/goprotostellar v1.0.2 +## explicit +github.com/couchbase/goprotostellar +# github.com/couchbaselabs/gocbconnstr/v2 v2.0.0-20240607131231-fb385523de28 +## explicit +github.com/couchbaselabs/gocbconnstr/v2 +# github.com/go-logr/logr v1.4.1 +## explicit +github.com/go-logr/logr +# github.com/go-logr/stdr v1.2.2 +## explicit +github.com/go-logr/stdr +# github.com/golang/snappy v0.0.4 +## explicit +github.com/golang/snappy +# github.com/google/uuid v1.6.0 +## explicit +github.com/google/uuid +# github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 +## explicit +github.com/grpc-ecosystem/go-grpc-middleware +# github.com/hashicorp/golang-lru v0.5.4 +## explicit +github.com/hashicorp/golang-lru +# github.com/jinzhu/inflection v1.0.0 +## explicit +github.com/jinzhu/inflection +# github.com/jinzhu/now v1.1.5 +## explicit +github.com/jinzhu/now +# github.com/klauspost/compress v1.16.7 +## explicit +github.com/klauspost/compress +# github.com/montanaflynn/stats v0.7.1 +## explicit +github.com/montanaflynn/stats +# github.com/opentracing/opentracing-go v1.2.0 +## explicit +github.com/opentracing/opentracing-go +# github.com/pkg/errors v0.9.1 +## explicit +github.com/pkg/errors +# github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 +## explicit +github.com/shiena/ansicolor +# github.com/valyala/bytebufferpool v1.0.0 +## explicit +github.com/valyala/bytebufferpool +# github.com/xdg-go/pbkdf2 v1.0.0 +## explicit +github.com/xdg-go/pbkdf2 +# github.com/xdg-go/scram v1.1.2 +## explicit +github.com/xdg-go/scram +# github.com/xdg-go/stringprep v1.0.4 +## explicit +github.com/xdg-go/stringprep +# github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 +## explicit +github.com/youmark/pkcs8 +# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 +## explicit +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc +# go.opentelemetry.io/otel v1.24.0 +## explicit +go.opentelemetry.io/otel +# go.opentelemetry.io/otel/metric v1.24.0 +## explicit +go.opentelemetry.io/otel/metric +# go.opentelemetry.io/otel/trace v1.24.0 +## explicit +go.opentelemetry.io/otel/trace +# go.uber.org/multierr v1.11.0 +## explicit +go.uber.org/multierr +# go.uber.org/zap v1.27.0 +## explicit +go.uber.org/zap +# golang.org/x/crypto v0.26.0 +## explicit +golang.org/x/crypto +# golang.org/x/net v0.24.0 +## explicit +golang.org/x/net +# golang.org/x/sync v0.8.0 +## explicit +golang.org/x/sync +# golang.org/x/sys v0.23.0 +## explicit +golang.org/x/sys +# golang.org/x/text v0.17.0 +## explicit +golang.org/x/text +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda +## explicit +google.golang.org/genproto/googleapis/rpc +# google.golang.org/grpc v1.63.2 +## explicit +google.golang.org/grpc +# google.golang.org/protobuf v1.34.2 +## explicit +google.golang.org/protobuf +# 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.1 +## explicit +gopkg.in/couchbaselabs/jsonx.v1 From 2790415772c7696f813ee3da3fa60c3c51028b6b Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:16:46 +0000 Subject: [PATCH 9/9] Remove imports that aren't used --- .../local/database/vendor/github.com/jmoiron/sqlx/stub.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go index b5584ee21540..da93fccb4e07 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/jmoiron/sqlx/stub.go @@ -10,8 +10,6 @@ package sqlx import ( context "context" sql "database/sql" - driver "database/sql/driver" - time "time" ) type Conn struct {