androidmads / SQLite2XL

Library to Convert SQLite to Excel and Vice-Versa
MIT License
166 stars 58 forks source link

table sqlite_sequence may not be dropped #25

Open elikf opened 4 years ago

elikf commented 4 years ago

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;
flxholle commented 4 years ago

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'

raheemadamboev commented 3 years ago

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