- Notifications
You must be signed in to change notification settings - Fork0
Add raw query method, csv import update, create many relationships me…#16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
2 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletionsREADME.md
This file contains hidden or 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
2 changes: 1 addition & 1 deletionpyproject.toml
This file contains hidden or 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
4 changes: 4 additions & 0 deletionssrc/rushdb/__init__.py
This file contains hidden or 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
15 changes: 15 additions & 0 deletionssrc/rushdb/api/__init__.py
This file contains hidden or 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,15 @@ | ||
| from .labels import LabelsAPI | ||
| from .properties import PropertiesAPI | ||
| from .query import QueryAPI | ||
| from .records import RecordsAPI | ||
| from .relationships import RelationsAPI | ||
| from .transactions import TransactionsAPI | ||
| __all__ = [ | ||
| "RecordsAPI", | ||
| "PropertiesAPI", | ||
| "LabelsAPI", | ||
| "TransactionsAPI", | ||
| "QueryAPI", | ||
| "RelationsAPI", | ||
| ] |
41 changes: 41 additions & 0 deletionssrc/rushdb/api/query.py
This file contains hidden or 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,41 @@ | ||
| from typing import Any, Dict, Optional | ||
| from ..models.transaction import Transaction | ||
| from .base import BaseAPI | ||
| class QueryAPI(BaseAPI): | ||
| """API client for executing raw Cypher queries (cloud-only). | ||
| This endpoint is only available when using the RushDB managed cloud | ||
| service or when your project is connected to a custom database through | ||
| RushDB Cloud. It will not function for self-hosted or local-only deployments. | ||
| Example: | ||
| >>> from rushdb import RushDB | ||
| >>> db = RushDB("RUSHDB_API_KEY") | ||
| >>> result = db.query.raw({ | ||
| ... "query": "MATCH (n:Person) RETURN n LIMIT $limit", | ||
| ... "params": {"limit": 10} | ||
| ... }) | ||
| >>> print(result) | ||
| """ | ||
| def raw( | ||
| self, | ||
| body: Dict[str, Any], | ||
| transaction: Optional[Transaction] = None, | ||
| ) -> Dict[str, Any]: | ||
| """Execute a raw Cypher query. | ||
| Args: | ||
| body (Dict[str, Any]): Payload containing: | ||
| - query (str): Cypher query string | ||
| - params (Optional[Dict[str, Any]]): Parameter dict | ||
| transaction (Optional[Transaction]): Optional transaction context. | ||
| Returns: | ||
| Dict[str, Any]: API response including raw driver result in 'data'. | ||
| """ | ||
| headers = Transaction._build_transaction_header(transaction) | ||
| return self.client._make_request("POST", "/query/raw", body, headers) |
36 changes: 28 additions & 8 deletionssrc/rushdb/api/records.py
This file contains hidden or 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
65 changes: 65 additions & 0 deletionssrc/rushdb/api/relationships.py
This file contains hidden or 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
4 changes: 4 additions & 0 deletionssrc/rushdb/client.py
This file contains hidden or 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
2 changes: 1 addition & 1 deletionuv.lock
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.