Skip to content

Commit fca1b6f

Browse files
committed
remove namespace references where they are no longer applicable
1 parent 1ce3fe0 commit fca1b6f

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ sch := `
143143
email: string @index(exact) @unique .
144144
age: int .
145145
`
146-
err := client.SetSchema(context.TODO(), dgo.RootNamespace, sch)
146+
err := client.SetSchema(context.TODO(), sch)
147147
// Handle error
148148
```
149149

@@ -159,7 +159,7 @@ mutationDQL := `{
159159
_:alice <age> "29" .
160160
}
161161
}`
162-
resp, err := client.RunDQL(context.TODO(), dgo.RootNamespace, mutationDQL)
162+
resp, err := client.RunDQL(context.TODO(), mutationDQL)
163163
// Handle error
164164
// Print map of blank UIDs
165165
fmt.Printf("%+v\n", resp.Uids)
@@ -177,7 +177,7 @@ queryDQL := `{
177177
age
178178
}
179179
}`
180-
resp, err := client.RunDQL(context.TODO(), dgo.RootNamespace, queryDQL)
180+
resp, err := client.RunDQL(context.TODO(), queryDQL)
181181
// Handle error
182182
fmt.Printf("%s\n", resp.Json)
183183
```
@@ -195,7 +195,7 @@ queryDQL = `query Alice($name: string) {
195195
}
196196
}`
197197
vars := map[string]string{"$name": "Alice"}
198-
resp, err := client.RunDQLWithVars(context.TODO(), dgo.RootNamespace, queryDQL, vars)
198+
resp, err := client.RunDQLWithVars(context.TODO(), queryDQL, vars)
199199
// Handle error
200200
fmt.Printf("%s\n", resp.Json)
201201
```
@@ -212,7 +212,7 @@ queryDQL := `{
212212
age
213213
}
214214
}`
215-
resp, err := client.RunDQL(context.TODO(), dgo.RootNamespace, queryDQL, dgo.WithBestEffort())
215+
resp, err := client.RunDQL(context.TODO(), queryDQL, dgo.WithBestEffort())
216216
// Handle error
217217
fmt.Printf("%s\n", resp.Json)
218218
```
@@ -229,7 +229,7 @@ queryDQL := `{
229229
age
230230
}
231231
}`
232-
resp, err := client.RunDQL(context.TODO(), dgo.RootNamespace, queryDQL, dgo.WithReadOnly())
232+
resp, err := client.RunDQL(context.TODO(), queryDQL, dgo.WithReadOnly())
233233
// Handle error
234234
fmt.Printf("%s\n", resp.Json)
235235
```
@@ -246,7 +246,7 @@ queryDQL := `{
246246
age
247247
}
248248
}`
249-
resp, err = client.RunDQL(context.TODO(), dgo.RootNamespace, queryDQL, dgo.WithResponseFormat(api_v2.RespFormat_RDF))
249+
resp, err = client.RunDQL(context.TODO(), queryDQL, dgo.WithResponseFormat(api_v2.RespFormat_RDF))
250250
// Handle error
251251
fmt.Printf("%s\n", resp.Rdf)
252252
```
@@ -267,7 +267,7 @@ upsertQuery := `upsert {
267267
}
268268
}
269269
}`
270-
resp, err := client.RunDQL(context.TODO(), dgo.RootNamespace, upsertQuery)
270+
resp, err := client.RunDQL(context.TODO(), upsertQuery)
271271
// Handle error
272272
fmt.Printf("%s\n", resp.Json)
273273
fmt.Printf("%+v\n", resp.Uids)
@@ -287,7 +287,7 @@ upsertQuery := `upsert {
287287
}
288288
}
289289
}`
290-
resp, err := client.RunDQL(context.TODO(), dgo.RootNamespace, upsertQuery)
290+
resp, err := client.RunDQL(context.TODO(), upsertQuery)
291291
// Handle error
292292
fmt.Printf("%s\n", resp.Json)
293293
```
@@ -306,7 +306,7 @@ _, err := client.CreateNamespace(context.TODO())
306306
To drop a namespace:
307307

308308
```go
309-
_, err := client.DropNamespace(context.TODO())
309+
err := client.DropNamespace(context.TODO())
310310
// Handle error
311311
```
312312

@@ -514,7 +514,7 @@ fmt.Printf("%s\n", resp.Json)
514514

515515
### Query with RDF response
516516

517-
You can get query result as a RDF response by calling `txn.QueryRDF`. The response would contain a
517+
You can get query result as an RDF response by calling `txn.QueryRDF`. The response would contain a
518518
`Rdf` field, which has the RDF encoded result.
519519

520520
**Note:** If you are querying only for `uid` values, use a JSON format response.

open.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func WithSkipTLSVerify() ClientOption {
8282
}
8383
}
8484

85-
// WithSystemCertPool will use the system cert pool and setup a TLS connection with Dgraph cluster.
85+
// WithSystemCertPool will use the system cert pool and set up a TLS connection with Dgraph cluster.
8686
func WithSystemCertPool() ClientOption {
8787
return func(o *clientOptions) error {
8888
pool, err := x509.SystemCertPool()
@@ -105,7 +105,6 @@ func WithNamespace(nsID uint64) ClientOption {
105105
}
106106

107107
// WithACLCreds will use the provided username and password for ACL authentication.
108-
// If namespace is not provided, it logs into the galaxy namespace.
109108
func WithACLCreds(username, password string) ClientOption {
110109
return func(o *clientOptions) error {
111110
o.username = username
@@ -220,15 +219,15 @@ func Open(connStr string) (*Dgraph, error) {
220219
}
221220

222221
// NewClient creates a new Dgraph client for a single endpoint.
223-
// If ACL connection options are present, an login attempt is made
222+
// If ACL connection options are present, a login attempt is made
224223
// using the supplied credentials.
225224
func NewClient(endpoint string, opts ...ClientOption) (*Dgraph, error) {
226225
return NewRoundRobinClient([]string{endpoint}, opts...)
227226
}
228227

229228
// NewRoundRobinClient creates a new Dgraph client for a list
230229
// of endpoints. It will round robin among the provided endpoints.
231-
// If ACL connection options are present, an login attempt is made
230+
// If ACL connection options are present, a login attempt is made
232231
// using the supplied credentials.
233232
func NewRoundRobinClient(endpoints []string, opts ...ClientOption) (*Dgraph, error) {
234233
co := &clientOptions{}

0 commit comments

Comments
 (0)