Class: Arango::Database
- Inherits:
-
Object
- Object
- Arango::Database
- Includes:
- Helper_Error, Helper_Return, Server_Return
- Defined in:
- lib/Database.rb
Instance Attribute Summary collapse
-
#cache_name ⇒ Object
readonly
DEFINE ===.
-
#id ⇒ Object
readonly
DEFINE ===.
-
#isSystem ⇒ Object
readonly
DEFINE ===.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
readonly
DEFINE ===.
-
#server ⇒ Object
readonly
DEFINE ===.
Class Method Summary collapse
Instance Method Summary collapse
-
#[](name) ⇒ Object
COLLECTION ==.
- #addUserAccess(grant:, user:) ⇒ Object
-
#aql(query:, count: nil, batchSize: nil, cache: nil, memoryLimit: nil, ttl: nil, bindVars: nil, failOnWarning: nil, profile: nil, maxTransactionSize: nil, skipInaccessibleCollections: nil, maxWarningCount: nil, intermediateCommitCount: nil, satelliteSyncWait: nil, fullCount: nil, intermediateCommitSize: nil, optimizer_rules: nil, maxPlans: nil) ⇒ Object
AQL ===.
-
#aqlFunctions(namespace: nil) ⇒ Object
AQL FUNCTION ===.
-
#assign_attributes(result) ⇒ Object
GET ===.
- #changePropertyQueryCache(mode:, maxResults: nil) ⇒ Object
- #changeQueryProperties(slowQueryThreshold: nil, enabled: nil, maxSlowQueries: nil, trackSlowQueries: nil, maxQueryStringLength: nil, trackBindVars: nil) ⇒ Object
-
#clearQueryCache ⇒ Object
QUERY CACHE ===.
- #clusterInventory(includeSystem: nil) ⇒ Object
- #collection(name:, body: {}, type: :document) ⇒ Object
- #collections(excludeSystem: true) ⇒ Object
-
#create(name: @name, users: nil) ⇒ Object
POST ===.
- #createAqlFunction(code:, name:, isDeterministic: nil) ⇒ Object
- #currentQuery ⇒ Object
- #deleteAqlFunction(name:) ⇒ Object
-
#destroy ⇒ Object
DELETE ==.
-
#foxx(body: {}, mount:, development: nil, legacy: nil, provides: nil, name: nil, version: nil, type: "application/json", setup: nil, teardown: nil) ⇒ Object
FOXX ===.
- #foxxes ⇒ Object
- #graph(name:, edgeDefinitions: [], orphanCollections: [], body: {}) ⇒ Object
-
#graphs ⇒ Object
GRAPH ==.
-
#initialize(name:, server:, cache_name: nil) ⇒ Database
constructor
A new instance of Database.
-
#inventory(includeSystem: nil, global: nil, batchId:) ⇒ Object
REPLICATION ===.
- #lastTick ⇒ Object
- #logger ⇒ Object
- #loggerFirstTick ⇒ Object
- #loggerFollow(from: nil, to: nil, chunkSize: nil, includeSystem: nil) ⇒ Object
- #loggerRangeTick ⇒ Object
- #propertyQueryCache ⇒ Object
-
#queryProperties ⇒ Object
QUERY ==.
- #range ⇒ Object
- #replication(master:, includeSystem: true, initialSyncMaxWaitTime: nil, incremental: nil, restrictCollections: nil, connectTimeout: nil, autoResync: nil, idleMinWaitTime: nil, requestTimeout: nil, requireFromPresent: nil, idleMaxWaitTime: nil, restrictType: nil, maxConnectRetries: nil, adaptivePolling: nil, connectionRetryWaitTime: nil, autoResyncRetries: nil, chunkSize: nil, verbose: nil) ⇒ Object
- #replication_as_master(slave:, includeSystem: true, initialSyncMaxWaitTime: nil, incremental: nil, restrictCollections: nil, connectTimeout: nil, autoResync: nil, idleMinWaitTime: nil, requestTimeout: nil, requireFromPresent: nil, idleMaxWaitTime: nil, restrictType: nil, maxConnectRetries: nil, adaptivePolling: nil, connectionRetryWaitTime: nil, autoResyncRetries: nil, chunkSize: nil, verbose: nil) ⇒ Object
-
#request(action, url, body: {}, headers: {}, query: {}, key: nil, return_direct_result: false, skip_to_json: false, keepNull: false) ⇒ Object
REQUEST ===.
- #retrieve ⇒ Object (also: #current)
- #retrieveQueryCache ⇒ Object
- #revokeUserAccess(user:) ⇒ Object
- #serverId ⇒ Object
- #slowQueries ⇒ Object
- #stopSlowQueries ⇒ Object
- #tail(from: nil, to: nil, global: nil, chunkSize: nil, serverID: nil, barrierID: nil) ⇒ Object
-
#task(id: nil, name: nil, type: nil, period: nil, command: nil, params: nil, created: nil, body: {}) ⇒ Object
TASK ===.
- #tasks ⇒ Object
-
#to_h ⇒ Object
TO HASH ===.
-
#transaction(action:, write: [], read: [], params: nil, maxTransactionSize: nil, lockTimeout: nil, waitForSync: nil, intermediateCommitCount: nil, intermedateCommitSize: nil) ⇒ Object
TRANSACTION ===.
- #userAccess(user:) ⇒ Object
- #view(name:) ⇒ Object
-
#views ⇒ Object
VIEW ===.
Methods included from Server_Return
Methods included from Helper_Return
#return_delete, #return_directly?, #return_element
Methods included from Helper_Error
#satisfy_category?, #satisfy_class?, #warning_deprecated
Constructor Details
#initialize(name:, server:, cache_name: nil) ⇒ Database
Returns a new instance of Database.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/Database.rb', line 26 def initialize(name:, server:, cache_name: nil) assign_server(server) unless cache_name.nil? @cache_name = cache_name @server.cache.save(:database, cache_name, self) end @name = name @server = server @isSystem = nil @path = nil @id = nil end |
Instance Attribute Details
#cache_name ⇒ Object (readonly)
DEFINE ===
41 42 43 |
# File 'lib/Database.rb', line 41 def cache_name @cache_name end |
#id ⇒ Object (readonly)
DEFINE ===
41 42 43 |
# File 'lib/Database.rb', line 41 def id @id end |
#isSystem ⇒ Object (readonly)
DEFINE ===
41 42 43 |
# File 'lib/Database.rb', line 41 def isSystem @isSystem end |
#name ⇒ Object
Returns the value of attribute name.
42 43 44 |
# File 'lib/Database.rb', line 42 def name @name end |
#path ⇒ Object (readonly)
DEFINE ===
41 42 43 |
# File 'lib/Database.rb', line 41 def path @path end |
#server ⇒ Object (readonly)
DEFINE ===
41 42 43 |
# File 'lib/Database.rb', line 41 def server @server end |
Class Method Details
.new(*args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/Database.rb', line 9 def self.new(*args) hash = args[0] super unless hash.is_a?(Hash) server = hash[:server] if server.is_a?(Arango::Server) && server.active_cache cache_name = hash[:name] cached = server.cache.cache.dig(:database, cache_name) if cached.nil? hash[:cache_name] = cache_name return super else return cached end end super end |
Instance Method Details
#[](name) ⇒ Object
COLLECTION ==
109 110 111 |
# File 'lib/Database.rb', line 109 def [](name) Arango::Collection.new(name: name, database: self) end |
#addUserAccess(grant:, user:) ⇒ Object
360 361 362 363 |
# File 'lib/Database.rb', line 360 def addUserAccess(grant:, user:) user = check_user(user) user.addDatabaseAccess(grant: grant, database: @name) end |
#aql(query:, count: nil, batchSize: nil, cache: nil, memoryLimit: nil, ttl: nil, bindVars: nil, failOnWarning: nil, profile: nil, maxTransactionSize: nil, skipInaccessibleCollections: nil, maxWarningCount: nil, intermediateCommitCount: nil, satelliteSyncWait: nil, fullCount: nil, intermediateCommitSize: nil, optimizer_rules: nil, maxPlans: nil) ⇒ Object
AQL ===
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/Database.rb', line 198 def aql(query:, count: nil, batchSize: nil, cache: nil, memoryLimit: nil, ttl: nil, bindVars: nil, failOnWarning: nil, profile: nil, maxTransactionSize: nil, skipInaccessibleCollections: nil, maxWarningCount: nil, intermediateCommitCount: nil, satelliteSyncWait: nil, fullCount: nil, intermediateCommitSize: nil, optimizer_rules: nil, maxPlans: nil) Arango::AQL.new(query: query, database: self, count: count, batchSize: batchSize, cache: cache, memoryLimit: memoryLimit, ttl: ttl, bindVars: bindVars, failOnWarning: failOnWarning, profile: profile, maxTransactionSize: maxTransactionSize, skipInaccessibleCollections: skipInaccessibleCollections, maxWarningCount: maxWarningCount, intermediateCommitCount: intermediateCommitCount, satelliteSyncWait: satelliteSyncWait, fullCount: fullCount, intermediateCommitSize: intermediateCommitSize, optimizer_rules: optimizer_rules, maxPlans: maxPlans) end |
#aqlFunctions(namespace: nil) ⇒ Object
AQL FUNCTION ===
218 219 220 |
# File 'lib/Database.rb', line 218 def aqlFunctions(namespace: nil) request("GET", "_api/aqlfunction", query: {"namespace": namespace}, key: :result) end |
#assign_attributes(result) ⇒ Object
GET ===
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/Database.rb', line 71 def assign_attributes(result) return unless result.is_a?(Hash) @name = result[:name] @isSystem = result[:isSystem] @path = result[:path] @id = result[:id] if @server.active_cache && @cache_name.nil? @cache_name = result[:name] @server.cache.save(:database, @cache_name, self) end end |
#changePropertyQueryCache(mode:, maxResults: nil) ⇒ Object
190 191 192 193 194 |
# File 'lib/Database.rb', line 190 def changePropertyQueryCache(mode:, maxResults: nil) satisfy_category?(mode, ["off", "on", "demand"]) body = { "mode": mode, "maxResults": maxResults } database.request("PUT", "_api/query-cache/properties", body: body) end |
#changeQueryProperties(slowQueryThreshold: nil, enabled: nil, maxSlowQueries: nil, trackSlowQueries: nil, maxQueryStringLength: nil, trackBindVars: nil) ⇒ Object
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/Database.rb', line 149 def changeQueryProperties(slowQueryThreshold: nil, enabled: nil, maxSlowQueries: nil, trackSlowQueries: nil, maxQueryStringLength: nil, trackBindVars: nil) body = { "slowQueryThreshold": slowQueryThreshold, "enabled": enabled, "maxSlowQueries": maxSlowQueries, "trackSlowQueries": trackSlowQueries, "maxQueryStringLength": maxQueryStringLength, "trackBindVars": trackBindVars } request("PUT", "_api/query/properties", body: body) end |
#clearQueryCache ⇒ Object
QUERY CACHE ===
177 178 179 180 |
# File 'lib/Database.rb', line 177 def clearQueryCache result = request("DELETE", "_api/query-cache") return return_delete(result) end |
#clusterInventory(includeSystem: nil) ⇒ Object
243 244 245 246 |
# File 'lib/Database.rb', line 243 def clusterInventory(includeSystem: nil) query = { "includeSystem": includeSystem } request("GET", "_api/replication/clusterInventory", query: query) end |
#collection(name:, body: {}, type: :document) ⇒ Object
113 114 115 |
# File 'lib/Database.rb', line 113 def collection(name:, body: {}, type: :document) Arango::Collection.new(name: name, database: self, body: body, type: type) end |
#collections(excludeSystem: true) ⇒ Object
117 118 119 120 121 122 123 124 |
# File 'lib/Database.rb', line 117 def collections(excludeSystem: true) query = { "excludeSystem": excludeSystem } result = request("GET", "_api/collection", query: query) return result if return_directly?(result) result[:result].map do |x| Arango::Collection.new(database: self, name: x[:name], body: x ) end end |
#create(name: @name, users: nil) ⇒ Object
POST ===
92 93 94 95 96 97 98 99 |
# File 'lib/Database.rb', line 92 def create(name: @name, users: nil) body = { "name": name, "users": users } result = @server.request("POST", "_api/database", body: body, key: :result) return return_directly?(result) ? result : self end |
#createAqlFunction(code:, name:, isDeterministic: nil) ⇒ Object
222 223 224 225 |
# File 'lib/Database.rb', line 222 def createAqlFunction(code:, name:, isDeterministic: nil) body = { "code": code, "name": name, "isDeterministic": isDeterministic } request("POST", "_api/aqlfunction", body: body) end |
#currentQuery ⇒ Object
162 163 164 |
# File 'lib/Database.rb', line 162 def currentQuery request("GET", "_api/query/current") end |
#deleteAqlFunction(name:) ⇒ Object
227 228 229 230 |
# File 'lib/Database.rb', line 227 def deleteAqlFunction(name:) result = request("DELETE", "_api/aqlfunction/#{name}") return return_delete(result) end |
#destroy ⇒ Object
DELETE ==
103 104 105 |
# File 'lib/Database.rb', line 103 def destroy @server.request("DELETE", "_api/database/#{@name}", key: :result) end |
#foxx(body: {}, mount:, development: nil, legacy: nil, provides: nil, name: nil, version: nil, type: "application/json", setup: nil, teardown: nil) ⇒ Object
FOXX ===
335 336 337 338 339 340 341 342 |
# File 'lib/Database.rb', line 335 def foxx(body: {}, mount:, development: nil, legacy: nil, provides: nil, name: nil, version: nil, type: "application/json", setup: nil, teardown: nil) Arango::Foxx.new(database: self, body: body, mount: mount, development: development, legacy: legacy, provides: provides, name: name, version: version, type: type, setup: setup, teardown: teardown) end |
#foxxes ⇒ Object
344 345 346 347 348 349 350 |
# File 'lib/Database.rb', line 344 def foxxes result = request("GET", "_api/foxx") return result if return_directly?(result) result.map do |fox| Arango::Foxx.new(database: self, mount: fox[:mount], body: fox) end end |
#graph(name:, edgeDefinitions: [], orphanCollections: [], body: {}) ⇒ Object
136 137 138 139 140 141 |
# File 'lib/Database.rb', line 136 def graph(name:, edgeDefinitions: [], orphanCollections: [], body: {}) Arango::Graph.new(name: name, database: self, edgeDefinitions: edgeDefinitions, orphanCollections: orphanCollections, body: body) end |
#graphs ⇒ Object
GRAPH ==
128 129 130 131 132 133 134 |
# File 'lib/Database.rb', line 128 def graphs result = request("GET", "_api/gharial") return result if return_directly?(result) result[:graphs].map do |graph| Arango::Graph.new(database: self, name: graph[:_key], body: graph) end end |
#inventory(includeSystem: nil, global: nil, batchId:) ⇒ Object
REPLICATION ===
234 235 236 237 238 239 240 241 |
# File 'lib/Database.rb', line 234 def inventory(includeSystem: nil, global: nil, batchId:) query = { "includeSystem": includeSystem, "global": global, "batchId": batchId } request("GET", "_api/replication/inventory", query: query) end |
#lastTick ⇒ Object
278 279 280 |
# File 'lib/Database.rb', line 278 def lastTick request("GET", "_api/wal/lastTick") end |
#logger ⇒ Object
248 249 250 |
# File 'lib/Database.rb', line 248 def logger request("GET", "_api/replication/logger-state") end |
#loggerFirstTick ⇒ Object
262 263 264 |
# File 'lib/Database.rb', line 262 def loggerFirstTick request("GET", "_api/replication/logger-first-tick", key: :firstTick) end |
#loggerFollow(from: nil, to: nil, chunkSize: nil, includeSystem: nil) ⇒ Object
252 253 254 255 256 257 258 259 260 |
# File 'lib/Database.rb', line 252 def loggerFollow(from: nil, to: nil, chunkSize: nil, includeSystem: nil) query = { "from": from, "to": to, "chunkSize": chunkSize, "includeSystem": includeSystem } request("GET", "_api/replication/logger-follow", query: query) end |
#loggerRangeTick ⇒ Object
266 267 268 |
# File 'lib/Database.rb', line 266 def loggerRangeTick request("GET", "_api/replication/logger-tick-ranges") end |
#propertyQueryCache ⇒ Object
186 187 188 |
# File 'lib/Database.rb', line 186 def propertyQueryCache request("GET", "_api/query-cache/properties") end |
#queryProperties ⇒ Object
QUERY ==
145 146 147 |
# File 'lib/Database.rb', line 145 def queryProperties request("GET", "_api/query/properties") end |
#range ⇒ Object
274 275 276 |
# File 'lib/Database.rb', line 274 def range request("GET", "_api/wal/range") end |
#replication(master:, includeSystem: true, initialSyncMaxWaitTime: nil, incremental: nil, restrictCollections: nil, connectTimeout: nil, autoResync: nil, idleMinWaitTime: nil, requestTimeout: nil, requireFromPresent: nil, idleMaxWaitTime: nil, restrictType: nil, maxConnectRetries: nil, adaptivePolling: nil, connectionRetryWaitTime: nil, autoResyncRetries: nil, chunkSize: nil, verbose: nil) ⇒ Object
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/Database.rb', line 295 def replication(master:, includeSystem: true, initialSyncMaxWaitTime: nil, incremental: nil, restrictCollections: nil, connectTimeout: nil, autoResync: nil, idleMinWaitTime: nil, requestTimeout: nil, requireFromPresent: nil, idleMaxWaitTime: nil, restrictType: nil, maxConnectRetries: nil, adaptivePolling: nil, connectionRetryWaitTime: nil, autoResyncRetries: nil, chunkSize: nil, verbose: nil) Arango::Replication.new(slave: self, master: master, includeSystem: includeSystem, initialSyncMaxWaitTime: initialSyncMaxWaitTime, incremental: incremental, restrictCollections: restrictCollections, connectTimeout: connectTimeout, autoResync: autoResync, idleMinWaitTime: idleMinWaitTime, requestTimeout: requestTimeout, requireFromPresent: requireFromPresent, idleMaxWaitTime: idleMaxWaitTime, restrictType: restrictType, maxConnectRetries: maxConnectRetries, adaptivePolling: adaptivePolling, connectionRetryWaitTime: connectionRetryWaitTime, autoResyncRetries: autoResyncRetries, chunkSize: chunkSize, verbose: verbose) end |
#replication_as_master(slave:, includeSystem: true, initialSyncMaxWaitTime: nil, incremental: nil, restrictCollections: nil, connectTimeout: nil, autoResync: nil, idleMinWaitTime: nil, requestTimeout: nil, requireFromPresent: nil, idleMaxWaitTime: nil, restrictType: nil, maxConnectRetries: nil, adaptivePolling: nil, connectionRetryWaitTime: nil, autoResyncRetries: nil, chunkSize: nil, verbose: nil) ⇒ Object
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/Database.rb', line 314 def replication_as_master(slave:, includeSystem: true, initialSyncMaxWaitTime: nil, incremental: nil, restrictCollections: nil, connectTimeout: nil, autoResync: nil, idleMinWaitTime: nil, requestTimeout: nil, requireFromPresent: nil, idleMaxWaitTime: nil, restrictType: nil, maxConnectRetries: nil, adaptivePolling: nil, connectionRetryWaitTime: nil, autoResyncRetries: nil, chunkSize: nil, verbose: nil) Arango::Replication.new(master: self, slave: slave, includeSystem: includeSystem, initialSyncMaxWaitTime: initialSyncMaxWaitTime, incremental: incremental, restrictCollections: restrictCollections, connectTimeout: connectTimeout, autoResync: autoResync, idleMinWaitTime: idleMinWaitTime, requestTimeout: requestTimeout, requireFromPresent: requireFromPresent, idleMaxWaitTime: idleMaxWaitTime, restrictType: restrictType, maxConnectRetries: maxConnectRetries, adaptivePolling: adaptivePolling, connectionRetryWaitTime: connectionRetryWaitTime, autoResyncRetries: autoResyncRetries, chunkSize: chunkSize, verbose: verbose) end |
#request(action, url, body: {}, headers: {}, query: {}, key: nil, return_direct_result: false, skip_to_json: false, keepNull: false) ⇒ Object
REQUEST ===
59 60 61 62 63 64 65 66 67 |
# File 'lib/Database.rb', line 59 def request(action, url, body: {}, headers: {}, query: {}, key: nil, return_direct_result: false, skip_to_json: false, keepNull: false) url = "_db/#{@name}/#{url}" @server.request(action, url, body: body, headers: headers, query: query, key: key, return_direct_result: return_direct_result, skip_to_json: skip_to_json, keepNull: keepNull) end |
#retrieve ⇒ Object Also known as: current
83 84 85 86 87 |
# File 'lib/Database.rb', line 83 def retrieve result = request("GET", "_api/database/current", key: :result) assign_attributes(result) return return_directly?(result) ? result : self end |
#retrieveQueryCache ⇒ Object
182 183 184 |
# File 'lib/Database.rb', line 182 def retrieveQueryCache request("GET", "_api/query-cache/entries") end |
#revokeUserAccess(user:) ⇒ Object
365 366 367 368 |
# File 'lib/Database.rb', line 365 def revokeUserAccess(user:) user = check_user(user) user.revokeDatabaseAccess(database: @name) end |
#serverId ⇒ Object
270 271 272 |
# File 'lib/Database.rb', line 270 def serverId request("GET", "_api/replication/server-id", key: :serverId) end |
#slowQueries ⇒ Object
166 167 168 |
# File 'lib/Database.rb', line 166 def slowQueries request("GET", "_api/query/slow") end |
#stopSlowQueries ⇒ Object
170 171 172 173 |
# File 'lib/Database.rb', line 170 def stopSlowQueries result = request("DELETE", "_api/query/slow") return return_delete(result) end |
#tail(from: nil, to: nil, global: nil, chunkSize: nil, serverID: nil, barrierID: nil) ⇒ Object
282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/Database.rb', line 282 def tail(from: nil, to: nil, global: nil, chunkSize: nil, serverID: nil, barrierID: nil) query = { from: from, to: to, global: global, chunkSize: chunkSize, serverID: serverID, barrierID: } request("GET", "_api/wal/tail", query: query) end |
#task(id: nil, name: nil, type: nil, period: nil, command: nil, params: nil, created: nil, body: {}) ⇒ Object
TASK ===
391 392 393 394 |
# File 'lib/Database.rb', line 391 def task(id: nil, name: nil, type: nil, period: nil, command: nil, params: nil, created: nil, body: {}) Arango::Task.new(id: id, name: name, type: type, period: period, command: command, params: params, created: created, body: body, database: self) end |
#tasks ⇒ Object
396 397 398 399 400 401 402 403 |
# File 'lib/Database.rb', line 396 def tasks result = request("GET", "_api/tasks") return result if return_directly?(result) result.delete_if{|k| k[:database] != @name} result.map do |task| Arango::Task.new(body: task, database: self) end end |
#to_h ⇒ Object
TO HASH ===
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/Database.rb', line 46 def to_h { "name": @name, "isSystem": @isSystem, "path": @path, "id": @id, "cache_name": @cache_name, "server": @server.base_uri }.delete_if{|k,v| v.nil?} end |
#transaction(action:, write: [], read: [], params: nil, maxTransactionSize: nil, lockTimeout: nil, waitForSync: nil, intermediateCommitCount: nil, intermedateCommitSize: nil) ⇒ Object
TRANSACTION ===
407 408 409 410 411 412 413 414 415 |
# File 'lib/Database.rb', line 407 def transaction(action:, write: [], read: [], params: nil, maxTransactionSize: nil, lockTimeout: nil, waitForSync: nil, intermediateCommitCount: nil, intermedateCommitSize: nil) Arango::Transaction.new(database: self, action: action, write: write, read: read, params: params, maxTransactionSize: maxTransactionSize, lockTimeout: lockTimeout, waitForSync: waitForSync, intermediateCommitCount: intermediateCommitCount, intermedateCommitSize: intermedateCommitSize) end |
#userAccess(user:) ⇒ Object
370 371 372 373 |
# File 'lib/Database.rb', line 370 def userAccess(user:) user = check_user(user) user.databaseAccess(database: @name) end |
#view(name:) ⇒ Object
385 386 387 |
# File 'lib/Database.rb', line 385 def view(name:) Arango::View.new(database: self, name: name) end |
#views ⇒ Object
VIEW ===
377 378 379 380 381 382 383 |
# File 'lib/Database.rb', line 377 def views result = request("GET", "_api/view", key: :result) return result if return_directly?(result) result.map do |view| Arango::View.new(database: self, id: view[:id], name: view[:name], type: view[:type]) end end |