diff --git a/docs/pages/docs/type_converters.md b/docs/pages/docs/type_converters.md index 4bf26b59a..6a13e0602 100644 --- a/docs/pages/docs/type_converters.md +++ b/docs/pages/docs/type_converters.md @@ -191,4 +191,4 @@ can be used instead - unlike `equals`, `equasValue` will apply the converter bef If you need to apply the converter for other comparisons as well, you can do that manually with `column.converter.toSql`. For variables used in queries that are part of a [drift file]({{'SQL API/drift_files.md'| pageUrl}}), type converters will be -applied by default if the `apply_converters_on_variables` [builder option]({{'Generation options/index.md'|pageUrl}}) is enabled (which it is by default). \ No newline at end of file +applied by default if the `apply_converters_on_variables` [builder option]({{'Generation options/index.md'|pageUrl}}) is enabled (which it is by default). diff --git a/examples/encryption/ios/Flutter/Debug.xcconfig b/examples/encryption/ios/Flutter/Debug.xcconfig index 592ceee85..ec97fc6f3 100644 --- a/examples/encryption/ios/Flutter/Debug.xcconfig +++ b/examples/encryption/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/examples/encryption/ios/Flutter/Release.xcconfig b/examples/encryption/ios/Flutter/Release.xcconfig index 592ceee85..c4855bfe2 100644 --- a/examples/encryption/ios/Flutter/Release.xcconfig +++ b/examples/encryption/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/examples/encryption/lib/database.dart b/examples/encryption/lib/database.dart index c8ca5205d..d2c90e855 100644 --- a/examples/encryption/lib/database.dart +++ b/examples/encryption/lib/database.dart @@ -37,7 +37,7 @@ QueryExecutor _openDatabase() { return LazyDatabase(() async { final path = await getApplicationDocumentsDirectory(); - return NativeDatabase( + return NativeDatabase.createInBackground( File(p.join(path.path, 'app.db.enc')), setup: (db) { // Check that we're actually running with SQLCipher by quering the diff --git a/examples/encryption/linux/flutter/generated_plugin_registrant.cc b/examples/encryption/linux/flutter/generated_plugin_registrant.cc index e71a16d23..17bd65366 100644 --- a/examples/encryption/linux/flutter/generated_plugin_registrant.cc +++ b/examples/encryption/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,10 @@ #include "generated_plugin_registrant.h" +#include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) sqlcipher_flutter_libs_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); + sqlite3_flutter_libs_plugin_register_with_registrar(sqlcipher_flutter_libs_registrar); } diff --git a/examples/encryption/linux/flutter/generated_plugins.cmake b/examples/encryption/linux/flutter/generated_plugins.cmake index 2e1de87a7..ef97daa30 100644 --- a/examples/encryption/linux/flutter/generated_plugins.cmake +++ b/examples/encryption/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + sqlcipher_flutter_libs ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/examples/encryption/macos/Flutter/Flutter-Debug.xcconfig b/examples/encryption/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b60..4b81f9b2d 100644 --- a/examples/encryption/macos/Flutter/Flutter-Debug.xcconfig +++ b/examples/encryption/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/examples/encryption/macos/Flutter/Flutter-Release.xcconfig b/examples/encryption/macos/Flutter/Flutter-Release.xcconfig index c2efd0b60..5caa9d157 100644 --- a/examples/encryption/macos/Flutter/Flutter-Release.xcconfig +++ b/examples/encryption/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/examples/encryption/macos/Flutter/GeneratedPluginRegistrant.swift b/examples/encryption/macos/Flutter/GeneratedPluginRegistrant.swift index c83a4a72c..c6512610d 100644 --- a/examples/encryption/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/examples/encryption/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,7 +5,7 @@ import FlutterMacOS import Foundation -import path_provider_macos +import path_provider_foundation import sqlcipher_flutter_libs func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { diff --git a/examples/encryption/macos/Podfile b/examples/encryption/macos/Podfile index dade8dfad..049abe295 100644 --- a/examples/encryption/macos/Podfile +++ b/examples/encryption/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/examples/encryption/macos/Podfile.lock b/examples/encryption/macos/Podfile.lock new file mode 100644 index 000000000..27388e309 --- /dev/null +++ b/examples/encryption/macos/Podfile.lock @@ -0,0 +1,40 @@ +PODS: + - FlutterMacOS (1.0.0) + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - SQLCipher (4.5.5): + - SQLCipher/standard (= 4.5.5) + - SQLCipher/common (4.5.5) + - SQLCipher/standard (4.5.5): + - SQLCipher/common + - sqlcipher_flutter_libs (0.0.1): + - FlutterMacOS + - SQLCipher (~> 4.5.5) + +DEPENDENCIES: + - FlutterMacOS (from `Flutter/ephemeral`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - sqlcipher_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlcipher_flutter_libs/macos`) + +SPEC REPOS: + trunk: + - SQLCipher + +EXTERNAL SOURCES: + FlutterMacOS: + :path: Flutter/ephemeral + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + sqlcipher_flutter_libs: + :path: Flutter/ephemeral/.symlinks/plugins/sqlcipher_flutter_libs/macos + +SPEC CHECKSUMS: + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + SQLCipher: f2e96b3822e3006b379181a0e4fd145f6de29b56 + sqlcipher_flutter_libs: 495715cf0af89eaa59ea14b5f67b183fc1a84a4e + +PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 + +COCOAPODS: 1.14.2 diff --git a/examples/encryption/macos/Runner.xcodeproj/project.pbxproj b/examples/encryption/macos/Runner.xcodeproj/project.pbxproj index 3ae84bfd5..9742ca85f 100644 --- a/examples/encryption/macos/Runner.xcodeproj/project.pbxproj +++ b/examples/encryption/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -26,6 +26,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 7FB029B83EF2912A7072061B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9BD515B696B2C4B2EAA7A09 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -54,7 +55,7 @@ /* Begin PBXFileReference section */ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* drift_encryption_sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "drift_encryption_sample.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* drift_encryption_sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = drift_encryption_sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -66,8 +67,12 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 73FC85D450EBEC6B0F38944C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + A603495C8B8FAFBF5D1CDDF3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + A9BD515B696B2C4B2EAA7A09 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F0C05EBCC5DD6E5ECD646FF5 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -75,6 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7FB029B83EF2912A7072061B /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -99,6 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, + E1FE735B453D11867D73754E /* Pods */, ); sourceTree = ""; }; @@ -148,10 +155,22 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( + A9BD515B696B2C4B2EAA7A09 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; + E1FE735B453D11867D73754E /* Pods */ = { + isa = PBXGroup; + children = ( + 73FC85D450EBEC6B0F38944C /* Pods-Runner.debug.xcconfig */, + A603495C8B8FAFBF5D1CDDF3 /* Pods-Runner.release.xcconfig */, + F0C05EBCC5DD6E5ECD646FF5 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -159,11 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 2DE482FFA06687B00EC442CE /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, + 43758BE2F68CB1218E424845 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -182,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -233,8 +254,31 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 2DE482FFA06687B00EC442CE /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -270,6 +314,23 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; + 43758BE2F68CB1218E424845 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -344,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -423,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -470,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/examples/encryption/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/examples/encryption/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index f25d60994..af6b084fc 100644 --- a/examples/encryption/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/examples/encryption/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + diff --git a/examples/encryption/windows/flutter/generated_plugin_registrant.cc b/examples/encryption/windows/flutter/generated_plugin_registrant.cc index 8b6d4680a..9ac5ff292 100644 --- a/examples/encryption/windows/flutter/generated_plugin_registrant.cc +++ b/examples/encryption/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + Sqlite3FlutterLibsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); } diff --git a/examples/encryption/windows/flutter/generated_plugins.cmake b/examples/encryption/windows/flutter/generated_plugins.cmake index b93c4c30c..16daafa41 100644 --- a/examples/encryption/windows/flutter/generated_plugins.cmake +++ b/examples/encryption/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + sqlcipher_flutter_libs ) list(APPEND FLUTTER_FFI_PLUGIN_LIST