Re: need help designing a database table (or tables) to hold a hash ( %config) and ( %group)
Peter Vereshagin <[email protected]> Fri, 29 Apr 2011 19:44:34 +0400
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Organization | ' |
| Message-ID | <[email protected]> |
Be sure to wear flowers on your hat, perl! 2011/04/22 22:28:06 +0530 Agnello George <[email protected]> => To [email protected] : AG> I have just registered to this site , i am a network engineer and AG> recently got busy coding in perl ( just a beginner ) There are several options for you. For a beginner, I'd like to mention the Tie::DBI. AG> i am creating a script for deployment of websites and i need to create AG> hash %config ( which stores a lot of configurations setting for AG> each type of website ) ... i have been manually eaditing this hash AG> but now the hash has to now be generated from a a database ( mysql ) AG> ... i have never worked with designing a database structure . Can AG> any one guide me how to go about it . AG> AG> AG> my hash structure looks some thing like this AG> AG> my %config = ( 'website_auto_1' => { AG> 'group' => 'website_auto_group1', AG> 'tempdir' => '/var/www/html/temp/auto' , AG> 'svnurl' => 'http://svn.intranet.com/repos/branch/auto', AG> 'excludes' => AG> 'uploaded_images|includes/config.php|admin/includes/config.php|.svn', AG> 'tarpath' => '/var/www/html/temp/autotar/', AG> 'tarname' => 'auto', AG> 'rmtrootdir' => '/var/www/projects/auto', AG> 'rmttmpdir' => '/temp/auto', AG> 'rmteserver' => '192.168.1.26' }, AG> AG> website_auto_2 => { .... AG> : AG> : AG> ) ; AG> AG> %group = ( website_auto_1 => { auto_group => [ name => user1 , name AG> => user2 , name => user6 ] }, AG> website_auto_2 => { auto_group => [ name => user2 , AG> name => user5 ] }, ... AG> : AG> : AG> ); AG> AG> i am not too sure if the %group ( not really implement this ) hash is AG> correct , but i what i want to do is , my deployment script should AG> only allow users who are logged in to deploy a particular website ( AG> eg website_auto_1 ) if they belong to the group . Is it of any mysql-specific? I'd like to put ORM implementations like Rose::DB::Object and DBIx::Class on your list but looking at your code I'm not sure if you need just (de)serialize from/to blob/text field with Data::Dumper is the first stop... 73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB 12F8 0CE1 4AAC A0E2 6627) -- http://vereshagin.org -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected]