From 0a2f59f322957e132008caabeab301557c2b9d67 Mon Sep 17 00:00:00 2001 From: Sualeh Fatehi Date: Sat, 22 Jul 2023 21:31:17 -0400 Subject: [PATCH] Add note on no data being shared --- .../command/chatgpt/systemfunctions/SchemaFunctionReturn.java | 2 +- .../src/test/resources/SchemaFunctionTest.outputSchema | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/schemacrawler-chatgpt/src/main/java/schemacrawler/tools/command/chatgpt/systemfunctions/SchemaFunctionReturn.java b/schemacrawler-chatgpt/src/main/java/schemacrawler/tools/command/chatgpt/systemfunctions/SchemaFunctionReturn.java index 365887330c..49eec57b98 100644 --- a/schemacrawler-chatgpt/src/main/java/schemacrawler/tools/command/chatgpt/systemfunctions/SchemaFunctionReturn.java +++ b/schemacrawler-chatgpt/src/main/java/schemacrawler/tools/command/chatgpt/systemfunctions/SchemaFunctionReturn.java @@ -41,6 +41,6 @@ protected SchemaFunctionReturn(final CatalogDescription catalogDescription) { @Override public String get() { - return catalogDescription.toString(); + return String.format("Description of database schema in JSON:%n%s", catalogDescription); } } diff --git a/schemacrawler-chatgpt/src/test/resources/SchemaFunctionTest.outputSchema b/schemacrawler-chatgpt/src/test/resources/SchemaFunctionTest.outputSchema index 1993c4947f..782fba1061 100644 --- a/schemacrawler-chatgpt/src/test/resources/SchemaFunctionTest.outputSchema +++ b/schemacrawler-chatgpt/src/test/resources/SchemaFunctionTest.outputSchema @@ -1 +1,2 @@ +Description of database schema in JSON: {"schemas":[{"name":"PUBLIC.BOOKS","tables":[{"name":"AUTHORS","columns":[{"name":"ID","type":"INTEGER"},{"name":"FIRSTNAME","type":"VARCHAR"},{"name":"LASTNAME","type":"VARCHAR"},{"name":"ADDRESS1","type":"VARCHAR"},{"name":"ADDRESS2","type":"VARCHAR"},{"name":"CITY","type":"VARCHAR"},{"name":"STATE","type":"CHARACTER"},{"name":"POSTALCODE","type":"VARCHAR"},{"name":"COUNTRY","type":"VARCHAR"}],"remarks":"Contact details for book authors"},{"name":"BOOKS","columns":[{"name":"ID","remarks":"Unique (internal) id for book","type":"INTEGER"},{"name":"TITLE","remarks":"Book title","type":"VARCHAR"},{"name":"DESCRIPTION","remarks":"Book description\n(Usually the blurb from the book jacket or promotional materials)","type":"VARCHAR"},{"name":"PUBLISHERID","remarks":"Foreign key to the book publisher","type":"INTEGER"},{"name":"PUBLICATIONDATE","remarks":"Book publication date","type":"DATE"},{"name":"PRICE","remarks":"Current price for the book","type":"DOUBLE"},{"name":"PREVIOUSEDITIONID","type":"INTEGER"}],"remarks":"Details for published books"},{"name":"Celebrities","columns":[{"name":"Id","type":"INTEGER"},{"name":"NAME","type":"VARCHAR"}]},{"name":"COUPONS","columns":[{"name":"ID","type":"INTEGER"},{"name":"DATA","type":"CLOB"},{"name":"COUPONS","type":"INTEGER ARRAY"},{"name":"BOOKS","type":"VARCHAR(20) ARRAY[10]"}]},{"name":"CUSTOMERDATA","columns":[{"name":"ID","type":"INTEGER"},{"name":"DATA","type":"VALID_STRING"}]},{"name":"CUSTOMERS","columns":[{"name":"ID","type":"INTEGER"},{"name":"FIRSTNAME","type":"NAME_TYPE"},{"name":"LASTNAME","type":"NAME_TYPE"},{"name":"AGE","type":"AGE_TYPE"}]},{"name":"PUBLISHERS","columns":[{"name":"ID","remarks":"Unique (internal) id for book publisher","type":"INTEGER"},{"name":"PUBLISHER","remarks":"Name of book publisher","type":"VARCHAR"}],"remarks":"List of book publishers"},{"name":"BOOKAUTHORS","columns":[{"name":"BOOKID","type":"INTEGER"},{"name":"AUTHORID","type":"INTEGER"},{"name":"SOMEDATA","type":"VARCHAR"}],"remarks":"Relationship between books and their authors, \nalong with the latest updated information"},{"name":"Celebrity Updates","columns":[{"name":"Celebrity Id","type":"INTEGER"},{"name":"UPDATE","type":"VARCHAR"}]},{"name":"ΒΙΒΛΊΑ","columns":[{"name":"ΜΟΝΑΔΙΚΌΣ","type":"SMALLINT"},{"name":"ΤΊΤΛΟΣ","type":"VARCHAR"},{"name":"ΠΕΡΙΓΡΑΦΉ","type":"VARCHAR"},{"name":"ΕΚΔΌΤΗΣ","type":"SMALLINT"}]},{"name":"AUTHORSLIST","columns":[{"name":"ID","type":"INTEGER"},{"name":"FIRSTNAME","type":"VARCHAR"},{"name":"LASTNAME","type":"VARCHAR"}]}]},{"name":"PUBLIC.INFORMATION_SCHEMA"},{"name":"PUBLIC.PUBLIC"},{"name":"PUBLIC.\"PUBLISHER SALES\"","tables":[{"name":"REGIONS","columns":[{"name":"CITY","type":"VARCHAR"},{"name":"STATE","type":"VARCHAR"},{"name":"POSTALCODE","type":"VARCHAR"},{"name":"COUNTRY","type":"VARCHAR"}]},{"name":"SALESDATA","columns":[{"name":"SALESDATAID","type":"INTEGER"},{"name":"YEARLYAMOUNT","type":"DOUBLE"}]},{"name":"SALES","columns":[{"name":"POSTALCODE","type":"VARCHAR"},{"name":"COUNTRY","type":"VARCHAR"},{"name":"BOOKID","type":"INTEGER"},{"name":"COUPON_ID","type":"INTEGER"},{"name":"PERIODENDDATE","type":"DATE"},{"name":"TOTALAMOUNT","type":"DOUBLE"},{"name":"SALESDATAID","type":"INTEGER"}]}]},{"name":"PUBLIC.SYSTEM_LOBS"}]} \ No newline at end of file