You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SPACE_NAME = "nba"
CREATE_SPACE = "CREATE SPACE IF NOT EXISTS nba(partition_num = 5)" # replica_factor not working because single system
session.execute(CREATE_SPACE)
result = session.execute('SHOW TAGS')
print(result)
#CREATE PLAYER TAG
PLAYER_SCHEMA = "name string NOT NULL, age int"
CREATE_PLAYER = "CREATE TAG player({})".format(PLAYER_SCHEMA)
session.execute(CREATE_PLAYER)
CREATE TEAM TAG
TEAM_SCHEMA = "name string"
CREATE_TEAM = "CREATE TAG team({})".format(TEAM_SCHEMA)
session.execute(CREATE_TEAM)
DESCRIBE TAGS GIVES DETAILS OF TAG
result = session.execute('DESCRIBE TAG player')
print(result)
CREATE TAG WITHOUT A PROPERTY
session.execute('CREATE TAG property_free()') # Without using () at the end was not creating this TAG
SHOW TAGS
session.execute("SHOW TAGS")
#DELETE A TAG
DELETE_TAG = "DROP SPACE nba"
session.execute(DELETE_TAG)
Here is my code `from nebula2.gclient.net import ConnectionPool
from nebula2.Config import Config
define a config
config = Config()
config.max_connection_pool_size = 10
init connection pool
connection_pool = ConnectionPool()
ok = connection_pool.init([('localhost', 9669)], config)
session = connection_pool.get_session('root', 'nebula')
SHOW SPACES
session.execute("SHOW SPACES")
CREATE SPACE
SPACE_NAME = "nba"
CREATE_SPACE = "CREATE SPACE IF NOT EXISTS nba(partition_num = 5)" # replica_factor not working because single system
session.execute(CREATE_SPACE)
SELECT SPACE
SELECT_SPACE = "USE {}".format(SPACE_NAME)
session.execute(SELECT_SPACE)
DESCRIBE SPACE
session.execute("DESCRIBE SPACE nba")
SHOW TAGS, SPACES
result = session.execute('SHOW TAGS')
print(result)
#CREATE PLAYER TAG
PLAYER_SCHEMA = "name string NOT NULL, age int"
CREATE_PLAYER = "CREATE TAG player({})".format(PLAYER_SCHEMA)
session.execute(CREATE_PLAYER)
CREATE TEAM TAG
TEAM_SCHEMA = "name string"
CREATE_TEAM = "CREATE TAG team({})".format(TEAM_SCHEMA)
session.execute(CREATE_TEAM)
DESCRIBE TAGS GIVES DETAILS OF TAG
result = session.execute('DESCRIBE TAG player')
print(result)
CREATE TAG WITHOUT A PROPERTY
session.execute('CREATE TAG property_free()') # Without using () at the end was not creating this TAG
SHOW TAGS
session.execute("SHOW TAGS")
#DELETE A TAG
DELETE_TAG = "DROP SPACE nba"
session.execute(DELETE_TAG)
CREATE EDGE TYPE
CREATE_EDGE = "CREATE EDGE follow(degree int)"
session.execute(CREATE_EDGE)
session.execute("SHOW EDGES")
CREATE_EDGE = "CREATE EDGE serve(start_year int, end_year int)"
session.execute(CREATE_EDGE)
session.execute("SHOW EDGES")
session.execute("DESCRIBE EDGE serve")`
The output for
session.execute("SHOW EDGES")
andsession.execute("DESCRIBE EDGE serve")
is ResultSet(None)The text was updated successfully, but these errors were encountered: