-
Notifications
You must be signed in to change notification settings - Fork 79
/
database_views.go
56 lines (47 loc) · 2.27 KB
/
database_views.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// DISCLAIMER
//
// Copyright 2018-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package driver
import "context"
// DatabaseViews provides access to all views in a single database.
// Views are only available in ArangoDB 3.4 and higher.
type DatabaseViews interface {
// View opens a connection to an existing view within the database.
// If no collection with given name exists, an NotFoundError is returned.
View(ctx context.Context, name string) (View, error)
// ViewExists returns true if a view with given name exists within the database.
ViewExists(ctx context.Context, name string) (bool, error)
// Views return a list of all views in the database.
Views(ctx context.Context) ([]View, error)
// CreateArangoSearchView creates a new view of type ArangoSearch,
// with given name and options, and opens a connection to it.
// If a view with given name already exists within the database, a ConflictError is returned.
CreateArangoSearchView(ctx context.Context, name string, options *ArangoSearchViewProperties) (ArangoSearchView, error)
// CreateArangoSearchAliasView creates ArangoSearch alias view with given name and options, and opens a connection to it.
// If a view with given name already exists within the database, a ConflictError is returned.
CreateArangoSearchAliasView(ctx context.Context, name string, options *ArangoSearchAliasViewProperties) (ArangoSearchViewAlias, error)
}
// ViewType is the type of view.
type ViewType string
const (
// ViewTypeArangoSearch specifies an ArangoSearch view type.
ViewTypeArangoSearch = ViewType("arangosearch")
// ViewTypeArangoSearchAlias specifies an ArangoSearch view type alias.
ViewTypeArangoSearchAlias = ViewType("search-alias")
)