You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Sylvain Leroux <sy...@chicoree.fr> on 2010/03/13 12:21:42 UTC

Scripting Derby?

Hi,

For quite some time, I think of adding some "advanced" scripting capabilities to 
ij, like variables and control structures (loops, conditional statements). Not 
for data processing, but to help writing maintenance scripts.

As part of DERBY-4566 (Make it possible to define variables in ij) I have done 
some experiments on this. And I think it is quite feasible.

But my question is "Do you feel it is a good idea?".


After all, ij is (was?) mostly a testing tool. And one might argue it is not its 
purpose to be used as a scripting engine. On the other hand, requiring an 
external tool or a Java development for any non-trivial maintenance task seems 
to me a little bit excessive. Beside this, there could be alternatives. For 
example, by using the Java scripting API, we might be able to plug some 
scripting support in Derby itself - with the additional benefit of supporting 
"well known" language. DERBY-4467 (Non Java Stored Routines Using Java Scripting 
API) was a step in that way.


As you see, there is both pros and cons. So, what do you think?


Thanks in advance,
- Sylvain


-- 
sylvain@chicoree.fr
http://www.chicoree.fr



Re: Scripting Derby?

Posted by Sylvain Leroux <sy...@chicoree.fr>.
Thank you all for your replies on that topic.

I agree that we shouldn't spend too much time and efforts adding "scripting" 
capabilities to ij - whereas there are so much languages that could be supported 
through JSR 223 (Scripting for the JavaTM Platform).


At this point, I see two places where scripting support could be investigated:
- "inside" Derby, to support stored procedures/functions written using a 
scripting language. Shazin Sadakath has already done some work on that as part 
of DERBY-4467.
- "outside" Derby, to ease maintenance tasks by allowing an administrator to run 
scripts against a Derby DB without relying on a specific Java development.

One key point should be the ease of use.


I don't know at which extend other DBMS supports scripting languages. Maybe one 
of our enthusiast students could perform a quick survey on this?


Regards,
- Sylvain


-- 
sylvain@chicoree.fr
http://www.chicoree.fr



Re: Scripting Derby?

Posted by Ян Программист <we...@gmail.com>.
You already answered it. Looks like some of your email comes to me later
than new ones. John

2010/3/16 Rick Hillegas <Ri...@sun.com>

> Ян Программист wrote:
>
>> Hello, people. Rick, you are a bit unreachable via email. I have some
>> ideas against this stuff. Can you say what you think about that? Thanks.
>> John
>>
> Hi John,
>
> I do see this mail. What are your ideas?
>
> Thanks,
> -Rick
>
>

Re: Scripting Derby?

Posted by Rick Hillegas <Ri...@Sun.COM>.
Ян Программист wrote:
> Hello, people. Rick, you are a bit unreachable via email. I have some 
> ideas against this stuff. Can you say what you think about that? 
> Thanks. John
Hi John,

I do see this mail. What are your ideas?

Thanks,
-Rick


Re: Scripting Derby?

Posted by Ян Программист <we...@gmail.com>.
Hello, people. Rick, you are a bit unreachable via email. I have some ideas
against this stuff. Can you say what you think about that? Thanks. John

Re: Scripting Derby?

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Sylvain and Bryan,

My $0.02 inline...

Bryan Pendleton wrote:
> Hello Sylvain, thank you very much for all the contributions you've been
> making to Derby. The work on IJ has been quite interesting to watch.
>
>> could be alternatives. For example, by using the Java scripting API, 
>> we might be able to plug some scripting support in Derby itself - 
>> with the additional benefit of supporting "well known" language. 
>
> Is it correct that you are suggesting an alternate approach along the
> lines of https://scripting.dev.java.net/, using a language such as
> Ruby, Groovy, or JavaScript?
>
> If so, then yes, I think such an approach would be very promising and 
> very powerful.
>
> I would prefer to see us spend less time building our own scripting 
> language,
> and more time instead integrating with the variety of extraordinarily
> sophisticated scripting languages that already exist.

I think that this is a promising approach. I am reluctant to add a lot 
of new language to ij. At the end of the day, this is what I miss in ij:

1) The ability to parameterize a block of SQL statements

2) The ability to loop through a block of SQL statements

If this can be accomplished outside of ij in some other scripting 
language (including old-fashioned scripting languages like shells), 
great. If this can be accomplished by adding a small new capability to 
ij (like parameters), also great. My concern about the proposed new 
looping language is that it feels unbounded, kind of like pulling on a 
ball of yarn.

Thanks for pushing this discussion forward.

Cheers,
-Rick
>
> thanks,
>
> bryan


Re: Scripting Derby?

Posted by Bryan Pendleton <bp...@gmail.com>.
Hello Sylvain, thank you very much for all the contributions you've been
making to Derby. The work on IJ has been quite interesting to watch.

> could be alternatives. For example, by using the Java scripting API, we 
> might be able to plug some scripting support in Derby itself - with the 
> additional benefit of supporting "well known" language. 

Is it correct that you are suggesting an alternate approach along the
lines of https://scripting.dev.java.net/, using a language such as
Ruby, Groovy, or JavaScript?

If so, then yes, I think such an approach would be very promising and very powerful.

I would prefer to see us spend less time building our own scripting language,
and more time instead integrating with the variety of extraordinarily
sophisticated scripting languages that already exist.

thanks,

bryan