<div>For this to be done automatically, </div>
<div>in your result source Employee:</div>
<div> </div>
<div>__PACKAGE__->resultset_attributes({</div>
<div> +select => [ \"AES_DECRYPT(field_name,'password')" ],<br> +as => [qw/ decrypted_field_name /],<br>});<br><br> </div>
<div><span class="gmail_quote">2007/5/7, "Dieter Späth" <<a href="mailto:SHAD0WRUNNER@gmx.de">SHAD0WRUNNER@gmx.de</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>-------- Original-Nachricht --------<br>Datum: Mon, 07 May 2007 09:44:28 +0200<br>Von: <a href="mailto:quarky@quantentunnel.de">
quarky@quantentunnel.de</a><br>An: <a href="mailto:dbix-class@lists.rawmode.org">dbix-class@lists.rawmode.org</a><br>Betreff: [Dbix-class] automatically applying db-functions on specific fields<br><br>> Hi,<br>><br>
> hope this is not too much a newby question, but it really bugs me.<br>><br>> I have a table with encrypted information in one field. Actually it is<br>> encrypted with the aes_encrypt function of mysql. I would like to use this
<br>> function to automatically encrypt and decrypt the values in this field using<br>> the database function, but I do not find any hook where I can attach the<br>> function to DBIx::Class. I imagine it to work just automatically everytime I
<br>> insert, update or read values.<br>><br>> Any suggestions? (In the unlikely event, that someone might know how to<br>> emulate aes_encrypt by using perl on the client side, I would appreciate this<br>> information too, but I am still interested in usage of db-functions on
<br>> fields anyways)<br>><br>> Best Regards<br>> Wolfgang Warner<br><br>For reading try this:<br><br>$rs = $schema->resultset('Employee')->search(undef, {<br> +select => [ \"AES_DECRYPT(field_name,'password')" ],
<br> +as => [qw/ decrypted_field_name /],<br>});<br><br>More Information can be found<br><br><a href="http://search.cpan.org/~jrobinson/DBIx-Class-0.07005/lib/DBIx/Class/Manual/Cookbook.pod#Using_database_functions_or_stored_procedures">
http://search.cpan.org/~jrobinson/DBIx-Class-0.07005/lib/DBIx/Class/Manual/Cookbook.pod#Using_database_functions_or_stored_procedures</a><br><br>"Using database functions or stored procedures"<br><br>&&<br>
<br>perldoc SQL::Abstract<br><br><br>><br>> --<br>> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...<br>> Jetzt GMX TopMail testen: <a href="http://www.gmx.net/de/go/topmail">http://www.gmx.net/de/go/topmail
</a><br>><br>> _______________________________________________<br>> List: <a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class">http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class</a><br>
> Wiki: <a href="http://dbix-class.shadowcatsystems.co.uk/">http://dbix-class.shadowcatsystems.co.uk/</a><br>> IRC: irc.perl.org#dbix-class<br>> SVN: <a href="http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/">
http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/</a><br>> Searchable Archive:<br>> <a href="http://www.mail-archive.com/dbix-class@lists.rawmode.org/">http://www.mail-archive.com/dbix-class@lists.rawmode.org/
</a><br><br>--<br>FastJack<br><br>"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...<br>Jetzt GMX TopMail testen: <a href="http://www.gmx.net/de/go/topmail">http://www.gmx.net/de/go/topmail</a><br><br>_______________________________________________
<br>List: <a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class">http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class</a><br>Wiki: <a href="http://dbix-class.shadowcatsystems.co.uk/">http://dbix-class.shadowcatsystems.co.uk/
</a><br>IRC: irc.perl.org#dbix-class<br>SVN: <a href="http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/">http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/</a><br>Searchable Archive: <a href="http://www.mail-archive.com/dbix-class@lists.rawmode.org/">
http://www.mail-archive.com/dbix-class@lists.rawmode.org/</a><br></blockquote></div><br>