Rex::C...nds::DB(3pm)

✨ NAME ✨

hi bestie, welcome to Rex::Commands::DB β€” aka Simple Database Access πŸ’– (the manual page itself goes by Rex::C...nds::DB(3pm), which got absolutely demolished by the truncation gremlins, but we move πŸŽ€)


🌸 DESCRIPTION 🌸

okay so this module hands you simple access to a database, no drama, no overthinking. currently select, delete, insert and update are supported β€” that's the whole squad πŸ’…

heads up bestie: Version <= 1.0: All these functions will not be reported. so if you're on something ancient, expect silence from the reporting side, no cap 😭

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the vibe, copy-paste girlies:

 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

Do a database action. that's it, that's the function β€” it's giving main character, honestly 🌈

watch it work:

 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",
        };

select, insert, update, delete β€” all four of them, slaying in one lil' verb πŸ’…βœ¨


so yeah. that's the whole page, you're certified πŸŽ€ this was User Contributed Perl Documentation for Rex::C...nds::DB(3pm), running on perl v5.40.1, dated 2025-10-03 β€” obsessed with her, fr fr πŸ’–πŸŒ±πŸ«Ά

πŸ“¦ where this page comes from