Upgrading sqflite 0.13 to 1
Breaking0.13.0+1 → 1.3.2+4Breaking2Platform2Deprecated1New4Changed8Fixed13Other6
BreakingUpgrade verdict
2 breaking changes and 2 platform requirement changes.
In plain terms
- Two old methods, applyBatch and apply, are gone, so code that still calls them will no longer compile.
- Android apps that use this plugin must switch from the old Android Support Library to AndroidX. The plugin's own code does not change, so behavior should stay the same.
- The package now works with the newer Android plugin setup that Flutter apps use.
- Building for iOS and MacOS can now reuse previous build output instead of rebuilding everything.
Must act 5 items need code or config changes
Dart SDK requirement changed in 1.3.2-dev.1: >=2.0.0 <3.0.0 → >=2.10.2 <3.0.0.
Requires Flutter >=1.22.2 from 1.3.2+4 (none stated before).
What you must change
Breaking2
Removes the deprecated applyBatch and apply APIs.
applyBatchapplyMigrates from the deprecated Android Support Library to AndroidX, requiring Android apps using the plugin to also migrate.
Platform2
Supports Android embedding v2.
Supports iOS and MacOS incremental builds.
Deprecations to plan for
Deprecated1
Deprecates SqfliteOptions, which is only used internally.
SqfliteOptionsAPI changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
class Batch: abstract - removed:
class Database: abstract implements DatabaseExecutor - removed:
class DatabaseException: abstract implements Exception - removed:
class DatabaseExecutor: abstract - removed:
class DatabaseFactory: abstract - removed:
class OpenDatabaseOptions: abstract - removed:
class SqfliteOptions - removed:
class Transaction: abstract implements DatabaseExecutor - removed:
ctor DatabaseException(this._message) - removed:
ctor OpenDatabaseOptions( {int version, OnDatabaseConfigureFn onConfigure, OnDatabaseCreateFn onCreate, OnDatabaseVersionChangeFn onUpgrade, OnDatabaseVersionChangeFn onDowngrade, OnDatabaseOpenFn onOpen, bool readOnly = …, bool singleInstance = …}) - removed:
enum ConflictAlgorithm - removed:
field OpenDatabaseOptions.onConfigure: OnDatabaseConfigureFn - removed:
field OpenDatabaseOptions.onCreate: OnDatabaseCreateFn - removed:
field OpenDatabaseOptions.onDowngrade: OnDatabaseVersionChangeFn - removed:
field OpenDatabaseOptions.onOpen: OnDatabaseOpenFn - removed:
field OpenDatabaseOptions.onUpgrade: OnDatabaseVersionChangeFn - removed:
field OpenDatabaseOptions.readOnly: bool - removed:
field OpenDatabaseOptions.singleInstance: bool - removed:
field OpenDatabaseOptions.version: int - removed:
field SqfliteOptions.queryAsMapList: bool - removed:
function onDatabaseVersionChangeError( Database db, int oldVersion, int newVersion): Future<void> - removed:
get Database.isOpen: bool - removed:
get Database.path: String - removed:
member ConflictAlgorithm.abort - removed:
member ConflictAlgorithm.fail - removed:
member ConflictAlgorithm.ignore - removed:
member ConflictAlgorithm.replace - removed:
member ConflictAlgorithm.rollback - removed:
method Batch.apply( {bool exclusive, bool noResult, bool continueOnError}): Future<List<dynamic>> - removed:
method Batch.commit( {bool exclusive, bool noResult, bool continueOnError}): Future<List<dynamic>> - removed:
method Batch.delete(String table, {String where, List<dynamic> whereArgs}): void - removed:
method Batch.execute(String sql, [List<dynamic> arguments]): void - removed:
method Batch.insert(String table, Map<String, dynamic> values, {String nullColumnHack, ConflictAlgorithm conflictAlgorithm}): void - removed:
method Batch.query(String table, {bool distinct, List<String> columns, String where, List<dynamic> whereArgs, String groupBy, String having, String orderBy, int limit, int offset}): void - removed:
method Batch.rawDelete(String sql, [List<dynamic> arguments]): void - removed:
method Batch.rawInsert(String sql, [List<dynamic> arguments]): void - removed:
method Batch.rawQuery(String sql, [List<dynamic> arguments]): void - removed:
method Batch.rawUpdate(String sql, [List<dynamic> arguments]): void - removed:
method Batch.update(String table, Map<String, dynamic> values, {String where, List<dynamic> whereArgs, ConflictAlgorithm conflictAlgorithm}): void - removed:
method Database.close(): Future<void> - removed:
method Database.devInvokeMethod<T>(String method, [dynamic arguments]): Future<T> - removed:
method Database.devInvokeSqlMethod<T>(String method, String sql, [List<dynamic> arguments]): Future<T> - removed:
method Database.getVersion(): Future<int> - removed:
method Database.setVersion(int version): Future<void> - removed:
method Database.transaction<T>(Future<T> action(Transaction txn), {bool exclusive}): Future<T> - removed:
method DatabaseException.isDatabaseClosedError(): bool - removed:
method DatabaseException.isNoSuchTableError([String table]): bool - removed:
method DatabaseException.isOpenFailedError(): bool - removed:
method DatabaseException.isReadOnlyError(): bool - removed:
method DatabaseException.isSyntaxError(): bool - removed:
method DatabaseException.isUniqueConstraintError([String field]): bool - removed:
method DatabaseException.toString(): String - removed:
method DatabaseExecutor.applyBatch(Batch batch, {bool noResult}): Future<List<dynamic>> - removed:
method DatabaseExecutor.batch(): Batch - removed:
method DatabaseExecutor.delete(String table, {String where, List<dynamic> whereArgs}): Future<int> - removed:
method DatabaseExecutor.execute(String sql, [List<dynamic> arguments]): Future<void> - removed:
method DatabaseExecutor.insert(String table, Map<String, dynamic> values, {String nullColumnHack, ConflictAlgorithm conflictAlgorithm}): Future<int> - removed:
method DatabaseExecutor.query(String table, {bool distinct, List<String> columns, String where, List<dynamic> whereArgs, String groupBy, String having, String orderBy, int limit, int offset}): Future<List<Map<String, dynamic>>> - removed:
method DatabaseExecutor.rawDelete(String sql, [List<dynamic> arguments]): Future<int> - removed:
method DatabaseExecutor.rawInsert(String sql, [List<dynamic> arguments]): Future<int> - removed:
method DatabaseExecutor.rawQuery(String sql, [List<dynamic> arguments]): Future<List<Map<String, dynamic>>> - removed:
method DatabaseExecutor.rawUpdate(String sql, [List<dynamic> arguments]): Future<int> - removed:
method DatabaseExecutor.update(String table, Map<String, dynamic> values, {String where, List<dynamic> whereArgs, ConflictAlgorithm conflictAlgorithm}): Future<int> - removed:
method DatabaseFactory.databaseExists(String path): Future<bool> - removed:
method DatabaseFactory.deleteDatabase(String path): Future<void> - removed:
method DatabaseFactory.getDatabasesPath(): Future<String> - removed:
method DatabaseFactory.openDatabase(String path, {OpenDatabaseOptions options}): Future<Database> - removed:
method SqfliteOptions.fromMap(Map<String, dynamic> map): void - removed:
method SqfliteOptions.toMap(): Map<String, dynamic> - removed:
static get Sqflite.platformVersion: Future<String> - removed:
typedef FutureOr<void> OnDatabaseConfigureFn(Database db) - removed:
typedef FutureOr<void> OnDatabaseCreateFn(Database db, int version) - removed:
typedef FutureOr<void> OnDatabaseOpenFn(Database db) - removed:
typedef FutureOr<void> OnDatabaseVersionChangeFn( Database db, int oldVersion, int newVersion) - removed:
variable inMemoryDatabasePath: const String - removed:
variable onDatabaseDowngradeDelete: final OnDatabaseVersionChangeFn - changed:
static method Sqflite.setLockWarningInfo({Duration duration, void callback()}): void → static method Sqflite.setLockWarningInfo( {Duration duration, void Function() callback}): void - added:
function databaseExists(String path): Future<bool> - added:
set databaseFactory(DatabaseFactory databaseFactory)
- added:
function setMockDatabaseFactory(DatabaseFactory factory): void
- removed:
enum ConflictAlgorithm - removed:
function escapeName(String name): String - removed:
function unescapeName(String name): String - removed:
member ConflictAlgorithm.abort - removed:
member ConflictAlgorithm.fail - removed:
member ConflictAlgorithm.ignore - removed:
member ConflictAlgorithm.replace - removed:
member ConflictAlgorithm.rollback