Rex::Commands::DB(3)
β¨ NAME β¨
okay bestie, this is Rex::Commands::DB(3) β the Simple Database Access module, from the User Contributed Perl Documentation. π
πΈ DESCRIPTION πΈ
This module gives you simple access to a database. Right now the supported actions are select, delete, insert, and update. slay.
heads up: Version <= 1.0 β all these functions will not be reported. π
π¦ SYNOPSIS π¦
use Rex::Commands::DB {
dsn => "DBI:mysql:database=test;host=dbhost",
user => "username",
password => "password",
};
task "list", sub {
my @data = db select => {
fields => "*",
from => "table",
where => "enabled=1",
};
db insert => "table", {
field1 => "value1",
field2 => "value2",
field3 => 5,
};
db update => "table", {
set => {
field1 => "newvalue",
field2 => "newvalue2",
},
where => "id=5",
};
db delete => "table", {
where => "id < 5",
};
};
π EXPORTED FUNCTIONS π
π db π
db does a database action. literally its whole job. π
my @data = db select => {
fields => "*",
from => "table",
where => "host='myhost'",
};
db insert => "table", {
field1 => "value1",
field2 => "value2",
field3 => 5,
};
db update => "table", {
set => {
field1 => "newvalue",
field2 => "newvalue2",
},
where => "id=5",
};
db delete => "table", {
where => "id < 5",
};
okay thatβs the whole vibe, bestie π«Ά this page is from perl v5.42.3, dated 2023-08-05, and itβs Rex::Commands::DB(3). mwah π
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms