SQLite2XL
SQLite2XL copied to clipboard
table sqlite_sequence may not be dropped
Expected behavior
Import data from excel to sqlite
Actual behavior
sending message :table sqlite_sequence may not be dropped(code 1):,while compiling:DROP TABLE IF EXISTS sqlite_sequence
Steps to reproduce the issue
String directory_path = Environment.getExternalStorageDirectory().getPath() + "/cashDesk.xls"; ExcelToSQLite excelToSQLite = new ExcelToSQLite(this, DBHelper.DATABASE_NAME, true); excelToSQLite.importFromFile(directory_path, new ExcelToSQLite.ImportListener() { @Override public void onStart() {
}
@Override
public void onCompleted(String dbName) {
Toast.makeText(getApplicationContext(), "خروجی بانک SqLite شما روی حافظه گوشی می باشد.", Toast.LENGTH_LONG).show();
}
@Override
public void onError(Exception e) {
Toast.makeText(getApplicationContext(), e.toString() + "عملیات موفقیت آمیز نبود!...", Toast.LENGTH_LONG).show();
}
});
break;
I created a fork, where this is fixed: https://github.com/asdoi/SQLite2XL
It has something to do with the backup, so all backups you did before won't work.
Just add it in your app-gradle file:
implementation 'com.github.asdoi:SQLite2XL:e1b5e4d1cb'
same issue
I think it need to import sqlite_sequence table for primary key auto increment correctly
after importing xls file with this library, room just inserts null for primary key auto increment fields