UltipaDocs
Try Playground
  • Introduction
  • RESTful API
    • Installation
    • Connection
      • Request Configuration
      • Querying Methods
      • UQL Execution
      • Graphset Management
      • Schema and Property Management
      • Data Insertion and Deletion
      • Query Acceleration
      • Algorithm Management
      • Downloads and Exports
      • Process and Task Management
      • Access Management
      • Others
    • Result Processing
    • Types Mapping
    • Installation
    • Connection
      • Request Configuration
      • Querying Methods
      • UQL Execution
      • Graphset Management
      • Schema and Property Management
      • Data Insertion and Deletion
      • Query Acceleration
      • Algorithm Management
      • Downloads and Exports
      • Process and Task Management
      • Access Management
      • Others
    • Result Processing
    • Types Mapping
    • Installation
    • Connection
      • Request Configuration
      • Querying Methods
      • UQL Execution
      • Graphset Management
      • Schema and Property Management
      • Data Insertion and Deletion
      • Query Acceleration
      • Algorithm Management
      • Downloads and Exports
      • Process and Task Management
      • Access Management
      • Others
    • Result Processing
    • Types Mapping
    • Installation
    • Connection
      • Request Configuration
      • Querying Methods
      • UQL Execution
      • Graphset Management
      • Schema and Property Management
      • Data Insertion and Deletion
      • Query Acceleration
      • Algorithm Management
      • Downloads and Exports
      • Process and Task Management
      • Access Management
      • Others
    • Result Processing
    • Types Mapping
    • Installation
    • Connection
      • Request Configuration
      • Querying Methods
      • UQL Execution
      • Graphset Management
      • Schema and Property Management
      • Data Insertion and Deletion
      • Query Acceleration
      • Algorithm Management
      • Downloads and Exports
      • Process and Task Management
      • Access Management
      • Others
    • Result Processing
    • Types Mapping
  1. Docs
  2. /
  3. Ultipa Drivers
  4. /
  5. Database Querying

Database Querying

Request Configuration

All querying methods support an optional request configuration parameter (RequestConfig or InsertRequestConfig) to customize the behavior of requests made to the database. This parameter allows you to specify various settings, such as graphset name, timeout, and host, to tailor your requests according to your needs.

RequestConfig

RequestConfig defines the settings needed when sending non-insert requests to the database.

Example.py
from ultipa import Connection, UltipaConfig
from ultipa.configuration.RequestConfig import RequestConfig

ultipaConfig = UltipaConfig()
# URI example: ultipaConfig.hosts = ["mqj4zouys.us-east-1.cloud.ultipa.com:60010"]
ultipaConfig.hosts = ["192.168.1.85:60061", "192.168.1.87:60061", "192.168.1.88:60061"]
ultipaConfig.username = "<username>"
ultipaConfig.password = "<password>"
ultipaConfig.defaultGraph = "default"

Conn = Connection.NewConnection(defaultConfig=ultipaConfig)

requestConfig = RequestConfig(graphName = "UltipaTeam")

schemas = Conn.showSchema(requestConfig)
for schema in schemas:
    print(schema.name, "type:", schema.DBType, "total", schema.total)

RequestConfig has the following fields:

Field
Type
Default
Description
graphNamestrName of the graph to use, or the defaultGraph configured when establishing the connection if not set.
timeoutWithSecondsint3600Timeout in seconds for the request, or the timeoutWithSeconds configured when establishing the connection if not set.
useHoststrSends the request to a designated host node, or to a random host node if not set.
useMasterboolfalseSends the request to the leader node to guarantee consistency read if set to true.
threadNumintNumber of threads.
retryRetryNumber of retries, including current (optional; defaults to 0) and max (optional; defaults to 3). Here, current represents the initial retry count, max is the maximum allowable retries.
timeZonestrTimezone, e.g., Europe/Paris, or the timeZone configured when establishing the connection if not set.
timeZoneOffsetint/strHow far the target timezone is from UTC, either in seconds (if an integer) or a 5-character string such as +0700 and -0430; or the timeZoneOffset configured when establishing the connection if not set.

InsertRequestConfig

InsertRequestConfig defines the settings needed when sending data insertion or deletion requests to the database.

Example.py
from ultipa.configuration.InsertRequestConfig import InsertRequestConfig
from ultipa import Connection, UltipaConfig, Node
from ultipa.structs import InsertType

ultipaConfig = UltipaConfig()
# URI example: ultipaConfig.hosts = ["mqj4zouys.us-east-1.cloud.ultipa.com:60010"]
ultipaConfig.hosts = ["192.168.1.85:60061", "192.168.1.87:60061", "192.168.1.88:60061"]
ultipaConfig.username = "<username>"
ultipaConfig.password = "<password>"

Conn = Connection.NewConnection(defaultConfig=ultipaConfig)

# Specifies 'test' as the target graphset and sets the insert mode to OVERWRITE
insertRequestConfig = InsertRequestConfig(
    insertType=InsertType.OVERWRITE,
    graphName="test"
)

nodes = [
    Node(schema="client", id="CLIENT00001"),
    Node(schema="card", id="CARD00004")
]
  
Conn.insertNodesBatchAuto(nodes, insertRequestConfig)

InsertRequestConfig has the following fields:

Field
Type
Default
Description
graphNamestrName of the graph to use, or the defaultGraph configured when establishing the connection if not set.
timeoutint3600Timeout in seconds for the request, or the timeout configured when establishing the connection if not set.
retryRetryNumber of retries, including current (optional; defaults to 0) and max (optional; defaults to 3). Here, current represents the initial retry count, max is the maximum allowable retries.
useHoststrSends the request to a designated host node, or to a random host node if not set.
useMasterboolFalseSends the request to the leader node to guarantee consistency read if set to true.
insertTypeInsertTypeNORMALInsert mode (NORMAL, UPSERT, OVERWRITE)
silentboolTrueWhether to keep silent after success insertion, i.e., whether to return the inserted nodes or edges.
createNodeIfNotExistboolFalseWhether to create start/end nodes of an edge if the end nodes do not exist in the graph.
timeZonestrTimezone in standard format, or the timeZone configured when establishing the connection if not set.
timeZoneOffsetint/strHow far the target timezone is from UTC, either in seconds (if an integer) or a 5-character string such as +0700 and -0430; or the timeZoneOffset configured when establishing the connection if not set.