Skip to content

Big Initial Insert of Data: Are there any things one would need to watch out for? #515

Answered by jepiqueau
folsze asked this question in Q&A
Discussion options

You must be logged in to vote

@folsze There is 3 ways of using transaction

  • default
  const testTransactionDefault = async (db: SQLiteDBConnection) => {
    setLog(prevLog => prevLog + '### Start Transaction Default ###\n');

    if (db !== null) {
      // Delete all data if any
      await db.execute('DELETE FROM DemoTable');

      // run command
      let insertQuery = 'INSERT INTO DemoTable (name, score) VALUES (?, ?);';
      let bindValues = ["Sue", 102];
      let ret = await db.run(insertQuery, bindValues);
      console.log(`>>> run ret 1: ${JSON.stringify(ret)}`)
      // execute command
      const statements = `
        INSERT INTO DemoTable (name, score) VALUES ('Andrew',415);
        INSERT INTO DemoTa…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jepiqueau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants