List Schema
from ultipa import Connection
from ultipa import UltipaConfig,ULTIPA_REQUEST
defaultConfig = UltipaConfig()
conn = Connection.GetConnection(hosts=["host:port"],username="root",
password="root",defaultConfig=defaultConfig)
ret = conn.listSchema(ULTIPA_REQUEST.ShowSchema(),ULTIPA_REQUEST.RequestConfig(graphName="default"))
print(ret.toJSON())
Create Schema
from ultipa import Connection
from ultipa import UltipaConfig,ULTIPA_REQUEST,ULTIPA
defaultConfig = UltipaConfig()
conn = Connection.GetConnection(hosts=["host:port"],username="root",
password="root",defaultConfig=defaultConfig)
ret = conn.createSchema(ULTIPA_REQUEST.CreateSchema('test',ULTIPA.DBType.DBNODE))
print(ret.toJSON())
Alter Schema
from ultipa import Connection
from ultipa import UltipaConfig,ULTIPA_REQUEST,ULTIPA
defaultConfig = UltipaConfig()
conn = Connection.GetConnection(hosts=["host:port"],username="root",
password="root",defaultConfig=defaultConfig)
ret = conn.alterSchema(ULTIPA_REQUEST.AlterSchema(schema='test',type=ULTIPA.DBType.DBNODE,newDescription="test",newName='test1'))
print(ret.toJSON())
Drop Schema
from ultipa import Connection
from ultipa import UltipaConfig,ULTIPA_REQUEST,ULTIPA
defaultConfig = UltipaConfig()
conn = Connection.GetConnection(hosts=["host:port"],username="root",
password="root",defaultConfig=defaultConfig)
ret = conn.dropSchema(ULTIPA_REQUEST.DropSchema(schema='test',type=ULTIPA.DBType.DBNODE))
print(ret.toJSON())