File manager - Edit - /usr/local/share/man/man3/HDB.3pm
Back
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "HDB 3" .TH HDB 3 "2005-01-05" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HDB \- Hybrid Database \- Handles multiple databases with the same interface. .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fB\s-1HDB\s0 is an easy, fast and powerfull way to access any type of database\fR. With it you \fBdon't need to know \s-1SQL, DBI,\s0 or the type of the database\fR that you are using. \&\s-1HDB\s0 will make all the work around between the differences of any database. From \s-1HDB\s0 you still can use \s-1DBI\s0 and \s-1SQL\s0 commands if needed, but this won't be portable between database types. If you use only \s-1HDB\s0 querys (not \s-1DBI\s0) \fByou can change the database that you are using, Server and \s-1OS\s0 without change your code!\fR For example, you can test/develope your code in your desktop (let's say Win32) with SQLite, and send your code to the Server (Linux), where you use MySQL. .PP \&\s-1HDB\s0 borns like a module to access in a easy way MySQL databases from \s-1HPL\s0 Documents. From \s-1HPL6,\s0 when it was fully rewrited, the module \s-1MYSQL\s0 was rewrited too and called \s-1HDB,\s0 where the resources were expanded for other \s-1DB\s0 types, like SQLite. Also \s-1HDB\s0 was turned into a Perl module, that can run independent of \s-1HPL\s0 when not called from it. .SH "USAGE" .IX Header "USAGE" .Vb 1 \& use HDB ; \& \& my $HDB = HDB\->new( \& type => \*(Aqsqlite\*(Aq , \& file => \*(Aqtest.db\*(Aq , \& ) ; \& \& ... or ... \& \& my $HDB = HDB\->new( \& type => \*(Aqmysql\*(Aq , \& host => \*(Aqsome.domain.com\*(Aq , \& user => \*(Aqfoo\*(Aq , \& pass => \*(Aqbar\*(Aq , \& ) ; \& \& $HDB\->create(\*(Aqusers\*(Aq,[ \& \*(Aquser\*(Aq => 100 , \& \*(Aqname\*(Aq => 100 , \& \*(Aqage\*(Aq => \*(Aqint(200)\*(Aq , \& \*(Aqmore\*(Aq => 1024*4 , \& ]); \& \& $HDB\->insert( \*(Aqusers\*(Aq , { \& user => \*(Aqjoe\*(Aq , \& name => \*(Aqjoe tribianny\*(Aq , \& age => \*(Aq30\*(Aq , \& } ) ; \& \& ... or ... \& \& $HDB\->users\->insert( { \& user => \*(Aqjoe\*(Aq , \& name => \*(Aqjoe tribianny\*(Aq , \& age => \*(Aq30\*(Aq , \& } ) ; \& \& \& ... \& \& my @sel = $HDB\->select(\*(Aqusers\*(Aq , \*(Aqname =~ joe\*(Aq , \*(Aq@%\*(Aq ) ; \& \& foreach my $sel_i ( @sel ) { \& my %cols = %$sel_i ; \& ... \& } \& \& ... \& \& my $hdbhandle = $HDB\->select(\*(Aqusers\*(Aq , \*(Aq<%>\*(Aq); \& \& while( my %cols = <$hdbhandle> ) { \& foreach my $Key ( keys %cols ) { print "$Key = $cols{$Key}\en" ;} \& ... \& } \& \& ... \& \& $HDB\->update(\*(Aqusers\*(Aq , \*(Aquser eq joe\*(Aq , { user => \*(AqJoeT\*(Aq } ) \& \& ... \& \& $HDB\->disconnect ; .Ve .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Create the \s-1HDB\s0 object connected to the \s-1DB.\s0 .PP \&\fBArguments:\fR .IP "\s-1FILE\s0" 10 .IX Item "FILE" File for flat databases, like SQLite. .IP "\s-1DB\s0" 10 .IX Item "DB" The database name. .IP "\s-1HOST\s0" 10 .IX Item "HOST" The host of the database server. If omited and needed will use \*(L"localhost\*(R". .IP "\s-1USER\s0" 10 .IX Item "USER" The user for connection. .IP "\s-1PASS\s0" 10 .IX Item "PASS" The password for connection. .IP "\s-1TYPE\s0" 10 .IX Item "TYPE" The database type. See modules inside \s-1HDB/MOD\s0 for installed names. .IP "\s-1CACHE \s0(boolean)" 10 .IX Item "CACHE (boolean)" Turn on/off the cache of sth and col names. .IP "\s-1ID\s0" 10 .IX Item "ID" Set a global \s-1ID\s0 for dynamic access. .IP "\s-1DYNAMIC \s0(boolean)" 10 .IX Item "DYNAMIC (boolean)" Enable/disable the dynamic acess. .IP "\s-1WARNING \s0(boolean)" 10 .IX Item "WARNING (boolean)" Turn on/off errors/warnings. .SS "open" .IX Subsection "open" Alias for new. .SS "connect" .IX Subsection "connect" Connect to the database. Note, no arguments are needed, they will be get from the object. .PP ** Password will be hidden inside the class, not int the object. .SS "disconnect" .IX Subsection "disconnect" Disconnect the database and free any sth or cache. .SS "reconnect" .IX Subsection "reconnect" Disconnect, if needed, and reconnect the database. .SS "dbh" .IX Subsection "dbh" Use to access in the \s-1DBI\s0 way: .PP .Vb 1 \& $HDB\->dbh\->do("select * from users") ; \& \& ... \& \& my $sth = $HDB\->dbh\->prepare("INSERT INTO users VALUES (?, ?, ?)") ; \& $sth\->execute("joe", "Joe Tribiany", "joe\efriends.com") ; .Ve .PP You can use \fIdbi\fR too: .PP .Vb 1 \& $HDB\->dbi\->do("select * from users") ; .Ve .PP \&\fB** Try to avoid this way to keep your code portable between database types and \s-1OS\s0\fR. .SH "COMMANDS METHODS" .IX Header "COMMANDS METHODS" ** See \s-1HDB::CMDS\s0 for usage. .PP \&\fBCommands:\fR select, insert, update, delete, create, drop, cmd, names, tables, table_columns... .SH "DYNAMIC ACCESS" .IX Header "DYNAMIC ACCESS" You can access the database connection without have the object variable. With this you have a global access to any connection with the \s-1ID\s0 set. .PP The Dynamic Access allow the use of a table as a method too: .PP .Vb 1 \& $HDB\->users\->select(\*(Aqname == joe\*(Aq); .Ve .PP Since the table is always the first argument, \s-1HDB\s0 will paste the fake method (table name) to the \s-1CMD \s0(select) as the fisrt argument. .PP ** Note that the name of the table can't be a \s-1HDB\s0 method. .SS "\s-1USAGE\s0" .IX Subsection "USAGE" .Vb 7 \& my $HDB = HDB\->new( \& type => \*(Aqmysql\*(Aq , \& db => \*(Aqtest\*(Aq , \& user => \*(Aqjoe\*(Aq , \& pass => \*(Aq12345\*(Aq , \& id => \*(AqTEST\*(Aq ; \& ) ; \& \& ... \& \& HDB\->TEST\->select(users , \*(Aquser == joe\*(Aq); \& \& ... \& \& my $HDB = HDB\->TEST ; \& \& $HDB\->users\->update(\*(Aqname == joe\*(Aq,{name => \*(AqJeff\*(Aq}) ; \& \& ... or ... \& \& my $table_users = $HDB\->TABLE(users) ; \& $table_users\->update(\*(Aqname == joe\*(Aq,{name => \*(AqJeff\*(Aq}) ; \& \& ... or ... \& \& HDB\->TEST\->users\->update(\*(Aqname == joe\*(Aq,{name => \*(AqJeff\*(Aq}) ; \& \& ... .Ve .PP \&\fB** Dynamic access is used for global connections in \s-1HPL \s0(connections set in the config file: .conf.hpl).\fR .SH "HDB::Object \- Persistent Objects" .IX Header "HDB::Object - Persistent Objects" An automatic persistence framework was built over \s-1HDB,\s0 where is possible to create persistent classes in a easy and fast way. \s-1HDB\s0 was designed to handle any type of \s-1DB\s0 behind it, what extends the persistence framework to any \s-1DB\s0 that \s-1DBI\s0 can handle with standart \s-1SQL.\s0 .PP Take a look at HDB::Object. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1HDB::CMDS\s0, HDB::Encode, HDB::sqlite, HDB::mysql. .PP HDB::Object, \s-1HPL\s0. .SH "AUTHOR" .IX Header "AUTHOR" Graciliano M. P. <gm@virtuasites.com.br> .PP I will appreciate any type of feedback (include your opinions and/or suggestions). ;\-P .SH "COPYRIGHT" .IX Header "COPYRIGHT" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| ver. 1.4 |
Github
|
.
| PHP 8.3.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings