Issue Feature Rejected

#83020QueryBuilder needs CREATE TABLE, INSERT and DROP TABLE

Johannes C. Schulz 11/17/17, 08:35 updated 03/16/20, 20:58

Description

Sometimes it’s necessary to dynamically create or drop tables inside an extension or module. For example if you would like to create a backup-table of “pages”, before doing some stuff with it.

As I write this, QueryBuilder isn’t able to do this. It would be really great, if you can add those methods!

I would like to do things like

public function backupDatabaseTablePages(){
        $query = "DROP TABLE `pages_backup`;";
        $this->db->sql_query($query);
        $query = "CREATE TABLE pages_backup LIKE pages;";
        $this->db->sql_query($query);
        $query = "INSERT INTO pages_backup SELECT * FROM pages;";
        $this->db->sql_query($query);
    }

Thanks a lot
Johannes

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.