title: Getting bind or column index out of range in node sqlite DB insert functions
body: <p>Still a little new to Node but this is driving me nuts.  I have looked around but cannot find an existing answer that has helped me yet.  I know I'm missing something stupid I'm sure.  My elements appear to be mapping correctly.  I have triple checked my columns and my values.  I've even taken the SQL query from my debug session in Visual Studio code and run it directly in DBVis, no issues. But for some reason when I run this in Node I always get "Error: SQLITE_RANGE: bind or column index out of range".  Are there any known issues with mapping elements in node and SQLite Im unfamiliar with??  Im using the map function and sql function in other places and it seems to be working fine.  Just not here. </p>
  
  <p>Here is the relevant code.  </p>
  
  <pre><code>exports.createUserGoogle = createUserGoogle;
  function createUserGoogle(jsonObj, cb) {
      var sql = "Begin;"
      +"Insert into userGoogle (googleId,token,name,email,photoid) values ($googleid,$googleToken,$name,$email,$photoid);"
      +"Commit;";
  
      doSQL(sql, mapDataElements(jsonObj), cb);
  }
  </code></pre>
  
  <p>My mapping function</p>
  
  <pre><code>function mapDataElements(jsonObj) {
      dataObj = {};
  
      for (key in jsonObj) {
          dataObj['$' + key] = jsonObj[key];
      }
  
      console.log('mapDataElements: Mapped as:  ' + JSON.stringify(dataObj));
      return dataObj;
  }
  </code></pre>
  
  <p>My Standard SQL Promise function</p>
  
  <pre><code>function doSQL(sqlStr, bindings, cb) {
      var p = new Promise((resolve, reject) =&gt; {
          db.serialize(() =&gt; {
              db.run(sqlStr, bindings, (err) =&gt; {
                  if (err) {
                      console.log('SQL failed:  ' + JSON.stringify(bindings));
                      reject(err);
                  }
                  else {
                      console.log('SQL succeeded:  ' + sqlStr);
                      resolve();
                  }
              });
          });
      });
  
      p.then(
      (data) =&gt; {
          console.log('Doing callback');
          cb('success');
      },
      (err) =&gt; {
          cb(null, err);
      }
      );
  }
  </code></pre>
  
  <p>Also here are what my mapped elements look like (slightly edited for security):</p>
  
  <pre><code> mapDataElements: Mapped as:  {"$googleid":"mylongnumber","$googleToken":"myreallylongtokenvalue","$name":"My name","$email":"my.email@gmail.com","$photoid":1}
  </code></pre>
  
  <p>Any my table if it helps</p>
  
  <pre><code>CREATE TABLE userGoogle(
    pk_google INTEGER NOT NULL PRIMARY KEY,
    googleId TEXT,
    token  TEXT,
    name TEXT,
    email TEXT,
    photoid int,
    FOREIGN Key(photoid) References photo(pk_photo)
  );
  </code></pre>