How many inserts can be done within one transaction in SQLite?

前端 未结 1 1597
渐次进展
渐次进展 2020-12-31 07:50

I\'m trying to insert a large amount of records (in the millions) into an SQLite database. The data is read in from a file stream (C++). If I begin a single transaction, per

相关标签:
1条回答
  • 2020-12-31 08:04

    I am able to insert 10 millions rows in a single transaction without a problem.

    My guesses:

    • you are inserting too much rows in a single statement and hitting Maximum Depth Of An Expression Tree limit. This can be switched off completely.
    • you are using overly long INSERTs without binding values and hitting Maximum Length Of An SQL Statement limit. In this case, use parameter binding.
    • it may be a bug in the library (are you checking every API return for error codes?)

    Check Limits In SQLite. It may help if you show how you prepare and execute INSERTs in the code.

    0 讨论(0)
提交回复
热议问题