Learn R Programming

kuzuR (version 0.2.3)

kuzu_execute: Execute a Cypher Query

Description

Submits a Cypher query to the Kuzu database for execution. This function is used for all database operations, including schema definition (DDL), data manipulation (DML), and querying (MATCH).

Usage

kuzu_execute(conn, query)

Value

A Python object representing the query result.

Arguments

conn

A Kuzu connection object, as returned by kuzu_connection().

query

A string containing the Cypher query to be executed.

Examples

Run this code
# \donttest{
conn <- kuzu_connection(":memory:")

# Create a node table
kuzu_execute(conn, "CREATE NODE TABLE User(name STRING, age INT64,
PRIMARY KEY (name))")

# Insert data
kuzu_execute(conn, "CREATE (:User {name: 'Alice', age: 25})")

# Query data
result <- kuzu_execute(conn, "MATCH (a:User) RETURN a.name, a.age")
# }

Run the code above in your browser using DataLab