generated from duckdb/extension-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starting on supporting prepared statements
- Loading branch information
Showing
2 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# name: test/sql/sqlpgq/copy_to_duckpgq.test | ||
# group: [duckpgq] | ||
|
||
require duckpgq | ||
|
||
statement ok | ||
import database 'duckdb-pgq/data/SNB0.003' | ||
|
||
statement ok | ||
-CREATE PROPERTY GRAPH snb | ||
VERTEX TABLES ( | ||
Person LABEL Person, | ||
Forum LABEL Forum, | ||
Organisation LABEL Organisation IN typemask(company, university), | ||
Place LABEL Place, | ||
Tag LABEL Tag, | ||
TagClass LABEL TagClass, | ||
Country LABEL Country, | ||
City LABEL City, | ||
Message LABEL Message | ||
) | ||
EDGE TABLES ( | ||
Person_knows_person SOURCE KEY (Person1Id) REFERENCES Person (id) | ||
DESTINATION KEY (Person2Id) REFERENCES Person (id) | ||
LABEL Knows, | ||
Forum_hasMember_Person SOURCE KEY (ForumId) REFERENCES Forum (id) | ||
DESTINATION KEY (PersonId) REFERENCES Person (id) | ||
LABEL hasMember, | ||
Forum_hasTag_Tag SOURCE KEY (ForumId) REFERENCES Forum (id) | ||
DESTINATION KEY (TagId) REFERENCES Tag (id) | ||
LABEL Forum_hasTag, | ||
Person_hasInterest_Tag SOURCE KEY (PersonId) REFERENCES Person (id) | ||
DESTINATION KEY (TagId) REFERENCES Tag (id) | ||
LABEL hasInterest, | ||
person_workAt_Organisation SOURCE KEY (PersonId) REFERENCES Person (id) | ||
DESTINATION KEY (OrganisationId) REFERENCES Organisation (id) | ||
LABEL workAt_Organisation, | ||
Person_likes_Message SOURCE KEY (PersonId) REFERENCES Person (id) | ||
DESTINATION KEY (id) REFERENCES Message (id) | ||
LABEL likes_Message, | ||
Message_hasTag_Tag SOURCE KEY (id) REFERENCES Message (id) | ||
DESTINATION KEY (TagId) REFERENCES Tag (id) | ||
LABEL message_hasTag, | ||
Message_hasAuthor_Person SOURCE KEY (messageId) REFERENCES Message (id) | ||
DESTINATION KEY (PersonId) REFERENCES Person (id) | ||
LABEL hasAuthor, | ||
Message_replyOf_Message SOURCE KEY (messageId) REFERENCES Message (id) | ||
DESTINATION KEY (ParentMessageId) REFERENCES Message (id) | ||
LABEL replyOf | ||
); | ||
|
||
|
||
|
||
statement ok | ||
-PREPARE is5 AS | ||
FROM GRAPH_TABLE (snb | ||
MATCH (m:message where m.id = $1)-[au:hasAuthor]->(p:person) | ||
COLUMNS (p.id, p.firstName, p.lastName) | ||
) tmp; | ||
|
||
query III | ||
EXECUTE is5(824633720985) | ||
---- | ||
14 Hossein Forouhar |