Make queries into a single line
This commit is contained in:
parent
24ae6069f0
commit
50327254e0
@ -92,9 +92,9 @@ def main():
|
|||||||
for index in range(0, number_of_files):
|
for index in range(0, number_of_files):
|
||||||
if index != 0:
|
if index != 0:
|
||||||
f.write(",")
|
f.write(",")
|
||||||
f.write(f'\n {{uuid: {uuid}, platformId: "platform_id", name: "name_file_{uuid}"}}')
|
f.write(f' {{uuid: {uuid}, platformId: "platform_id", name: "name_file_{uuid}"}}')
|
||||||
uuid += 1
|
uuid += 1
|
||||||
f.write("\n] AS props CREATE (:File {uuid: props.uuid, platformId: props.platformId, name: props.name});\n")
|
f.write("] AS props CREATE (:File {uuid: props.uuid, platformId: props.platformId, name: props.name});\n")
|
||||||
|
|
||||||
identities = []
|
identities = []
|
||||||
f.write("UNWIND [")
|
f.write("UNWIND [")
|
||||||
@ -102,9 +102,9 @@ def main():
|
|||||||
for index in range(0, number_of_identities):
|
for index in range(0, number_of_identities):
|
||||||
if index != 0:
|
if index != 0:
|
||||||
f.write(",")
|
f.write(",")
|
||||||
f.write(f'\n {{uuid: {uuid}, name: "mail_{uuid}@something.com"}}')
|
f.write(f' {{uuid: {uuid}, name: "mail_{uuid}@something.com"}}')
|
||||||
uuid += 1
|
uuid += 1
|
||||||
f.write("\n] AS props CREATE (:Identity {uuid: props.uuid, name: props.name});\n")
|
f.write("] AS props CREATE (:Identity {uuid: props.uuid, name: props.name});\n")
|
||||||
|
|
||||||
f.write("UNWIND [")
|
f.write("UNWIND [")
|
||||||
created = 0
|
created = 0
|
||||||
@ -120,28 +120,18 @@ def main():
|
|||||||
f.write(",")
|
f.write(",")
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
f'\n {{permUuid: {uuid}, permName: "name_permission_{uuid}", fileUuid: {file_uuid}, identityUuid: {identity_uuid}}}'
|
f' {{permUuid: {uuid}, permName: "name_permission_{uuid}", fileUuid: {file_uuid}, identityUuid: {identity_uuid}}}'
|
||||||
)
|
)
|
||||||
created += 1
|
created += 1
|
||||||
uuid += 1
|
uuid += 1
|
||||||
|
|
||||||
if created == 5000:
|
if created == 5000:
|
||||||
f.write(
|
f.write(
|
||||||
"""\n] AS props
|
"] AS props MATCH (file:File {uuid:props.fileUuid}), (identity:Identity {uuid: props.identityUuid}) CREATE (permission:Permission {uuid: props.permUuid, name: props.permName}) CREATE (permission)-[: IS_FOR_FILE]->(file) CREATE (permission)-[: IS_FOR_IDENTITY]->(identity);\nUNWIND ["
|
||||||
MATCH (file:File {uuid:props.fileUuid}), (identity:Identity {uuid: props.identityUuid})
|
|
||||||
CREATE (permission:Permission {uuid: props.permUuid, name: props.permName})
|
|
||||||
CREATE (permission)-[: IS_FOR_FILE]->(file)
|
|
||||||
CREATE (permission)-[: IS_FOR_IDENTITY]->(identity);
|
|
||||||
UNWIND ["""
|
|
||||||
)
|
)
|
||||||
created = 0
|
created = 0
|
||||||
f.write(
|
f.write(
|
||||||
"""\n] AS props
|
"] AS props MATCH (file:File {uuid:props.fileUuid}), (identity:Identity {uuid: props.identityUuid}) CREATE (permission:Permission {uuid: props.permUuid, name: props.permName}) CREATE (permission)-[: IS_FOR_FILE]->(file) CREATE (permission)-[: IS_FOR_IDENTITY]->(identity);"
|
||||||
MATCH (file:File {uuid:props.fileUuid}), (identity:Identity {uuid: props.identityUuid})
|
|
||||||
CREATE (permission:Permission {uuid: props.permUuid, name: props.permName})
|
|
||||||
CREATE (permission)-[: IS_FOR_FILE]->(file)
|
|
||||||
CREATE (permission)-[: IS_FOR_IDENTITY]->(identity);
|
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user