This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from multinet-app/aql-table-creation
- Loading branch information
Showing
16 changed files
with
384 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const users = require('@arangodb/users'); | ||
|
||
if (!users.exists('readonly')) { | ||
users.save('readonly', '{{ arango_readonly_password }}'); | ||
} | ||
|
||
users.grantDatabase('readonly', '*', 'ro'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Create a table from an AQL query | ||
--- | ||
parameters: | ||
- $ref: "#/parameters/workspace" | ||
- name: table | ||
in: query | ||
description: Name of table to create | ||
required: true | ||
schema: | ||
type: string | ||
example: table4 | ||
|
||
- $ref: "#/parameters/aql" | ||
|
||
responses: | ||
200: | ||
description: The name of the table created | ||
schema: | ||
type: string | ||
|
||
400: | ||
description: Malformed AQL | ||
|
||
401: | ||
description: Insufficient permissions to perform the desired AQL query | ||
|
||
404: | ||
description: Specified workspace could not be found | ||
schema: | ||
type: string | ||
example: workspace_that_doesnt_exist | ||
|
||
tags: | ||
- table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from typing import Dict, Optional, Union | ||
from arango.connection import Connection # type: ignore | ||
from arango.executor import Executor # type: ignore | ||
from arango.cursor import Cursor | ||
|
||
class AQL: | ||
"""AQL (ArangoDB Query Language) API wrapper. | ||
:param connection: HTTP connection. | ||
:type connection: arango.connection.Connection | ||
:param executor: API executor. | ||
:type executor: arango.executor.Executor | ||
""" | ||
|
||
def __init__(self, connection: Connection, executor: Executor): ... | ||
def validate(self, query: str) -> Dict: ... | ||
def execute( | ||
self, | ||
query: str, | ||
count: bool = False, | ||
batch_size: Optional[int] = None, | ||
ttl: Optional[int] = None, | ||
bind_vars: Optional[Dict] = None, | ||
full_count: Optional[bool] = None, | ||
max_plans: Optional[int] = None, | ||
optimizer_rules: Optional[str] = None, | ||
cache: Optional[bool] = None, | ||
memory_limit: int = 0, | ||
fail_on_warning: Optional[bool] = None, | ||
profile: Optional[bool] = None, | ||
max_transaction_size: Optional[int] = None, | ||
max_warning_count: Optional[int] = None, | ||
intermediate_commit_count: Optional[int] = None, | ||
intermediate_commit_size: Optional[int] = None, | ||
satellite_sync_wait: Optional[Union[int, float]] = None, | ||
read_collections: Optional[str] = None, | ||
write_collections: Optional[str] = None, | ||
stream: Optional[bool] = None, | ||
skip_inaccessible_cols: Optional[bool] = None, | ||
) -> Cursor: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from typing import Any, Generator | ||
|
||
Cursor = Generator[Any, None, None] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
class DatabaseCreateError(Exception): ... | ||
class EdgeDefinitionCreateError(Exception): ... | ||
class AQLQueryValidateError(Exception): ... | ||
class AQLQueryExecuteError(Exception): ... |
Oops, something went wrong.