Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop < T0048-GA] Update and extend code documentation #116

Merged
merged 4 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions docs/reference/gqlalchemy/connection.md

This file was deleted.

53 changes: 53 additions & 0 deletions docs/reference/gqlalchemy/disk_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ title: gqlalchemy.disk_storage
class OnDiskPropertyDatabase(ABC)
```

An abstract class for implementing on-disk storage features with specific databases.

#### save\_node\_property

```python
Expand Down Expand Up @@ -79,6 +81,15 @@ def execute_query(query: str) -> List[str]

Executes an SQL query on the on disk property database.

**Arguments**:

- `query` - A string representing an SQL query.


**Returns**:

A list of strings representing the results of the query.

#### drop\_database

```python
Expand All @@ -95,6 +106,12 @@ def save_node_property(node_id: int, property_name: str, property_value: str) ->

Saves a node property to an on disk database.

**Arguments**:

- `node_id` - An integer representing the internal id of the node.
- `property_name` - A string representing the name of the property.
- `property_value` - A string representing the value of the property.

#### load\_node\_property

```python
Expand All @@ -103,6 +120,16 @@ def load_node_property(node_id: int, property_name: str) -> Optional[str]

Loads a node property from an on disk database.

**Arguments**:

- `node_id` - An integer representing the internal id of the node.
- `property_name` - A string representing the name of the property.


**Returns**:

An optional string representing the property value.

#### delete\_node\_property

```python
Expand All @@ -111,6 +138,11 @@ def delete_node_property(node_id: int, property_name: str) -> None

Deletes a node property from an on disk database.

**Arguments**:

- `node_id` - An integer representing the internal id of the node.
- `property_name` - A string representing the name of the property.

#### save\_relationship\_property

```python
Expand All @@ -119,6 +151,12 @@ def save_relationship_property(relationship_id: int, property_name: str, propert

Saves a relationship property to an on disk database.

**Arguments**:

- `relationship_id` - An integer representing the internal id of the relationship.
- `property_name` - A string representing the name of the property.
- `property_value` - A string representing the value of the property.

#### load\_relationship\_property

```python
Expand All @@ -127,6 +165,16 @@ def load_relationship_property(relationship_id: int, property_name: str) -> Opti

Loads a relationship property from an on disk database.

**Arguments**:

- `relationship_id` - An integer representing the internal id of the relationship.
- `property_name` - A string representing the name of the property.


**Returns**:

An optional string representing the property value.

#### delete\_relationship\_property

```python
Expand All @@ -135,3 +183,8 @@ def delete_relationship_property(relationship_id: int, property_name: str) -> No

Deletes a node property from an on disk database.

**Arguments**:

- `relationship_id` - An integer representing the internal id of the relationship.
- `property_name` - A string representing the name of the property.

16 changes: 16 additions & 0 deletions docs/reference/gqlalchemy/memgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ fields from Memgraph and updates it&#x27;s fields.
Otherwise it creates a new node with the same properties.
Null properties are ignored.

#### save\_nodes

```python
def save_nodes(nodes: List[Node]) -> None
```

Saves a list of nodes to Memgraph.

#### save\_node\_with\_id

```python
Expand Down Expand Up @@ -303,6 +311,14 @@ If relationship._id is None, it creates a new relationship.
If you want to set a relationship._id instead of creating a new
relationship, use `load_relationship` first.

#### save\_relationships

```python
def save_relationships(relationships: List[Relationship]) -> None
```

Saves a list of relationships to Memgraph.

#### save\_relationship\_with\_id

```python
Expand Down
63 changes: 58 additions & 5 deletions docs/reference/gqlalchemy/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,88 @@ sidebar_label: models
title: gqlalchemy.models
---

## TriggerEventType Objects

```python
class TriggerEventType()
```

An enum representing types of trigger events.

## TriggerEventObject Objects

```python
class TriggerEventObject()
```

An enum representing types of trigger objects.

NODE -&gt; `()`
RELATIONSHIP -&gt; `--&gt;`

## TriggerExecutionPhase Objects

```python
class TriggerExecutionPhase()
```

An enum representing types of trigger objects.

Enum:
BEFORE
AFTER

## MemgraphKafkaStream Objects

```python
@dataclass(frozen=True, eq=True)
class MemgraphKafkaStream(MemgraphStream)
```

A class for creating and managing Kafka streams in Memgraph.

**Arguments**:

- `name` - A string representing the stream name.
- `topics` - A list of strings representing the stream topics.
- `transform` - A string representing the name of the transformation procedure.
- `consumer_group` - A string representing the consumer group.
- `name` - A string representing the batch interval.
- `name` - A string representing the batch size.
- `name` - A string or list of strings representing bootstrap server addresses.

#### to\_cypher

```python
def to_cypher() -> str
```

Converts Kafka stream to a cypher clause.
Converts Kafka stream to a Cypher clause.

## MemgraphPulsarStream Objects

```python
@dataclass(frozen=True, eq=True)
class MemgraphPulsarStream(MemgraphStream)
```

A class for creating and managing Pulsar streams in Memgraph.

**Arguments**:

- `name` - A string representing the stream name.
- `topics` - A list of strings representing the stream topics.
- `transform` - A string representing the name of the transformation procedure.
- `consumer_group` - A string representing the consumer group.
- `name` - A string representing the batch interval.
- `name` - A string representing the batch size.
- `name` - A string or list of strings representing bootstrap server addresses.

#### to\_cypher

```python
def to_cypher() -> str
```

Converts Pulsar stream to a cypher clause.
Converts Pulsar stream to a Cypher clause.

## MemgraphTrigger Objects

Expand All @@ -57,7 +110,7 @@ class GraphObject(BaseModel)
#### \_\_init\_subclass\_\_

```python
def __init_subclass__(cls, type=None, label=None, labels=None)
def __init_subclass__(cls, type=None, label=None, labels=None, index=None, db=None)
```

Stores the subclass by type if type is specified, or by class name
Expand Down
Loading