-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
33 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
37 changes: 37 additions & 0 deletions
37
.../src/main/java/schemacrawler/tools/command/chatgpt/systemfunctions/SchemaDescription.java
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,37 @@ | ||
package schemacrawler.tools.command.chatgpt.systemfunctions; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
|
||
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class) | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public final class SchemaDescription { | ||
|
||
private String name; | ||
private final List<TableDescription> tables; | ||
|
||
public SchemaDescription() { | ||
tables = new ArrayList<>(); | ||
} | ||
|
||
public void addTable(final TableDescription table) { | ||
if (table != null) { | ||
tables.add(table); | ||
} | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public List<TableDescription> getTables() { | ||
return tables; | ||
} | ||
|
||
public void setName(final String name) { | ||
this.name = name; | ||
} | ||
} |
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
1 change: 0 additions & 1 deletion
1
schemacrawler-chatgpt/src/test/resources/AgentFunctionTest.agent
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
schemacrawler-chatgpt/src/test/resources/SchemaFunctionTest.outputSchema
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"tables":[{"schema":"PUBLIC.BOOKS","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"},{"schema":"PUBLIC.BOOKS","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"},{"schema":"PUBLIC.BOOKS","name":"Celebrities","columns":[{"name":"Id","type":"INTEGER"},{"name":"NAME","type":"VARCHAR"}]},{"schema":"PUBLIC.BOOKS","name":"COUPONS","columns":[{"name":"ID","type":"INTEGER"},{"name":"DATA","type":"CLOB"},{"name":"COUPONS","type":"INTEGER ARRAY"},{"name":"BOOKS","type":"VARCHAR(20) ARRAY[10]"}]},{"schema":"PUBLIC.BOOKS","name":"CUSTOMERDATA","columns":[{"name":"ID","type":"INTEGER"},{"name":"DATA","type":"VALID_STRING"}]},{"schema":"PUBLIC.BOOKS","name":"CUSTOMERS","columns":[{"name":"ID","type":"INTEGER"},{"name":"FIRSTNAME","type":"NAME_TYPE"},{"name":"LASTNAME","type":"NAME_TYPE"},{"name":"AGE","type":"AGE_TYPE"}]},{"schema":"PUBLIC.BOOKS","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"},{"schema":"PUBLIC.\"PUBLISHER SALES\"","name":"REGIONS","columns":[{"name":"CITY","type":"VARCHAR"},{"name":"STATE","type":"VARCHAR"},{"name":"POSTALCODE","type":"VARCHAR"},{"name":"COUNTRY","type":"VARCHAR"}]},{"schema":"PUBLIC.\"PUBLISHER SALES\"","name":"SALESDATA","columns":[{"name":"SALESDATAID","type":"INTEGER"},{"name":"YEARLYAMOUNT","type":"DOUBLE"}]},{"schema":"PUBLIC.BOOKS","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"},{"schema":"PUBLIC.BOOKS","name":"Celebrity Updates","columns":[{"name":"Celebrity Id","type":"INTEGER"},{"name":"UPDATE","type":"VARCHAR"}]},{"schema":"PUBLIC.BOOKS","name":"ΒΙΒΛΊΑ","columns":[{"name":"ΜΟΝΑΔΙΚΌΣ","type":"SMALLINT"},{"name":"ΤΊΤΛΟΣ","type":"VARCHAR"},{"name":"ΠΕΡΙΓΡΑΦΉ","type":"VARCHAR"},{"name":"ΕΚΔΌΤΗΣ","type":"SMALLINT"}]},{"schema":"PUBLIC.\"PUBLISHER SALES\"","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"}]},{"schema":"PUBLIC.BOOKS","name":"AUTHORSLIST","columns":[{"name":"ID","type":"INTEGER"},{"name":"FIRSTNAME","type":"VARCHAR"},{"name":"LASTNAME","type":"VARCHAR"}]}]} | ||
{"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"}]} |