<div>For this to be done automatically, </div>
<div>in your result source Employee:</div>
<div>&nbsp;</div>
<div>__PACKAGE__-&gt;resultset_attributes({</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; +select =&gt; [ \&quot;AES_DECRYPT(field_name,&#39;password&#39;)&quot; ],<br>&nbsp;&nbsp;&nbsp;&nbsp; +as&nbsp;&nbsp;&nbsp;&nbsp; =&gt; [qw/ decrypted_field_name /],<br>});<br><br>&nbsp;</div>
<div><span class="gmail_quote">2007/5/7, &quot;Dieter Späth&quot; &lt;<a href="mailto:SHAD0WRUNNER@gmx.de">SHAD0WRUNNER@gmx.de</a>&gt;:</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>&gt; Hi,<br>&gt;<br>
&gt; hope this is not too much a newby question, but it really bugs me.<br>&gt;<br>&gt; I have a table with encrypted information in one field. Actually it is<br>&gt; encrypted with the aes_encrypt function of mysql. I would like to use this
<br>&gt; function to automatically encrypt and decrypt the values in this field using<br>&gt; the database function, but I do not find any hook where I can attach the<br>&gt; function to DBIx::Class. I imagine it to work just automatically everytime I
<br>&gt; insert, update or read values.<br>&gt;<br>&gt; Any suggestions? (In the unlikely event, that someone might know how to<br>&gt; emulate aes_encrypt by using perl on the client side, I would appreciate this<br>&gt; information too, but I am still interested in usage of db-functions on
<br>&gt; fields anyways)<br>&gt;<br>&gt; Best Regards<br>&gt; Wolfgang Warner<br><br>For reading try this:<br><br>$rs = $schema-&gt;resultset(&#39;Employee&#39;)-&gt;search(undef, {<br>&nbsp;&nbsp;&nbsp;&nbsp; +select =&gt; [ \&quot;AES_DECRYPT(field_name,&#39;password&#39;)&quot; ],
<br>&nbsp;&nbsp;&nbsp;&nbsp; +as&nbsp;&nbsp;&nbsp;&nbsp; =&gt; [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>&quot;Using database functions or stored procedures&quot;<br><br>&amp;&amp;<br>
<br>perldoc SQL::Abstract<br><br><br>&gt;<br>&gt; --<br>&gt; &quot;Feel free&quot; - 10 GB Mailbox, 100 FreeSMS/Monat ...<br>&gt; Jetzt GMX TopMail testen: <a href="http://www.gmx.net/de/go/topmail">http://www.gmx.net/de/go/topmail
</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; 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>
&gt; Wiki: <a href="http://dbix-class.shadowcatsystems.co.uk/">http://dbix-class.shadowcatsystems.co.uk/</a><br>&gt; IRC: irc.perl.org#dbix-class<br>&gt; 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>&gt; Searchable Archive:<br>&gt; <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>&quot;Feel free&quot; - 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>