is it possible to inflate/deflate columns using mysql functions via  
RDBO?


that is, consider the following behavior:

mysql> create table special ( id int auto_increment primary key,  
secret blob ) ;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into special (secret) values (AES_ENCRYPT('hello  
world', 'SECRET')) ;
Query OK, 1 row affected (0.00 sec)

mysql> select id, AES_DECRYPT(secret, 'SECRET') as secret from  
special where id=1  ;
+----+-------------+
| id | secret      |
+----+-------------+
|  1 | hello world |
+----+-------------+
1 row in set (0.00 sec)


i would like a way to specify the magic in-db formula for getting/ 
setting this column, using a (non-db-related) accessor (ie, not  
constant for all rows) to generate the 'SECRET' portion of the  
function.  i've read through the docs for  
Rose::DB::Object::Metadata::Column but don't see a solution.

any suggestions about how to approach this?


as an alternate solution, i am considering doing all the de/cryption  
work in perl, with the idea that i can inflate/deflate columns using  
RDBO triggers, but this part has me worried (re: inflate, deflate  
triggers):

   Note that the value to be inflated may have come from the  
database, or from end-user code. Be prepared to handle almost anything.

since the de/crypt should only happen with values to/from the db, not  
from end-user code.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to