select Command for Ubiquity
by mitcho (Michael 芳貴 Erlewine)
select Command for Ubiquity from mitcho on Vimeo.
The select command for Ubiquity lets you execute SQL select statements from Ubiquity. select features:
- smart suggestions, offering up available table and column names,
- some simple parsing to block multi-statement queries so you can't injection-attack yourself, and
- smart insert, so you can immediately use your results as a table or as a single value.
Installation
To access your databases, you'll need to upload a helper PHP script on your site and link your select command to it. select requires PHP 4+.
- Configure the database config in your
select.phpfile. - Put this file on your server. If this is a public server, for security reasons, you might want to rename it to something obscure.
- Go to this script on your server. You should get a success message.
- Subscribe to the verbs on this page if you haven't already.
- Select the URL to the script (including
http://...), enter Ubiquity and runsetup-select thison the URL. - [optional] If you don't plan on using any other databases (i.e. any other
select.phpinstances), you can go to the Ubiquity command list (command-list) and disable thesetup-selectcommand.selectshould remember yourselect.phpchoice across restarts. (Thanks Aza!)
Issues
- The preview display of query results often will get clipped. This has to do with the interaction between the command and your Ubiquity theme. Suggestions welcome.
- There's no authentication mechanism.
- There ought to be a way to set aliases for commonly used databases so you don't need to enter the URL each time.
- [your feedback here]