Subject | Re: [Firebird-Architect] Re: embedding Lua as procedural language |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2008-12-23T00:14:42Z |
Roman Rokytskyy wrote:
javascript-to-bytecode:
http://java.sun.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html
InternalContext
- String getObjectName()
FirebirdTriggerContext extends InternalContext
- String getTableName()
This is what I currently already have for triggers. It need additions.
More methods are necessary to read all parameters (and fields OLD.*,
NEW.*) from an "array". With that array, things could be passed back and
forth between the Java code to script engines.
Also, external procedures currently can't have body source. They can
only have an "external name". It would be ok to have:
set term !!;
create function add (n1 integer, n2 integer) return integer external
engine Javascript
as
begin
/* Javascript code */
return n1 + n2;
end!!
That's more or less how it works in PgSQL AFAIR.
Adriano
>> What about javax.script package?The Sun implementation is based on it, without the
>>
>
> I think Rhino is directly supported, if not - there is definitely some
> plugin package already.
>
javascript-to-bytecode:
http://java.sun.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html
>The basic idea is to have classes:
>> With some small (that I already plan) additions to FB Java Engine, it
>> will be possible to implement an engine in Java that interfaces with
>> javax.script engines.
>>
>
> Cool, let's talk about it after holidays...
>
InternalContext
- String getObjectName()
FirebirdTriggerContext extends InternalContext
- String getTableName()
This is what I currently already have for triggers. It need additions.
More methods are necessary to read all parameters (and fields OLD.*,
NEW.*) from an "array". With that array, things could be passed back and
forth between the Java code to script engines.
Also, external procedures currently can't have body source. They can
only have an "external name". It would be ok to have:
set term !!;
create function add (n1 integer, n2 integer) return integer external
engine Javascript
as
begin
/* Javascript code */
return n1 + n2;
end!!
That's more or less how it works in PgSQL AFAIR.
Adriano