# dummy

    Code
      # dummy

# dm_sql()

    Code
      dm_for_filter_df() %>% dm_sql(my_test_con())
    Output
      $pre
      $pre$tf_1
      <SQL> CREATE TEMPORARY TABLE `tf_1` (
        `a` INT AUTO_INCREMENT,
        `b` VARCHAR(255),
        PRIMARY KEY (`a`)
      )
      
      $pre$tf_2
      <SQL> CREATE TEMPORARY TABLE `tf_2` (
        `c` VARCHAR(255),
        `d` INT,
        `e` VARCHAR(255),
        `e1` INT,
        PRIMARY KEY (`c`)
      )
      
      $pre$tf_3
      <SQL> CREATE TEMPORARY TABLE `tf_3` (
        `f` VARCHAR(255),
        `f1` INT,
        `g` VARCHAR(255),
        PRIMARY KEY (`f`, `f1`)
      )
      
      $pre$tf_4
      <SQL> CREATE TEMPORARY TABLE `tf_4` (
        `h` VARCHAR(255),
        `i` VARCHAR(255),
        `j` VARCHAR(255),
        `j1` INT,
        PRIMARY KEY (`h`)
      )
      
      $pre$tf_5
      <SQL> CREATE TEMPORARY TABLE `tf_5` (
        `ww` INT,
        `k` INT,
        `l` VARCHAR(255),
        `m` VARCHAR(255),
        PRIMARY KEY (`k`)
      )
      
      $pre$tf_6
      <SQL> CREATE TEMPORARY TABLE `tf_6` (
        `zz` INT,
        `n` VARCHAR(255),
        `o` VARCHAR(255),
        PRIMARY KEY (`o`)
      )
      
      
      $load
      $load$tf_1
      <SQL> INSERT INTO `tf_1` (`a`, `b`)
      SELECT `a`, CAST(`b` AS CHAR) AS `b`
      FROM (
        (
          SELECT NULL AS `a`, NULL AS `b`
          WHERE (0 = 1)
        )
        UNION ALL
        (
        VALUES
          (1, 'A'),
          (2, 'B'),
          (3, 'C'),
          (4, 'D'),
          (5, 'E'),
          (6, 'F'),
          (7, 'G'),
          (8, 'H'),
          (9, 'I'),
          (10, 'J')
        )
      ) `values_table`
      
      $load$tf_2
      <SQL> INSERT INTO `tf_2` (`c`, `d`, `e`, `e1`)
      SELECT
        CAST(`c` AS CHAR) AS `c`,
        `d`,
        CAST(`e` AS CHAR) AS `e`,
        `e1`
      FROM (
        (
          SELECT NULL AS `c`, NULL AS `d`, NULL AS `e`, NULL AS `e1`
          WHERE (0 = 1)
        )
        UNION ALL
        (
        VALUES
          ('cat', 7, 'F', 6),
          ('dog', 6, 'E', 5),
          ('elephant', 2, 'D', 4),
          ('lion', 3, 'E', 5),
          ('seal', 4, 'F', 6),
          ('worm', 5, 'G', 7)
        )
      ) `values_table`
      
      $load$tf_3
      <SQL> INSERT INTO `tf_3` (`f`, `f1`, `g`)
      SELECT
        CAST(`f` AS CHAR) AS `f`,
        `f1`,
        CAST(`g` AS CHAR) AS `g`
      FROM (
        (
          SELECT NULL AS `f`, NULL AS `f1`, NULL AS `g`
          WHERE (0 = 1)
        )
        UNION ALL
        (
        VALUES
          ('C', 2, 'one'),
          ('C', 3, 'two'),
          ('D', 4, 'three'),
          ('E', 5, 'four'),
          ('F', 6, 'five'),
          ('G', 7, 'six'),
          ('H', 7, 'seven'),
          ('I', 7, 'eight'),
          ('J', 10, 'nine'),
          ('K', 11, 'ten')
        )
      ) `values_table`
      
      $load$tf_4
      <SQL> INSERT INTO `tf_4` (`h`, `i`, `j`, `j1`)
      SELECT
        CAST(`h` AS CHAR) AS `h`,
        CAST(`i` AS CHAR) AS `i`,
        CAST(`j` AS CHAR) AS `j`,
        `j1`
      FROM (
        (
          SELECT NULL AS `h`, NULL AS `i`, NULL AS `j`, NULL AS `j1`
          WHERE (0 = 1)
        )
        UNION ALL
        (
        VALUES
          ('a', 'three', 'C', 3),
          ('b', 'four', 'D', 4),
          ('c', 'five', 'E', 5),
          ('d', 'six', 'F', 6),
          ('e', 'seven', 'F', 6)
        )
      ) `values_table`
      
      $load$tf_5
      <SQL> INSERT INTO `tf_5` (`ww`, `k`, `l`, `m`)
      SELECT
        `ww`,
        `k`,
        CAST(`l` AS CHAR) AS `l`,
        CAST(`m` AS CHAR) AS `m`
      FROM (
        (
          SELECT NULL AS `ww`, NULL AS `k`, NULL AS `l`, NULL AS `m`
          WHERE (0 = 1)
        )
        UNION ALL
        (
        VALUES
          (2, 1, 'b', 'house'),
          (2, 2, 'c', 'tree'),
          (2, 3, 'd', 'streetlamp'),
          (2, 4, 'e', 'streetlamp')
        )
      ) `values_table`
      
      $load$tf_6
      <SQL> INSERT INTO `tf_6` (`zz`, `n`, `o`)
      SELECT
        `zz`,
        CAST(`n` AS CHAR) AS `n`,
        CAST(`o` AS CHAR) AS `o`
      FROM (
        (
          SELECT NULL AS `zz`, NULL AS `n`, NULL AS `o`
          WHERE (0 = 1)
        )
        UNION ALL
        (
        VALUES
          (1, 'garden', 'i'),
          (1, 'hill', 'g'),
          (1, 'house', 'e'),
          (1, 'streetlamp', 'h'),
          (1, 'tree', 'f')
        )
      ) `values_table`
      
      
      $post
      $post$uk
      $post$uk$tf_1
      <SQL> ALTER TABLE `tf_1` ADD UNIQUE (`a`)
      
      $post$uk$tf_2
      <SQL> ALTER TABLE `tf_2` ADD UNIQUE (`c`)
      
      $post$uk$tf_3
      <SQL> ALTER TABLE `tf_3` ADD UNIQUE (`f`, `f1`)
      <SQL> ALTER TABLE `tf_3` ADD UNIQUE (`g`)
      
      $post$uk$tf_4
      <SQL> ALTER TABLE `tf_4` ADD UNIQUE (`h`)
      
      $post$uk$tf_5
      <SQL> ALTER TABLE `tf_5` ADD UNIQUE (`k`)
      
      $post$uk$tf_6
      <SQL> ALTER TABLE `tf_6` ADD UNIQUE (`o`)
      <SQL> ALTER TABLE `tf_6` ADD UNIQUE (`n`)
      
      
      $post$fk
      named list()
      
      $post$indexes
      $post$indexes$tf_2
      <SQL> CREATE INDEX tf_2__d ON `tf_2` (`d`)
      <SQL> CREATE INDEX tf_2__e_e1 ON `tf_2` (`e`, `e1`)
      
      $post$indexes$tf_4
      <SQL> CREATE INDEX tf_4__j_j1 ON `tf_4` (`j`, `j1`)
      
      $post$indexes$tf_5
      <SQL> CREATE INDEX tf_5__l ON `tf_5` (`l`)
      <SQL> CREATE INDEX tf_5__m ON `tf_5` (`m`)
      
      
      

