Hi,
I'm adding encryption/decryption support to Ebean ORM.

Currently with H2 I am combining DECRYPT UTF8TOSTRING and TRIM
functions.

An example query ends up like:

select e.id c0, e.name c1, TRIM(CHAR(0) FROM UTF8TOSTRING(DECRYPT
('AES', STRINGTOUTF8(?), e.description))) c2, e.last_update c3
from e_basicenc e
where TRIM(CHAR(0) FROM UTF8TOSTRING(DECRYPT('AES', STRINGTOUTF8(?),
e.description))) like ?


I am wondering if/how I can make the syntax cleaner. To be closer to
that of Postgres pgp_sym_decrypt, MySql aes_decrypt etc.

For example, the same query with Postgres pgp_sym_decrypt (which I
find easier to read) is:

select e.id as c0, e.name as c1, pgp_sym_decrypt(e.description,?) as
c2, e.last_update as c3
from e_basicenc e
where pgp_sym_decrypt(e.description,?) like ?


Is there a better syntax I should use?
Are there any plans to provide easier/more DECRYPT functions in the
future?


Thanks, Rob.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to