- OrientDB 教程
- OrientDB - 首頁
- OrientDB - 概覽
- OrientDB - 安裝
- OrientDB - 基本概念
- OrientDB - 資料型別
- OrientDB - 控制檯模式
- OrientDB 資料庫命令
- OrientDB - 建立資料庫
- OrientDB - 修改資料庫
- OrientDB - 備份資料庫
- OrientDB - 恢復資料庫
- OrientDB - 連線資料庫
- OrientDB - 斷開資料庫連線
- OrientDB - 資料庫資訊
- OrientDB - 列出資料庫
- OrientDB - 凍結資料庫
- OrientDB - 釋放資料庫
- OrientDB - 配置資料庫
- OrientDB - 匯出資料庫
- OrientDB - 匯入資料庫
- OrientDB - 提交資料庫
- OrientDB - 回滾資料庫
- OrientDB - 最佳化資料庫
- OrientDB - 刪除資料庫
- OrientDB 記錄命令
- OrientDB - 插入記錄
- OrientDB - 顯示記錄
- OrientDB - 載入記錄
- OrientDB - 重新載入記錄
- OrientDB - 匯出記錄
- OrientDB - 更新記錄
- OrientDB - 清空記錄
- OrientDB - 刪除記錄
- OrientDB 類命令
- OrientDB - 建立類
- OrientDB - 修改類
- OrientDB - 清空類
- OrientDB - 刪除類
- OrientDB 叢集命令
- OrientDB - 建立叢集
- OrientDB - 修改叢集
- OrientDB - 清空叢集
- OrientDB - 刪除叢集
- OrientDB 屬性命令
- OrientDB - 建立屬性
- OrientDB - 修改屬性
- OrientDB - 刪除屬性
- OrientDB 頂點命令
- OrientDB - 建立頂點
- OrientDB - 移動頂點
- OrientDB - 刪除頂點
- OrientDB 邊命令
- OrientDB - 建立邊
- OrientDB - 更新邊
- OrientDB - 刪除邊
- OrientDB 高階概念
- OrientDB - 函式
- OrientDB - 序列
- OrientDB - 索引
- OrientDB - 事務
- OrientDB - 鉤子
- OrientDB - 快取
- OrientDB - 日誌
- OrientDB - 效能調優
- OrientDB - 升級
- OrientDB - 安全性
- OrientDB - Studio
- OrientDB 介面
- OrientDB - Java 介面
- OrientDB - Python 介面
- OrientDB 有用資源
- OrientDB - 快速指南
- OrientDB - 有用資源
- OrientDB - 討論
OrientDB - Python 介面
OrientDB 的 Python 驅動程式使用二進位制協議。PyOrient 是該 Git Hub 專案的名稱,它有助於將 OrientDB 與 Python 連線起來。它適用於 OrientDB 1.7 及更高版本。
以下命令用於安裝 PyOrient。
pip install pyorient
您可以使用名為 demo.py 的指令碼檔案執行以下任務:
建立客戶端例項意味著建立連線。
建立名為 DB_Demo 的資料庫。
開啟名為 DB_Demo 的資料庫。
建立名為 my_class 的類。
建立 id 和 name 屬性。
將記錄插入 my_class 類中。
//create connection
client = pyorient.OrientDB("localhost", 2424)
session_id = client.connect( "admin", "admin" )
//create a databse
client.db_create( db_name, pyorient.DB_TYPE_GRAPH, pyorient.STORAGE_TYPE_MEMORY )
//open databse
client.db_open( DB_Demo, "admin", "admin" )
//create class
cluster_id = client.command( "create class my_class extends V" )
//create property
cluster_id = client.command( "create property my_class.id Integer" )
cluster_id = client.command( "create property my_class.name String" )
//insert record
client.command("insert into my_class ( 'id','’name' ) values( 1201, 'satish')")
使用以下命令執行上述指令碼。
$ python demo.py
廣告