title: My discord.js bot's sql doesn't/cant define a table from my sqlite3 db
body: <p>Been working on this for about 3 days now and everything I've tried hasn't worked. Yes my code is/probably is sloppy but it can't seem to get the table from the data.db I have.</p>
  <p>There is at least one table in there which has my userid and stuff, yet it definite it as undefined.</p>
  <pre><code>else{
          const pr1 = new Promise( useless =&gt; {
          sql.get(`SELECT * FROM data WHERE userid =&quot;${message.author.id}&quot;`)})
          .then(row =&gt; {
              if (!row) {
                  sql.run(&quot;INSERT INTO data (userid, rollsleft, registered) VALUES (?, ?, ?)&quot;, [message.author.id, 4, 1]);
                  db.close()
              }
          }).catch(error =&gt; {
              console.log(error)
              sql.run(&quot;CREATE TABLE IF NOT EXISTS data (userid INTEGER, rollsleft INTEGER, registered INTEGER)&quot;)
              .then(() =&gt; {
                  sql.run(&quot;INSERT INTO data (userid, rollsleft, registered) VALUES (?, ?, ?)&quot;, [message.author.id, 4, 1]);
                  db.close()
              });
          });
  </code></pre>
  <p>There is one error I do get.</p>
  <pre><code>Error: SQLITE_RANGE: column index out of range {errno: 25, code: 'SQLITE_RANGE', stack: 'Error: SQLITE_RANGE: column index out of range', message: 'SQLITE_RANGE: column index out of range'}
  </code></pre>