Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: need help designing a database table (or tables) to hold a hash (%config) and ( %group)

Posted on 2011-04-22 18:58:06 by Agnello George

Hi All

I have just registered to this site , i am a network engineer and
recently got busy coding in perl ( just a beginner )

i am creating a script for deployment of websites and i need to create
=A0hash =A0 =A0%config ( which stores a lot of configurations setting for
each type of website ) =A0... i have been manually =A0eaditing this hash
but now the =A0hash =A0has to now be generated from a a database ( mysql )
.... i have =A0never worked =A0with designing a database structure . Can
any one guide =A0me how to go about =A0it =A0.


my hash structure looks some thing like this

my %config  = ( 'website_auto_1' =3D> {
=A0 =A0 =A0 'group' =3D> 'website_auto_group1',
=A0 =A0 'tempdir' =3D> '/var/www/html/temp/auto' ,
=A0 'svnurl' =3D> 'http://svn.intranet.com/repos/branch/auto',
=A0 'excludes' =3D>
'uploaded_images|includes/config.php|admin/includes/config.p hp|.svn',
=A0 'tarpath' =3D> '/var/www/html/temp/autotar/',
=A0 'tarname' =3D> 'auto',
=A0 =A0'rmtrootdir' =3D> '/var/www/projects/auto',
=A0 =A0'rmttmpdir' =3D> '/temp/auto',
=A0 =A0'rmteserver' =3D> '192.168.1.26' },

website_auto_2 =3D> { ....
:
:
) ;

%group =3D ( =A0website_auto_1  => { auto_group =3D> [ name =3D> user1 =
, name
=3D> user2 , name =3D> user6 ] },
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0website_auto_2  => { auto_group =3D>=
[ name =3D> user2 ,
=A0name =3D> user5 ] }, ...
:
:
);

i am not too sure if the %group ( not really implement this ) =A0hash is
correct , but i what i want to do is , my deployment script should
only allow users who are logged in =A0to deploy a particular website (
eg website_auto_1 ) =A0if they belong to the group .


thanks in advanced






--
Regards
Agnello D'souza

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Report this message

#2: Re: need help designing a database table (or tables) to hold a hash( %config) and ( %group)

Posted on 2011-04-29 17:44:34 by Peter Vereshagin

Be sure to wear flowers on your hat, perl!
2011/04/22 22:28:06 +0530 Agnello George <agnello.dsouza@gmail.com> => To perl@lists.mysql.com :
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.p hp|.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/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Report this message