Yep that is definitely something that is possible, it depends how you would like it to work though.
The solution I am aware of would be to create a macro. This would simply have your yxdb and a macro output. Which you could then use as a 'input type' macro. You could upload this to the gallery and users could download it if they wished to use it.