Rex::Commands::DB(3)

πŸ“¦ version 1.14.3, in nixos 26.05, nixpkgs unstable

✨ 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