-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create edge using create edge statement #143
Comments
The reason for not creating edges is that In my code I am deleting the space before creating edges. that was my mistake |
Dear @SaqlainHussainShah, |
This was referenced Oct 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: