fcf.module({
  name: "fcf:tests/NFSQL/DB.UpdateJoin.js",
  dependencies: ["fcf:NTest/uniTest.js", "fcf:tests/NFSQL/Helpers/Helper.js"],
  module: function(uniTest, Helper) {
    uniTest.add("FSQL DB" , "DB Update Join", function(a_tester) {

      Helper.query(
        a_tester, { query: "UPDATE fcftest_single_types_update2 SET str2 = ${1}, join_str = ${2}, join_text=${3} WHERE id = ${4}",
                    args: ["test", "joinstr_test", "joinstr_text", 1]},
        function(a_records){
        }
      );
      Helper.query(
        a_tester, { query: "SELECT str2, join_str, join_text FROM fcftest_single_types_update2 WHERE id = ${1}", args: [1]},
        function(a_records){
          uniTest.equal(
            a_records,
            [[{
              str2: 'test',
              join_str: 'joinstr_test',
              join_text: 'joinstr_text',
              "@key": 1,
            }]]
          )

        }
      );
      Helper.query(
        a_tester, { query: "UPDATE fcftest_single_types_update2 SET str2 = ${1}, join_str = ${2}, join_text=${3} WHERE id = ${4}",
                    args: ["value1", "value2", "value3", 1]},
        function(a_records){
        }
      );
      Helper.query(
        a_tester, { query: "SELECT str2, join_str, join_text FROM fcftest_single_types_update2 WHERE id = ${1}", args: [1]},
        function(a_records){
          uniTest.equal(
            a_records,
            [[{
              str2: 'value1',
              join_str: 'value2',
              join_text: 'value3',
              "@key": 1,
            }]]
          )

        }
      );

    });
  }
});
