I have an idea for a plugin for SQuirreL SQL client and I'd like to know how to make a plugin. My plugin will be a query builder UI which needs access to the schema model including tables, columns, primary keys, foreign keys and constraints etc.
I have searched the web for SQurreL plugin information / tutorials and I can't find much. The best I can find is on Wikipedia which is quite brief.
If you have any links, tutorials, examples or any other information on creating SQuirreL plugins, please post them here.
Thanks
To start interacting with the database that you've connected to, double-click its name in SQuirreL SQL's Aliases window. This will open a new session. You can have multiple sessions open at the same time in SQuirreL SQL, each one connected to a different database.
SQuirreL SQL Client is a program written in Java that allows you to view the contents of a database, issue SQL commands, and as you will see, perform a number of other functions. The graphical front end is built to support JDBC-compliant databases. This article demonstrates SQuirreL being used with DB2 UDB.
Here is a class for extending a Squirrel Plugin made in Java:
public class FulltextsearchPlugin extends DefaultSessionPlugin {
private final Analyzer analyzer = new StandardAnalyzer();
private final String path = "c:/temp/lucene/squirrel/";
private final IndexWriter writer = createIndexWriter();
@Override
public String getAuthor() {
return "Mike Haller";
}
@Override
public String getDescriptiveName() {
return "Full-Text Search Plugin";
}
@Override
public String getInternalName() {
return "fulltextsearchplugin";
}
@Override
public String getVersion() {
return "0.0.1";
}
@Override
public PluginSessionCallback sessionStarted(ISession session) {
// Add context menu items to the object tree's view and procedure nodes.
IObjectTreeAPI otApi = session.getSessionInternalFrame()
.getObjectTreeAPI();
otApi.addToPopup(DatabaseObjectType.TABLE, new FulltextsearchMenu(this,
session));
return new PluginSessionCallbackAdaptor(this);
}
}
That is a code snapshot from one of the best tutorials in my view, which provides a very clear discussion with steps on how to get a plugin implemented. The material provides a good template to extend it to other cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With