From b5bb92459d18a6a5b9c6533174fed5db835b9b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 10 Aug 2016 06:27:50 +0200 Subject: [PATCH 01/14] WatchOS framework (adresses #96) --- GRDB.xcodeproj/project.pbxproj | 205 ++++++++++++++++++ .../xcschemes/GRDBWatchOS.xcscheme | 80 +++++++ GRDB/Core/Configuration.swift | 6 + GRDB/Core/Database.swift | 6 + GRDB/Core/DatabaseError.swift | 6 + GRDB/Core/DatabasePool.swift | 6 + GRDB/Core/DatabaseReader.swift | 6 + GRDB/Core/DatabaseValue.swift | 6 + GRDB/Core/Row.swift | 6 + GRDB/Core/RowAdapter.swift | 6 + GRDB/Core/Statement.swift | 6 + GRDB/Core/StatementColumnConvertible.swift | 6 + .../StandardLibrary/StandardLibrary.swift | 6 + GRDB/Core/Utils.swift | 6 + GRDB/Migrations/Migration.swift | 6 + GRDB/QueryInterface/SQLSelectQuery.swift | 6 + GRDB/Record/TableMapping.swift | 6 + Support/module.modulemap | 10 + Tests/Private/NSDataMemoryTests.swift | 6 + ...StatementColumnConvertibleFetchTests.swift | 6 + 20 files changed, 397 insertions(+) create mode 100644 GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index d85fd0dcc..2e62adbfe 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -285,6 +285,56 @@ 565049051CE32543000A97D8 /* FetchedRecordsControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 565049041CE32543000A97D8 /* FetchedRecordsControllerTests.swift */; }; 565049061CE32543000A97D8 /* FetchedRecordsControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 565049041CE32543000A97D8 /* FetchedRecordsControllerTests.swift */; }; 565049071CE32543000A97D8 /* FetchedRecordsControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 565049041CE32543000A97D8 /* FetchedRecordsControllerTests.swift */; }; + 565490B41D5A4820005622CB /* GRDB.h in Headers */ = {isa = PBXBuildFile; fileRef = DC3773F819C8CBB3004FCF85 /* GRDB.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 565490B51D5A4827005622CB /* GRDB-Bridging.h in Headers */ = {isa = PBXBuildFile; fileRef = DC2393C61ABE35F8003FF113 /* GRDB-Bridging.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 565490B61D5AE236005622CB /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238701B9C75030082EB20 /* Configuration.swift */; }; + 565490B71D5AE236005622CB /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238711B9C75030082EB20 /* Database.swift */; }; + 565490B81D5AE236005622CB /* DatabaseError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238731B9C75030082EB20 /* DatabaseError.swift */; }; + 565490B91D5AE236005622CB /* DatabasePool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560A37A31C8F625000949E71 /* DatabasePool.swift */; }; + 565490BA1D5AE236005622CB /* DatabaseQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238741B9C75030082EB20 /* DatabaseQueue.swift */; }; + 565490BB1D5AE236005622CB /* DatabaseReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563363BF1C942C04000BE133 /* DatabaseReader.swift */; }; + 565490BC1D5AE236005622CB /* DatabaseSchemaCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5695311E1C907A8C00CF1A2B /* DatabaseSchemaCache.swift */; }; + 565490BD1D5AE236005622CB /* DatabaseStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563363D71C95787F000BE133 /* DatabaseStore.swift */; }; + 565490BE1D5AE236005622CB /* DatabaseValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238751B9C75030082EB20 /* DatabaseValue.swift */; }; + 565490BF1D5AE236005622CB /* DatabaseValueConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */; }; + 565490C01D5AE236005622CB /* DatabaseWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563363C31C942C37000BE133 /* DatabaseWriter.swift */; }; + 565490C11D5AE236005622CB /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; + 565490C21D5AE236005622CB /* Row.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238761B9C75030082EB20 /* Row.swift */; }; + 565490C31D5AE236005622CB /* RowAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567404871CEF84C8003ED5CC /* RowAdapter.swift */; }; + 565490C41D5AE236005622CB /* SchedulingWatchdog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */; }; + 565490C51D5AE236005622CB /* SerializedDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560A37A61C8FF6E500949E71 /* SerializedDatabase.swift */; }; + 565490C61D5AE236005622CB /* Statement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238781B9C75030082EB20 /* Statement.swift */; }; + 565490C71D5AE236005622CB /* StatementColumnConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560D923F1C672C3E00F4F92B /* StatementColumnConvertible.swift */; }; + 565490C81D5AE252005622CB /* CGFloat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1491C672E4000235C62 /* CGFloat.swift */; }; + 565490C91D5AE252005622CB /* DatabaseCoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F14B1C672E4000235C62 /* DatabaseCoder.swift */; }; + 565490CA1D5AE252005622CB /* DatabaseDateComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F14C1C672E4000235C62 /* DatabaseDateComponents.swift */; }; + 565490CB1D5AE252005622CB /* DatabaseValue+Foundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F14D1C672E4000235C62 /* DatabaseValue+Foundation.swift */; }; + 565490CC1D5AE252005622CB /* NSData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F14E1C672E4000235C62 /* NSData.swift */; }; + 565490CD1D5AE252005622CB /* NSDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F14F1C672E4000235C62 /* NSDate.swift */; }; + 565490CE1D5AE252005622CB /* NSNull.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1501C672E4000235C62 /* NSNull.swift */; }; + 565490CF1D5AE252005622CB /* NSNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1511C672E4000235C62 /* NSNumber.swift */; }; + 565490D01D5AE252005622CB /* NSString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1521C672E4000235C62 /* NSString.swift */; }; + 565490D11D5AE252005622CB /* NSURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1531C672E4000235C62 /* NSURL.swift */; }; + 565490D21D5AE252005622CB /* NSUUID.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563ABAF61D18824F003B37F3 /* NSUUID.swift */; }; + 565490D31D5AE252005622CB /* Row+Foundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1541C672E4000235C62 /* Row+Foundation.swift */; }; + 565490D41D5AE252005622CB /* StatementArguments+Foundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1551C672E4000235C62 /* StatementArguments+Foundation.swift */; }; + 565490D51D5AE252005622CB /* RawRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1571C672E4000235C62 /* RawRepresentable.swift */; }; + 565490D61D5AE252005622CB /* StandardLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1581C672E4000235C62 /* StandardLibrary.swift */; }; + 565490D71D5AE252005622CB /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563445041C4A7FD7003D3DC6 /* Utils.swift */; }; + 565490D81D5AE252005622CB /* DatabaseMigrator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238921B9C750B0082EB20 /* DatabaseMigrator.swift */; }; + 565490D91D5AE252005622CB /* Migration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B7F4391BEB42D500E39BBF /* Migration.swift */; }; + 565490DA1D5AE252005622CB /* QueryInterfaceRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56300B6F1C53F592005A543B /* QueryInterfaceRequest.swift */; }; + 565490DB1D5AE252005622CB /* SQLCollation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1891C6B1A8700235C62 /* SQLCollation.swift */; }; + 565490DC1D5AE252005622CB /* SQLFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F18A1C6B1A8700235C62 /* SQLFunction.swift */; }; + 565490DD1D5AE252005622CB /* SQLOperator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F18B1C6B1A8700235C62 /* SQLOperator.swift */; }; + 565490DE1D5AE252005622CB /* SQLSelectQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F18C1C6B1A8700235C62 /* SQLSelectQuery.swift */; }; + 565490DF1D5AE252005622CB /* SQLTableBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 566AD8B11D5318F4002EC1A8 /* SQLTableBuilder.swift */; }; + 565490E01D5AE252005622CB /* FetchedRecordsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31A7787C1C6A4DD600F507F6 /* FetchedRecordsController.swift */; }; + 565490E11D5AE252005622CB /* Persistable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560D92441C672C4B00F4F92B /* Persistable.swift */; }; + 565490E21D5AE252005622CB /* Record.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56A238A11B9C753B0082EB20 /* Record.swift */; }; + 565490E31D5AE252005622CB /* RowConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560D92451C672C4B00F4F92B /* RowConvertible.swift */; }; + 565490E41D5AE252005622CB /* TableMapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560D92461C672C4B00F4F92B /* TableMapping.swift */; }; + 565490E61D5AE282005622CB /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 565490E51D5AE282005622CB /* libsqlite3.tbd */; }; 56553C101C3E906C00522B5C /* GRDBTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5623E0901B4AFACC00B20B7F /* GRDBTestCase.swift */; }; 56553C121C3E906C00522B5C /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 56BB86301BA98AB0001F9168 /* libsqlite3.tbd */; }; 56553C131C3E906C00522B5C /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC3773F319C8CBB3004FCF85 /* GRDB.framework */; }; @@ -1391,6 +1441,8 @@ 56494C211D422BAE00529CB4 /* SQLExpressionLiteralTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLExpressionLiteralTests.swift; sourceTree = ""; }; 564A50C61BFF4B7F00B3A3A2 /* CollationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollationTests.swift; sourceTree = ""; }; 565049041CE32543000A97D8 /* FetchedRecordsControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchedRecordsControllerTests.swift; sourceTree = ""; }; + 565490A01D5A4798005622CB /* GRDB.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GRDB.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 565490E51D5AE282005622CB /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS2.2.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; }; 56553C181C3E906C00522B5C /* GRDBOSXCrashTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBOSXCrashTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 565B0FEE1BBC7D980098DE03 /* RowConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowConvertibleTests.swift; sourceTree = ""; }; 565D5D701BBC694D00DC9BD4 /* Row+FoundationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Row+FoundationTests.swift"; sourceTree = ""; }; @@ -1580,6 +1632,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 5654909C1D5A4798005622CB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 565490E61D5AE282005622CB /* libsqlite3.tbd in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 56553C111C3E906C00522B5C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2260,6 +2320,7 @@ DC3773E919C8CBB3004FCF85 = { isa = PBXGroup; children = ( + 565490E51D5AE282005622CB /* libsqlite3.tbd */, 56DBEC341C19A0020093A2EE /* CHANGELOG.md */, DC37744719C8F50B004FCF85 /* README.md */, 56E1524B1B43FD5B00EE27AA /* TODO.md */, @@ -2293,6 +2354,7 @@ F3BA80411CFB2AD7003DC1BA /* GRDBCustomSQLiteiOSTests.xctest */, F3BA805A1CFB2BB2003DC1BA /* GRDBCustomSQLite.framework */, F3BA809B1CFB2F6F003DC1BA /* GRDBCustomSQLiteOSXTests.xctest */, + 565490A01D5A4798005622CB /* GRDB.framework */, ); name = Products; sourceTree = ""; @@ -2378,6 +2440,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 5654909D1D5A4798005622CB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 565490B41D5A4820005622CB /* GRDB.h in Headers */, + 565490B51D5A4827005622CB /* GRDB-Bridging.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 56AFCA1C1CB1A8BB00F48B96 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -2488,6 +2559,24 @@ productReference = 560FC5B01CB00B880014AA8E /* GRDBTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 5654909F1D5A4798005622CB /* GRDBWatchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 565490B31D5A4798005622CB /* Build configuration list for PBXNativeTarget "GRDBWatchOS" */; + buildPhases = ( + 5654909B1D5A4798005622CB /* Sources */, + 5654909C1D5A4798005622CB /* Frameworks */, + 5654909D1D5A4798005622CB /* Headers */, + 5654909E1D5A4798005622CB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GRDBWatchOS; + productName = GRDBWatchOS; + productReference = 565490A01D5A4798005622CB /* GRDB.framework */; + productType = "com.apple.product-type.framework"; + }; 56553BDA1C3E906C00522B5C /* GRDBOSXCrashTests */ = { isa = PBXNativeTarget; buildConfigurationList = 56553C151C3E906C00522B5C /* Build configuration list for PBXNativeTarget "GRDBOSXCrashTests" */; @@ -2737,6 +2826,9 @@ LastUpgradeCheck = 0710; ORGANIZATIONNAME = "Gwendal Roué"; TargetAttributes = { + 5654909F1D5A4798005622CB = { + CreatedOnToolsVersion = 7.3.1; + }; 56E5D7C91B4D3FED00430942 = { CreatedOnToolsVersion = 7.0; }; @@ -2806,6 +2898,7 @@ 56AFCA841CB1ABC800F48B96 /* GRDBCipheriOSEncryptedTests */, F3BA7FFD1CFB25E4003DC1BA /* GRDBCustomSQLiteiOS */, F3BA80401CFB2AD7003DC1BA /* GRDBCustomSQLiteiOSTests */, + 5654909F1D5A4798005622CB /* GRDBWatchOS */, ); }; /* End PBXProject section */ @@ -2930,6 +3023,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 5654909E1D5A4798005622CB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 56553C141C3E906C00522B5C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -3242,6 +3342,60 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 5654909B1D5A4798005622CB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 565490CE1D5AE252005622CB /* NSNull.swift in Sources */, + 565490E41D5AE252005622CB /* TableMapping.swift in Sources */, + 565490CF1D5AE252005622CB /* NSNumber.swift in Sources */, + 565490E21D5AE252005622CB /* Record.swift in Sources */, + 565490C11D5AE236005622CB /* FetchRequest.swift in Sources */, + 565490BD1D5AE236005622CB /* DatabaseStore.swift in Sources */, + 565490B91D5AE236005622CB /* DatabasePool.swift in Sources */, + 565490D81D5AE252005622CB /* DatabaseMigrator.swift in Sources */, + 565490C21D5AE236005622CB /* Row.swift in Sources */, + 565490C71D5AE236005622CB /* StatementColumnConvertible.swift in Sources */, + 565490D91D5AE252005622CB /* Migration.swift in Sources */, + 565490D51D5AE252005622CB /* RawRepresentable.swift in Sources */, + 565490C51D5AE236005622CB /* SerializedDatabase.swift in Sources */, + 565490D71D5AE252005622CB /* Utils.swift in Sources */, + 565490BF1D5AE236005622CB /* DatabaseValueConvertible.swift in Sources */, + 565490BB1D5AE236005622CB /* DatabaseReader.swift in Sources */, + 565490C91D5AE252005622CB /* DatabaseCoder.swift in Sources */, + 565490C31D5AE236005622CB /* RowAdapter.swift in Sources */, + 565490DD1D5AE252005622CB /* SQLOperator.swift in Sources */, + 565490DA1D5AE252005622CB /* QueryInterfaceRequest.swift in Sources */, + 565490CA1D5AE252005622CB /* DatabaseDateComponents.swift in Sources */, + 565490D01D5AE252005622CB /* NSString.swift in Sources */, + 565490D11D5AE252005622CB /* NSURL.swift in Sources */, + 565490E31D5AE252005622CB /* RowConvertible.swift in Sources */, + 565490DF1D5AE252005622CB /* SQLTableBuilder.swift in Sources */, + 565490B71D5AE236005622CB /* Database.swift in Sources */, + 565490C01D5AE236005622CB /* DatabaseWriter.swift in Sources */, + 565490C41D5AE236005622CB /* SchedulingWatchdog.swift in Sources */, + 565490CC1D5AE252005622CB /* NSData.swift in Sources */, + 565490DB1D5AE252005622CB /* SQLCollation.swift in Sources */, + 565490C61D5AE236005622CB /* Statement.swift in Sources */, + 565490D41D5AE252005622CB /* StatementArguments+Foundation.swift in Sources */, + 565490B61D5AE236005622CB /* Configuration.swift in Sources */, + 565490E11D5AE252005622CB /* Persistable.swift in Sources */, + 565490E01D5AE252005622CB /* FetchedRecordsController.swift in Sources */, + 565490C81D5AE252005622CB /* CGFloat.swift in Sources */, + 565490D21D5AE252005622CB /* NSUUID.swift in Sources */, + 565490DC1D5AE252005622CB /* SQLFunction.swift in Sources */, + 565490D31D5AE252005622CB /* Row+Foundation.swift in Sources */, + 565490DE1D5AE252005622CB /* SQLSelectQuery.swift in Sources */, + 565490CB1D5AE252005622CB /* DatabaseValue+Foundation.swift in Sources */, + 565490D61D5AE252005622CB /* StandardLibrary.swift in Sources */, + 565490B81D5AE236005622CB /* DatabaseError.swift in Sources */, + 565490BC1D5AE236005622CB /* DatabaseSchemaCache.swift in Sources */, + 565490BA1D5AE236005622CB /* DatabaseQueue.swift in Sources */, + 565490CD1D5AE252005622CB /* NSDate.swift in Sources */, + 565490BE1D5AE236005622CB /* DatabaseValue.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 56553BDD1C3E906C00522B5C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -4416,6 +4570,49 @@ }; name = Release; }; + 565490A51D5A4798005622CB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 56B8F49A1B4E2F3600C24296 /* GRDB.xcconfig */; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_NONNULL = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Debug; + }; + 565490A61D5A4798005622CB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 56B8F49A1B4E2F3600C24296 /* GRDB.xcconfig */; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_NONNULL = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Release; + }; 56553C161C3E906C00522B5C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4994,6 +5191,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 565490B31D5A4798005622CB /* Build configuration list for PBXNativeTarget "GRDBWatchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 565490A51D5A4798005622CB /* Debug */, + 565490A61D5A4798005622CB /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 56553C151C3E906C00522B5C /* Build configuration list for PBXNativeTarget "GRDBOSXCrashTests" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme b/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme new file mode 100644 index 000000000..72ee9f5dd --- /dev/null +++ b/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GRDB/Core/Configuration.swift b/GRDB/Core/Configuration.swift index a0958a945..5008a1ec1 100644 --- a/GRDB/Core/Configuration.swift +++ b/GRDB/Core/Configuration.swift @@ -9,6 +9,12 @@ import Foundation #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index 0e8827f69..7f26d1643 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -9,6 +9,12 @@ import Foundation #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/DatabaseError.swift b/GRDB/Core/DatabaseError.swift index dc066ee64..b2605ba77 100644 --- a/GRDB/Core/DatabaseError.swift +++ b/GRDB/Core/DatabaseError.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index 1826b4b7c..05d9b0aa8 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 61e0c3d14..00896538f 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/DatabaseValue.swift b/GRDB/Core/DatabaseValue.swift index 1bac1aca1..a3c2f6a34 100644 --- a/GRDB/Core/DatabaseValue.swift +++ b/GRDB/Core/DatabaseValue.swift @@ -9,6 +9,12 @@ import Foundation #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/Row.swift b/GRDB/Core/Row.swift index a42552167..944633ba1 100644 --- a/GRDB/Core/Row.swift +++ b/GRDB/Core/Row.swift @@ -9,6 +9,12 @@ import Foundation #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/RowAdapter.swift b/GRDB/Core/RowAdapter.swift index d793a1ae7..26c347d61 100644 --- a/GRDB/Core/RowAdapter.swift +++ b/GRDB/Core/RowAdapter.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift index 26984e492..62ad27c64 100644 --- a/GRDB/Core/Statement.swift +++ b/GRDB/Core/Statement.swift @@ -9,6 +9,12 @@ import Foundation #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/StatementColumnConvertible.swift b/GRDB/Core/StatementColumnConvertible.swift index 04383bc02..ffc0d163b 100644 --- a/GRDB/Core/StatementColumnConvertible.swift +++ b/GRDB/Core/StatementColumnConvertible.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/Support/StandardLibrary/StandardLibrary.swift b/GRDB/Core/Support/StandardLibrary/StandardLibrary.swift index da31cb58a..9def357aa 100644 --- a/GRDB/Core/Support/StandardLibrary/StandardLibrary.swift +++ b/GRDB/Core/Support/StandardLibrary/StandardLibrary.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Core/Utils.swift b/GRDB/Core/Utils.swift index 6448d30b4..178746e8a 100644 --- a/GRDB/Core/Utils.swift +++ b/GRDB/Core/Utils.swift @@ -9,6 +9,12 @@ import Foundation #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Migrations/Migration.swift b/GRDB/Migrations/Migration.swift index 980d726fd..cef751d16 100644 --- a/GRDB/Migrations/Migration.swift +++ b/GRDB/Migrations/Migration.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/QueryInterface/SQLSelectQuery.swift b/GRDB/QueryInterface/SQLSelectQuery.swift index 1c2b9d070..3d6ecb6e2 100644 --- a/GRDB/QueryInterface/SQLSelectQuery.swift +++ b/GRDB/QueryInterface/SQLSelectQuery.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/GRDB/Record/TableMapping.swift b/GRDB/Record/TableMapping.swift index d600236a1..de2787cfc 100644 --- a/GRDB/Record/TableMapping.swift +++ b/GRDB/Record/TableMapping.swift @@ -7,6 +7,12 @@ #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/Support/module.modulemap b/Support/module.modulemap index 57256af46..d15a4c976 100644 --- a/Support/module.modulemap +++ b/Support/module.modulemap @@ -19,3 +19,13 @@ module SQLiteiPhoneSimulator { header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h" export * } + +module SQLiteWatchOS { + header "/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/usr/includesqlite3.h" + export * +} + +module SQLiteWatchSimulator { + header "/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/include/sqlite3.h" + export * +} diff --git a/Tests/Private/NSDataMemoryTests.swift b/Tests/Private/NSDataMemoryTests.swift index fa0a44f88..209b05e1a 100644 --- a/Tests/Private/NSDataMemoryTests.swift +++ b/Tests/Private/NSDataMemoryTests.swift @@ -9,6 +9,12 @@ import XCTest #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif diff --git a/Tests/Public/Core/StatementColumnConvertible/StatementColumnConvertibleFetchTests.swift b/Tests/Public/Core/StatementColumnConvertible/StatementColumnConvertibleFetchTests.swift index a32f5f2c4..96664cc1e 100644 --- a/Tests/Public/Core/StatementColumnConvertible/StatementColumnConvertibleFetchTests.swift +++ b/Tests/Public/Core/StatementColumnConvertible/StatementColumnConvertibleFetchTests.swift @@ -16,6 +16,12 @@ import XCTest #else import SQLiteiPhoneOS #endif + #elseif os(watchOS) + #if (arch(i386) || arch(x86_64)) + import SQLiteWatchSimulator + #else + import SQLiteWatchOS + #endif #endif #endif From 401d5cab667b208e1e895a22bcd982fc69f4f8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Sep 2016 12:46:29 +0200 Subject: [PATCH 02/14] TODO.md --- TODO.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 7aaf3bd6f..0fd7ba4de 100644 --- a/TODO.md +++ b/TODO.md @@ -55,4 +55,5 @@ Reading list: - https://sqlite.org/sharedcache.html - Amazing tip from Xcode labs: add a EXCLUDED_SOURCE_FILE_NAMES build setting to conditionally exclude sources for different configuration: https://twitter.com/zats/status/74386298602026496 - SQLITE_ENABLE_SQLLOG: http://mjtsai.com/blog/2016/07/19/sqlite_enable_sqllog/ -- [Writing High-Performance Swift Code](https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst) \ No newline at end of file +- [Writing High-Performance Swift Code](https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst) +- http://docs.diesel.rs/diesel/associations/index.html From 6285fd9f98bdb3d95c287d031675840e5021d565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 6 Sep 2016 06:25:37 +0200 Subject: [PATCH 03/14] TODO.md --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index 0fd7ba4de..7935b4b38 100644 --- a/TODO.md +++ b/TODO.md @@ -57,3 +57,4 @@ Reading list: - SQLITE_ENABLE_SQLLOG: http://mjtsai.com/blog/2016/07/19/sqlite_enable_sqllog/ - [Writing High-Performance Swift Code](https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst) - http://docs.diesel.rs/diesel/associations/index.html +- http://cocoamine.net/blog/2015/09/07/contentless-fts4-for-large-immutable-documents/ From 5b4e5f9d1df2e79329d2d84999849dd732995c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 6 Sep 2016 10:08:05 +0200 Subject: [PATCH 04/14] TODO.md --- TODO.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO.md b/TODO.md index 7935b4b38..3cbb6ea42 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,5 @@ +- [ ] @pakko972: fix documentation of deleteOne/All(keys:) so that it makes clear that the arguments are unique keys. +- [ ] @pakko972: try Record.filter(...).deleteAll(db) - [ ] @hdlj: Extensibility of the Query Interface - [ ] @hdlj: FetchedRecordsController throttling - [ ] @hdlj: Check RAM pressure From 1e95e385059eb76e64580aeb48b2e1a948cc3dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 04:24:18 +0200 Subject: [PATCH 05/14] TODO.md --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index 3cbb6ea42..98adcf069 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,4 @@ +- [ ] Query sqlite_temp_master also - [ ] @pakko972: fix documentation of deleteOne/All(keys:) so that it makes clear that the arguments are unique keys. - [ ] @pakko972: try Record.filter(...).deleteAll(db) - [ ] @hdlj: Extensibility of the Query Interface From 0620fc9f176ba019668186727f07ad0aa1f37b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 13:29:06 +0200 Subject: [PATCH 06/14] Failing test for Database.tableExists() and temporary table --- Tests/Public/Core/Database/DatabaseTests.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tests/Public/Core/Database/DatabaseTests.swift b/Tests/Public/Core/Database/DatabaseTests.swift index 94e4f9fdf..ba6ceaebe 100644 --- a/Tests/Public/Core/Database/DatabaseTests.swift +++ b/Tests/Public/Core/Database/DatabaseTests.swift @@ -24,6 +24,21 @@ class DatabaseTests : GRDBTestCase { } } + func testCreateTemporaryTable() { + assertNoError { + let dbQueue = try makeDatabaseQueue() + try dbQueue.inDatabase { db in + XCTAssertFalse(db.tableExists("persons")) + try db.execute( + "CREATE TEMPORARY TABLE persons (" + + "id INTEGER PRIMARY KEY, " + + "name TEXT, " + + "age INT)") + XCTAssertTrue(db.tableExists("persons")) + } + } + } + func testMultipleStatementsWithoutArguments() { assertNoError { let dbQueue = try makeDatabaseQueue() From 8a89be69992e3819bddf4b46aa7e0735128157b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 13:33:31 +0200 Subject: [PATCH 07/14] Pass test for Database.tableExists() and temporary table --- CHANGELOG.md | 7 +++++++ GRDB/Core/Database.swift | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d876ef0d..557f69846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Release Notes ============= +## Next Version + +**Fixed** + +- `Database.tableExists()` learned about temporary tables + + ## 0.79.4 Released August 17, 2016 diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index 0e8827f69..e5aeaa564 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -795,7 +795,7 @@ extension Database { // SQlite identifiers are case-insensitive, case-preserving (http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html) return Row.fetchOne(self, - "SELECT sql FROM sqlite_master WHERE type = 'table' AND LOWER(name) = ?", + "SELECT * FROM (SELECT sql, type, name FROM sqlite_master UNION SELECT sql, type, name FROM sqlite_temp_master) WHERE type = 'table' AND LOWER(name) = ?", arguments: [tableName.lowercaseString]) != nil } From 68ebe1a4ff7c381897587219aef6e146c0a1b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 13:39:37 +0200 Subject: [PATCH 08/14] TODO.md --- TODO.md | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO.md b/TODO.md index 98adcf069..3cbb6ea42 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,3 @@ -- [ ] Query sqlite_temp_master also - [ ] @pakko972: fix documentation of deleteOne/All(keys:) so that it makes clear that the arguments are unique keys. - [ ] @pakko972: try Record.filter(...).deleteAll(db) - [ ] @hdlj: Extensibility of the Query Interface From 238ebdeed8c131752a5219201332a41fc0d74121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 13:44:25 +0200 Subject: [PATCH 09/14] Fix the documentation of delete/Fetch/One/All(keys:) so that it makes clear that arguments are unique keys. --- GRDB/Record/TableMapping.swift | 21 +++++++++++++-------- TODO.md | 1 - 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/GRDB/Record/TableMapping.swift b/GRDB/Record/TableMapping.swift index d600236a1..efcf2da9b 100644 --- a/GRDB/Record/TableMapping.swift +++ b/GRDB/Record/TableMapping.swift @@ -193,9 +193,10 @@ extension RowConvertible where Self: TableMapping { // MARK: - Fetching by Key - /// Returns a sequence of records, given an array of key dictionaries. + /// Returns a sequence of records identified by the provided unique keys + /// (primary key or any key with a unique index on it). /// - /// let persons = Person.fetch(db, keys: [["name": "Arthur"], ["name": "Barbara"]]) // DatabaseSequence + /// let persons = Person.fetch(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]]) // DatabaseSequence /// /// The order of records in the returned sequence is undefined. /// @@ -211,9 +212,10 @@ extension RowConvertible where Self: TableMapping { return fetch(statement) } - /// Returns an array of records, given an array of key dictionaries. + /// Returns an array of records identified by the provided unique keys + /// (primary key or any key with a unique index on it). /// - /// let persons = Person.fetchAll(db, keys: [["name": "Arthur"], ["name": "Barbara"]]) // [Person] + /// let persons = Person.fetchAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]]) // [Person] /// /// The order of records in the returned array is undefined. /// @@ -229,7 +231,8 @@ extension RowConvertible where Self: TableMapping { return fetchAll(statement) } - /// Returns a single record given a key dictionary. + /// Returns a single record identified by a unique key (the primary key or + /// any key with a unique index on it). /// /// let person = Person.fetchOne(db, key: ["name": Arthur"]) // Person? /// @@ -285,9 +288,10 @@ extension TableMapping { // MARK: - Deleting by Key - /// Delete records, given an array of key dictionaries. + /// Delete records identified by the provided unique keys (primary key or + /// any key with a unique index on it). /// - /// try Person.deleteAll(db, keys: [["name": "Arthur"], ["name": "Barbara"]]) + /// try Person.deleteAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]]) /// /// - parameters: /// - db: A database connection. @@ -301,7 +305,8 @@ extension TableMapping { return db.changesCount } - /// Delete a record, identified by a key dictionary. + /// Delete a record, identified by a unique key (the primary key or any key + /// with a unique index on it). /// /// Person.deleteOne(db, key: ["name": Arthur"]) /// diff --git a/TODO.md b/TODO.md index 3cbb6ea42..06bd4b5b9 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,3 @@ -- [ ] @pakko972: fix documentation of deleteOne/All(keys:) so that it makes clear that the arguments are unique keys. - [ ] @pakko972: try Record.filter(...).deleteAll(db) - [ ] @hdlj: Extensibility of the Query Interface - [ ] @hdlj: FetchedRecordsController throttling From e4ae0988a4a7e4e1004d4cc384715533d7c536f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 14:10:16 +0200 Subject: [PATCH 10/14] QueryInterfaceRequest.deleteAll (for @pakko972) --- .../QueryInterfaceRequest.swift | 13 +++++++++ GRDB/QueryInterface/SQLSelectQuery.swift | 29 +++++++++++++++++++ TODO.md | 3 ++ .../QueryInterfaceRequestTests.swift | 29 +++++++++++++++++++ 4 files changed, 74 insertions(+) diff --git a/GRDB/QueryInterface/QueryInterfaceRequest.swift b/GRDB/QueryInterface/QueryInterfaceRequest.swift index 676ac3d05..5a2c97756 100644 --- a/GRDB/QueryInterface/QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/QueryInterfaceRequest.swift @@ -233,6 +233,19 @@ extension QueryInterfaceRequest { } +extension QueryInterfaceRequest { + + // MARK: Deleting + + /// Returns the number of rows matched by the request. + /// + /// - parameter db: A database connection. + public func deleteAll(db: Database) throws { + try query.makeDeleteStatement(db).execute() + } +} + + extension QueryInterfaceRequest { // MARK: QueryInterfaceRequest as subquery diff --git a/GRDB/QueryInterface/SQLSelectQuery.swift b/GRDB/QueryInterface/SQLSelectQuery.swift index 1c2b9d070..c655dc59b 100644 --- a/GRDB/QueryInterface/SQLSelectQuery.swift +++ b/GRDB/QueryInterface/SQLSelectQuery.swift @@ -177,6 +177,35 @@ public struct _SQLSelectQuery { } } + func makeDeleteStatement(db: Database) -> UpdateStatement { + guard groupByExpressions.isEmpty else { + fatalError("Can't delete query with GROUP BY expression") + } + + guard havingExpression == nil else { + fatalError("Can't delete query with GROUP BY expression") + } + + guard limit == nil else { + fatalError("Can't delete query with limit") + } + + var sql = "DELETE" + var arguments: StatementArguments? = StatementArguments() + + if let source = source { + sql += " FROM " + source.sql(&arguments) + } + + if let whereExpression = whereExpression { + sql += " WHERE " + whereExpression.sql(&arguments) + } + + let statement = try! db.updateStatement(sql) + statement.arguments = arguments! + return statement + } + // SELECT COUNT(*) FROM (self) private var trivialCountQuery: _SQLSelectQuery { return _SQLSelectQuery( diff --git a/TODO.md b/TODO.md index 06bd4b5b9..451516141 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,7 @@ +- [ ] Fix slow compilation time of SQLTableBuilderTests.swift - [ ] @pakko972: try Record.filter(...).deleteAll(db) + - [X] feature + - [ ] documentation - [ ] @hdlj: Extensibility of the Query Interface - [ ] @hdlj: FetchedRecordsController throttling - [ ] @hdlj: Check RAM pressure diff --git a/Tests/Public/QueryInterfaceRequest/QueryInterfaceRequestTests.swift b/Tests/Public/QueryInterfaceRequest/QueryInterfaceRequestTests.swift index c98cc1331..3f64f8178 100644 --- a/Tests/Public/QueryInterfaceRequest/QueryInterfaceRequestTests.swift +++ b/Tests/Public/QueryInterfaceRequest/QueryInterfaceRequestTests.swift @@ -485,4 +485,33 @@ class QueryInterfaceRequestTests: GRDBTestCase { sql(dbQueue, tableRequest.limit(1, offset: 2).limit(3)), "SELECT * FROM \"readers\" LIMIT 3") } + + + // MARK: - Delete + + func testDelete() { + assertNoError { + let dbQueue = try makeDatabaseQueue() + + try dbQueue.inDatabase { db in + try tableRequest.deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"readers\"") + + try tableRequest.filter(Col.age == 42).deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"readers\" WHERE (\"age\" = 42)") + + try tableRequest.filter(sql: "id = 1").deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"readers\" WHERE id = 1") + + try tableRequest.select(Col.name).deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"readers\"") + + try tableRequest.distinct.deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"readers\"") + + try tableRequest.order(Col.name).deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"readers\"") + } + } + } } From b191323e2b0b72fec9f7ea379b4f4c6c52018b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 18:06:30 +0200 Subject: [PATCH 11/14] Query Interface deletion documentation --- CHANGELOG.md | 8 ++ .../QueryInterfaceRequest.swift | 7 +- GRDB/Record/TableMapping.swift | 10 ++- README.md | 74 +++++++++++++++++-- 4 files changed, 88 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 557f69846..001caf2a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ Release Notes - `Database.tableExists()` learned about temporary tables +**New** + +- `QueryInterfaceRequest.deleteAll(db)` deletes matching database rows: + + ```swift + try Wine.filter(corked == true).deleteAll(db) + ``` + ## 0.79.4 diff --git a/GRDB/QueryInterface/QueryInterfaceRequest.swift b/GRDB/QueryInterface/QueryInterfaceRequest.swift index 5a2c97756..a4951c384 100644 --- a/GRDB/QueryInterface/QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/QueryInterfaceRequest.swift @@ -237,11 +237,14 @@ extension QueryInterfaceRequest { // MARK: Deleting - /// Returns the number of rows matched by the request. + /// Deletes matching rows; returns the number of deleted rows. /// /// - parameter db: A database connection. - public func deleteAll(db: Database) throws { + /// - returns: The number of deleted rows + /// - throws: A DatabaseError is thrown whenever an SQLite error occurs. + public func deleteAll(db: Database) throws -> Int { try query.makeDeleteStatement(db).execute() + return db.changesCount } } diff --git a/GRDB/Record/TableMapping.swift b/GRDB/Record/TableMapping.swift index efcf2da9b..b81459464 100644 --- a/GRDB/Record/TableMapping.swift +++ b/GRDB/Record/TableMapping.swift @@ -121,7 +121,8 @@ extension TableMapping { // MARK: - Deleting by Single-Column Primary Key - /// Delete records identified by their primary keys. + /// Delete records identified by their primary keys; returns the number of + /// deleted rows. /// /// try Person.deleteAll(db, keys: [1, 2, 3]) /// @@ -137,7 +138,8 @@ extension TableMapping { return db.changesCount } - /// Delete a record, identified by its primary key. + /// Delete a record, identified by its primary key; returns whether a + /// database row was deleted. /// /// try Person.deleteOne(db, key: 123) /// @@ -289,7 +291,7 @@ extension TableMapping { // MARK: - Deleting by Key /// Delete records identified by the provided unique keys (primary key or - /// any key with a unique index on it). + /// any key with a unique index on it); returns the number of deleted rows. /// /// try Person.deleteAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]]) /// @@ -306,7 +308,7 @@ extension TableMapping { } /// Delete a record, identified by a unique key (the primary key or any key - /// with a unique index on it). + /// with a unique index on it); returns whether a database row was deleted. /// /// Person.deleteOne(db, key: ["name": Arthur"]) /// diff --git a/README.md b/README.md index c7dc37acd..f3acfbe1c 100644 --- a/README.md +++ b/README.md @@ -1810,9 +1810,9 @@ When given dictionaries, `fetchOne`, `deleteOne`, `fetchAll` and `deleteAll` acc ```swift // CREATE TABLE persons ( -// id INTEGER PRIMARY KEY, -- can fetch and delete by id -// email TEXT UNIQUE, -- can fetch and delete by email -// name TEXT -- nope +// id INTEGER PRIMARY KEY, -- unique id +// email TEXT UNIQUE, -- unique email +// name TEXT -- not unique // ) Person.fetchOne(db, key: ["id": 1]) // Person? Person.fetchOne(db, key: ["email": "arthur@example.com"]) // Person? @@ -2114,9 +2114,17 @@ The Query Interface **The query interface lets you write pure Swift instead of SQL:** ```swift +// Update database schema try db.create(table: "wines") { t in ... } -let count = Wine.filter(color == Color.Red).fetchCount(db) + +// Fetch let wines = Wine.filter(origin == "Burgundy").order(price).fetchAll(db) + +// Count +let count = Wine.filter(color == Color.Red).fetchCount(db) + +// Delete +try Wine.filter(corked == true).deleteAll(db) ``` Please bear in mind that the query interface can not generate all possible SQL queries. You may also *prefer* writing SQL, and this is just OK. From little snippets to full queries, your SQL skills are welcome: @@ -2125,6 +2133,7 @@ Please bear in mind that the query interface can not generate all possible SQL q try db.execute("CREATE TABLE wines (...)") let count = Wine.filter(sql: "color = ?", arguments: [Color.Red]).fetchCount(db) let wines = Wine.fetchAll(db, "SELECT * FROM wines WHERE origin = ? ORDER BY price", arguments: ["Burgundy"]) +try db.execute("DELETE FROM wines WHERE corked") ``` So don't miss the [SQL API](#sqlite-api). @@ -2137,6 +2146,7 @@ So don't miss the [SQL API](#sqlite-api). - [Fetching from Requests](#fetching-from-requests) - [Fetching by Primary Key](#fetching-by-primary-key) - [Fetching Aggregated Values](#fetching-aggregated-values) +- [Delete Requests](#delete-requests) ## Database Schema @@ -2655,7 +2665,7 @@ For multiple-column primary keys, provide a dictionary: Citizenship.fetchOne(db, key: ["personID": 1, "countryISOCode": "FR"]) // Citizenship? ``` -You can use generally use a dictionary for any **unique key** (primary key and columns involved in a unique index): +You can generally use a dictionary for any **unique key** (primary key and columns involved in a unique index): ```swift Person.fetchOne(db, key: ["email": "arthur@example.com"]) // Person? @@ -2694,6 +2704,60 @@ let maxHeight = row.value(atIndex: 1) as Double? ``` +## Delete Requests + +**Requests can delete records**, with the `deleteAll()` method: + +```swift +// DELETE FROM persons WHERE email IS NULL +let request = Person.filter(emailColumn == nil) +try request.deleteAll(db) +``` + +**Deleting records according to their primary key** is also quite common. It has a shortcut which accepts any single-column primary key: + +```swift +// DELETE FROM persons WHERE id = 1 +try Person.deleteOne(db, key: 1) + +// DELETE FROM persons WHERE id IN (1, 2, 3) +try Person.deleteAll(db, keys: [1, 2, 3]) + +// DELETE FROM persons WHERE isoCode = 'FR' +try Country.deleteOne(db, key: "FR") + +// DELETE FROM countries WHERE isoCode IN ('FR', 'US') +try Country.deleteAll(db, keys: ["FR", "US"]) +``` + +For multiple-column primary keys, provide a dictionary: + +```swift +// DELETE FROM citizenships WHERE personID = 1 AND countryISOCode = 'FR' +try Citizenship.deleteOne(db, key: ["personID": 1, "countryISOCode": "FR"]) +``` + +You can generally use a dictionary for any **unique key** (primary key and columns involved in a unique index): + +```swift +Person.deleteOne(db, key: ["email": "arthur@example.com"]) +``` + +When given dictionaries, `deleteOne` and `deleteAll` accept any set of columns that uniquely identify rows. These are the primary key columns, or any columns involved in a unique index: + +```swift +// CREATE TABLE persons ( +// id INTEGER PRIMARY KEY, -- unique id +// email TEXT UNIQUE, -- unique email +// name TEXT -- not unique +// ) +try Person.deleteOne(db, key: ["id": 1]) +try Person.deleteOne(db, key: ["email": "arthur@example.com"]) +try Person.deleteOne(db, key: ["name": "Arthur"]) // fatal error: table persons has no unique index on column name. +``` + + + Application Tools ================= From 796d30d86361cd2545c6d642550ed68d14728ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 22:16:01 +0200 Subject: [PATCH 12/14] TODO.md --- TODO.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/TODO.md b/TODO.md index 451516141..0a6041314 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,4 @@ - [ ] Fix slow compilation time of SQLTableBuilderTests.swift -- [ ] @pakko972: try Record.filter(...).deleteAll(db) - - [X] feature - - [ ] documentation - [ ] @hdlj: Extensibility of the Query Interface - [ ] @hdlj: FetchedRecordsController throttling - [ ] @hdlj: Check RAM pressure From 0bd22281f77ca40fa1b408219952047effad5517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 22:51:12 +0200 Subject: [PATCH 13/14] GRDBDemoWatchOS --- .../README__ignoredByTemplate__ | 1 + .../GRDBDemoWatchOS Extension/Database.swift | 39 ++ .../ExtensionDelegate.swift | 8 + .../GRDBDemoWatchOS Extension/Info.plist | 38 ++ .../InterfaceController.swift | 25 + .../GRDBDemoWatchOS Extension/Person.swift | 42 ++ .../AppIcon.appiconset/Contents.json | 55 +++ .../Base.lproj/Interface.storyboard | 35 ++ .../GRDBDemoiOS/GRDBDemoWatchOS/Info.plist | 35 ++ .../GRDBDemoiOS.xcodeproj/project.pbxproj | 428 +++++++++++++++++- .../xcschemes/GRDBWatchOS.xcscheme | 6 +- 11 files changed, 708 insertions(+), 4 deletions(-) create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Assets.xcassets/README__ignoredByTemplate__ create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Database.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/ExtensionDelegate.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Info.plist create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/InterfaceController.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Person.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Base.lproj/Interface.storyboard create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Info.plist diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Assets.xcassets/README__ignoredByTemplate__ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Assets.xcassets/README__ignoredByTemplate__ new file mode 100644 index 000000000..b601d3834 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Assets.xcassets/README__ignoredByTemplate__ @@ -0,0 +1 @@ +Did you know that git does not support storing empty directories? diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Database.swift b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Database.swift new file mode 100644 index 000000000..afc09c61f --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Database.swift @@ -0,0 +1,39 @@ +import GRDB +import WatchKit + +// The shared database queue +var dbQueue: DatabaseQueue! + +func setupDatabase() { + + // Connect to the database + // See https://github.com/groue/GRDB.swift/#database-connections + + let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! as NSString + let databasePath = documentsPath.stringByAppendingPathComponent("db.sqlite") + dbQueue = try! DatabaseQueue(path: databasePath) + + + // Use DatabaseMigrator to setup the database + // See https://github.com/groue/GRDB.swift/#migrations + + var migrator = DatabaseMigrator() + + migrator.registerMigration("createPersons") { db in + // Compare person names in a localized case insensitive fashion + // See https://github.com/groue/GRDB.swift/#unicode + try db.create(table: "persons") { t in + t.column("id", .Integer).primaryKey() + t.column("name", .Text).notNull().collate(.localizedCaseInsensitiveCompare) + } + } + + migrator.registerMigration("addPersons") { db in + // Populate the persons table with random data + for _ in 0..<8 { + try Person(name: Person.randomName()).insert(db) + } + } + + try! migrator.migrate(dbQueue) +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/ExtensionDelegate.swift b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/ExtensionDelegate.swift new file mode 100644 index 000000000..1578e08ee --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/ExtensionDelegate.swift @@ -0,0 +1,8 @@ +import WatchKit + +class ExtensionDelegate: NSObject, WKExtensionDelegate { + + func applicationDidFinishLaunching() { + setupDatabase() + } +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Info.plist b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Info.plist new file mode 100644 index 000000000..cd1bdb2b0 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + GRDBDemoWatchOS Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSExtension + + NSExtensionAttributes + + WKAppBundleIdentifier + GRDB.GRDBDemoiOS.watchkitapp + + NSExtensionPointIdentifier + com.apple.watchkit + + WKExtensionDelegateClassName + $(PRODUCT_MODULE_NAME).ExtensionDelegate + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/InterfaceController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/InterfaceController.swift new file mode 100644 index 000000000..dfabde4b7 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/InterfaceController.swift @@ -0,0 +1,25 @@ +import WatchKit +import GRDB + +class InterfaceController: WKInterfaceController { + + @IBOutlet var table: WKInterfaceTable! + + override func awakeWithContext(context: AnyObject?) { + super.awakeWithContext(context) + + let persons = dbQueue.inDatabase { db in + Person.order(SQLColumn("name")).fetchAll(db) + } + + table.setNumberOfRows(persons.count, withRowType: "Person") + for (i, person) in persons.enumerate() { + let row = table.rowControllerAtIndex(i) as! PersonRowController + row.nameLabel.setText(person.name) + } + } +} + +class PersonRowController: NSObject { + @IBOutlet var nameLabel: WKInterfaceLabel! +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Person.swift b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Person.swift new file mode 100644 index 000000000..32c97f849 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS Extension/Person.swift @@ -0,0 +1,42 @@ +import GRDB + +class Person: Record { + var id: Int64? + var name: String + + init(name: String) { + self.name = name + super.init() + } + + // MARK: Record overrides + + override class func databaseTableName() -> String { + return "persons" + } + + required init(_ row: Row) { + id = row.value(named: "id") + name = row.value(named: "name") + super.init(row) + } + + override var persistentDictionary: [String : DatabaseValueConvertible?] { + return [ + "id": id, + "name": name] + } + + override func didInsertWithRowID(rowID: Int64, forColumn column: String?) { + id = rowID + } + + // MARK: Random + + private static let names = ["Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David", "Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette", "Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl", "Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole", "Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul", "Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain", "Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann", "Zazie", "Zoé"] + + class func randomName() -> String { + return names[Int(arc4random_uniform(UInt32(names.count)))] + } + +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..dd221ba54 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,55 @@ +{ + "images" : [ + { + "size" : "24x24", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "38mm" + }, + { + "size" : "27.5x27.5", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "42mm" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "38mm" + }, + { + "size" : "86x86", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "38mm" + }, + { + "size" : "98x98", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "42mm" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Base.lproj/Interface.storyboard b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Base.lproj/Interface.storyboard new file mode 100644 index 000000000..f2d9c7099 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Base.lproj/Interface.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Info.plist b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Info.plist new file mode 100644 index 000000000..c16031546 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoWatchOS/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + GRDBDemoiOS + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + WKCompanionAppBundleIdentifier + GRDB.GRDBDemoiOS + WKWatchKitApp + + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj index b0904b3a2..fab27082d 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj @@ -7,6 +7,15 @@ objects = { /* Begin PBXBuildFile section */ + 5624A6AA1D80B13300AD3DCE /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5624A6A81D80B13300AD3DCE /* Interface.storyboard */; }; + 5624A6AC1D80B13300AD3DCE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5624A6AB1D80B13300AD3DCE /* Assets.xcassets */; }; + 5624A6B31D80B13300AD3DCE /* GRDBDemoWatchOS Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5624A6B21D80B13300AD3DCE /* GRDBDemoWatchOS Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 5624A6B81D80B13300AD3DCE /* InterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5624A6B71D80B13300AD3DCE /* InterfaceController.swift */; }; + 5624A6BA1D80B13300AD3DCE /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5624A6B91D80B13300AD3DCE /* ExtensionDelegate.swift */; }; + 5624A6BC1D80B13300AD3DCE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5624A6BB1D80B13300AD3DCE /* Assets.xcassets */; }; + 5624A6C11D80B13400AD3DCE /* GRDBDemoWatchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 5624A6A61D80B13300AD3DCE /* GRDBDemoWatchOS.app */; }; + 5624A6F11D80B1FB00AD3DCE /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5624A6F01D80B1FB00AD3DCE /* Database.swift */; }; + 5624A6F31D80B23800AD3DCE /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5624A6F21D80B23800AD3DCE /* Person.swift */; }; 568C7A9A1CA6C63100796484 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7A991CA6C63100796484 /* AppDelegate.swift */; }; 568C7A9C1CA6C63100796484 /* PersonsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7A9B1CA6C63100796484 /* PersonsViewController.swift */; }; 568C7A9F1CA6C63100796484 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568C7A9D1CA6C63100796484 /* Main.storyboard */; }; @@ -22,6 +31,97 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 5624A6B41D80B13300AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7A8E1CA6C63100796484 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5624A6B11D80B13300AD3DCE; + remoteInfo = "GRDBDemoWatchOS Extension"; + }; + 5624A6BE1D80B13300AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7A8E1CA6C63100796484 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5624A6A51D80B13300AD3DCE; + remoteInfo = GRDBDemoWatchOS; + }; + 5624A6D61D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 560FC54D1CB003810014AA8E; + remoteInfo = GRDBCipherOSX; + }; + 5624A6D81D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 560FC5B01CB00B880014AA8E; + remoteInfo = GRDBCipherOSXTests; + }; + 5624A6DA1D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 5671566C1CB16729007DC145; + remoteInfo = GRDBCipherOSXEncryptedTests; + }; + 5624A6DC1D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F3BA805A1CFB2BB2003DC1BA; + remoteInfo = GRDBCustomSQLiteOSX; + }; + 5624A6DE1D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F3BA809B1CFB2F6F003DC1BA; + remoteInfo = GRDBCustomSQLiteOSXTests; + }; + 5624A6E01D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 56AFCA231CB1A8BB00F48B96; + remoteInfo = GRDBCipheriOS; + }; + 5624A6E21D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 56AFCA7F1CB1AA9900F48B96; + remoteInfo = GRDBCipheriOSTests; + }; + 5624A6E41D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 56AFCAD71CB1ABC800F48B96; + remoteInfo = GRDBCipheriOSEncryptedTests; + }; + 5624A6E61D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F3BA7FFE1CFB25E4003DC1BA; + remoteInfo = GRDBCustomSQLiteiOS; + }; + 5624A6E81D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F3BA80411CFB2AD7003DC1BA; + remoteInfo = GRDBCustomSQLiteiOSTests; + }; + 5624A6EA1D80B13400AD3DCE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 565490A01D5A4798005622CB; + remoteInfo = GRDBWatchOS; + }; 568C7ACE1CA6C6BF00796484 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; @@ -74,6 +174,28 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 5624A6C01D80B13300AD3DCE /* Embed Watch Content */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; + dstSubfolderSpec = 16; + files = ( + 5624A6C11D80B13400AD3DCE /* GRDBDemoWatchOS.app in Embed Watch Content */, + ); + name = "Embed Watch Content"; + runOnlyForDeploymentPostprocessing = 0; + }; + 5624A6ED1D80B13400AD3DCE /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 5624A6B31D80B13300AD3DCE /* GRDBDemoWatchOS Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; 568C7ADE1CA6C6D100796484 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -88,6 +210,17 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 5624A6A61D80B13300AD3DCE /* GRDBDemoWatchOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoWatchOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5624A6A91D80B13300AD3DCE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = ""; }; + 5624A6AB1D80B13300AD3DCE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 5624A6AD1D80B13300AD3DCE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5624A6B21D80B13300AD3DCE /* GRDBDemoWatchOS Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "GRDBDemoWatchOS Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5624A6B71D80B13300AD3DCE /* InterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceController.swift; sourceTree = ""; }; + 5624A6B91D80B13300AD3DCE /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; + 5624A6BB1D80B13300AD3DCE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 5624A6BD1D80B13300AD3DCE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5624A6F01D80B1FB00AD3DCE /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = ""; }; + 5624A6F21D80B23800AD3DCE /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = ""; }; 568C7A961CA6C63100796484 /* GRDBDemoiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 568C7A991CA6C63100796484 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 568C7A9B1CA6C63100796484 /* PersonsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonsViewController.swift; sourceTree = ""; }; @@ -104,6 +237,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 5624A6AF1D80B13300AD3DCE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 568C7A931CA6C63100796484 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -115,10 +255,35 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5624A6A71D80B13300AD3DCE /* GRDBDemoWatchOS */ = { + isa = PBXGroup; + children = ( + 5624A6A81D80B13300AD3DCE /* Interface.storyboard */, + 5624A6AB1D80B13300AD3DCE /* Assets.xcassets */, + 5624A6AD1D80B13300AD3DCE /* Info.plist */, + ); + path = GRDBDemoWatchOS; + sourceTree = ""; + }; + 5624A6B61D80B13300AD3DCE /* GRDBDemoWatchOS Extension */ = { + isa = PBXGroup; + children = ( + 5624A6F01D80B1FB00AD3DCE /* Database.swift */, + 5624A6B71D80B13300AD3DCE /* InterfaceController.swift */, + 5624A6B91D80B13300AD3DCE /* ExtensionDelegate.swift */, + 5624A6F21D80B23800AD3DCE /* Person.swift */, + 5624A6BB1D80B13300AD3DCE /* Assets.xcassets */, + 5624A6BD1D80B13300AD3DCE /* Info.plist */, + ); + path = "GRDBDemoWatchOS Extension"; + sourceTree = ""; + }; 568C7A8D1CA6C63100796484 = { isa = PBXGroup; children = ( 568C7A981CA6C63100796484 /* GRDBDemoiOS */, + 5624A6A71D80B13300AD3DCE /* GRDBDemoWatchOS */, + 5624A6B61D80B13300AD3DCE /* GRDBDemoWatchOS Extension */, 568C7A971CA6C63100796484 /* Products */, ); sourceTree = ""; @@ -127,6 +292,8 @@ isa = PBXGroup; children = ( 568C7A961CA6C63100796484 /* GRDBDemoiOS.app */, + 5624A6A61D80B13300AD3DCE /* GRDBDemoWatchOS.app */, + 5624A6B21D80B13300AD3DCE /* GRDBDemoWatchOS Extension.appex */, ); name = Products; sourceTree = ""; @@ -151,11 +318,22 @@ isa = PBXGroup; children = ( 568C7ACF1CA6C6BF00796484 /* GRDB.framework */, - 568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */, 568C7AD31CA6C6BF00796484 /* GRDBTests.xctest */, 568C7AD51CA6C6BF00796484 /* GRDBOSXPerformanceTests.xctest */, + 568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */, + 5624A6D71D80B13400AD3DCE /* GRDBCipher.framework */, + 5624A6D91D80B13400AD3DCE /* GRDBTests.xctest */, + 5624A6DB1D80B13400AD3DCE /* GRDBCipherOSXEncryptedTests.xctest */, + 5624A6DD1D80B13400AD3DCE /* GRDBCustomSQLite.framework */, + 5624A6DF1D80B13400AD3DCE /* GRDBCustomSQLiteOSXTests.xctest */, 568C7AD71CA6C6BF00796484 /* GRDB.framework */, 568C7AD91CA6C6BF00796484 /* GRDBTests.xctest */, + 5624A6E11D80B13400AD3DCE /* GRDBCipher.framework */, + 5624A6E31D80B13400AD3DCE /* GRDBTests.xctest */, + 5624A6E51D80B13400AD3DCE /* GRDBTests.xctest */, + 5624A6E71D80B13400AD3DCE /* GRDBCustomSQLite.framework */, + 5624A6E91D80B13400AD3DCE /* GRDBCustomSQLiteiOSTests.xctest */, + 5624A6EB1D80B13400AD3DCE /* GRDB.framework */, ); name = Products; sourceTree = ""; @@ -174,6 +352,40 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 5624A6A51D80B13300AD3DCE /* GRDBDemoWatchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5624A6EE1D80B13400AD3DCE /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS" */; + buildPhases = ( + 5624A6A41D80B13300AD3DCE /* Resources */, + 5624A6ED1D80B13400AD3DCE /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 5624A6B51D80B13300AD3DCE /* PBXTargetDependency */, + ); + name = GRDBDemoWatchOS; + productName = GRDBDemoWatchOS; + productReference = 5624A6A61D80B13300AD3DCE /* GRDBDemoWatchOS.app */; + productType = "com.apple.product-type.application.watchapp2"; + }; + 5624A6B11D80B13300AD3DCE /* GRDBDemoWatchOS Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5624A6EC1D80B13400AD3DCE /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS Extension" */; + buildPhases = ( + 5624A6AE1D80B13300AD3DCE /* Sources */, + 5624A6AF1D80B13300AD3DCE /* Frameworks */, + 5624A6B01D80B13300AD3DCE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "GRDBDemoWatchOS Extension"; + productName = "GRDBDemoWatchOS Extension"; + productReference = 5624A6B21D80B13300AD3DCE /* GRDBDemoWatchOS Extension.appex */; + productType = "com.apple.product-type.watchkit2-extension"; + }; 568C7A951CA6C63100796484 /* GRDBDemoiOS */ = { isa = PBXNativeTarget; buildConfigurationList = 568C7AA81CA6C63100796484 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */; @@ -182,11 +394,13 @@ 568C7A931CA6C63100796484 /* Frameworks */, 568C7A941CA6C63100796484 /* Resources */, 568C7ADE1CA6C6D100796484 /* Embed Frameworks */, + 5624A6C01D80B13300AD3DCE /* Embed Watch Content */, ); buildRules = ( ); dependencies = ( 568C7ADD1CA6C6D100796484 /* PBXTargetDependency */, + 5624A6BF1D80B13300AD3DCE /* PBXTargetDependency */, ); name = GRDBDemoiOS; productName = GRDBDemoiOS; @@ -203,6 +417,13 @@ LastUpgradeCheck = 0730; ORGANIZATIONNAME = Pierlis; TargetAttributes = { + 5624A6A51D80B13300AD3DCE = { + CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = AMD8W895CT; + }; + 5624A6B11D80B13300AD3DCE = { + CreatedOnToolsVersion = 7.3.1; + }; 568C7A951CA6C63100796484 = { CreatedOnToolsVersion = 7.3; DevelopmentTeam = AMD8W895CT; @@ -229,11 +450,90 @@ projectRoot = ""; targets = ( 568C7A951CA6C63100796484 /* GRDBDemoiOS */, + 5624A6A51D80B13300AD3DCE /* GRDBDemoWatchOS */, + 5624A6B11D80B13300AD3DCE /* GRDBDemoWatchOS Extension */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 5624A6D71D80B13400AD3DCE /* GRDBCipher.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = GRDBCipher.framework; + remoteRef = 5624A6D61D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6D91D80B13400AD3DCE /* GRDBTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBTests.xctest; + remoteRef = 5624A6D81D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6DB1D80B13400AD3DCE /* GRDBCipherOSXEncryptedTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBCipherOSXEncryptedTests.xctest; + remoteRef = 5624A6DA1D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6DD1D80B13400AD3DCE /* GRDBCustomSQLite.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = GRDBCustomSQLite.framework; + remoteRef = 5624A6DC1D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6DF1D80B13400AD3DCE /* GRDBCustomSQLiteOSXTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBCustomSQLiteOSXTests.xctest; + remoteRef = 5624A6DE1D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6E11D80B13400AD3DCE /* GRDBCipher.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = GRDBCipher.framework; + remoteRef = 5624A6E01D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6E31D80B13400AD3DCE /* GRDBTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBTests.xctest; + remoteRef = 5624A6E21D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6E51D80B13400AD3DCE /* GRDBTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBTests.xctest; + remoteRef = 5624A6E41D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6E71D80B13400AD3DCE /* GRDBCustomSQLite.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = GRDBCustomSQLite.framework; + remoteRef = 5624A6E61D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6E91D80B13400AD3DCE /* GRDBCustomSQLiteiOSTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBCustomSQLiteiOSTests.xctest; + remoteRef = 5624A6E81D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5624A6EB1D80B13400AD3DCE /* GRDB.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = GRDB.framework; + remoteRef = 5624A6EA1D80B13400AD3DCE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 568C7ACF1CA6C6BF00796484 /* GRDB.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -279,6 +579,23 @@ /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + 5624A6A41D80B13300AD3DCE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5624A6AC1D80B13300AD3DCE /* Assets.xcassets in Resources */, + 5624A6AA1D80B13300AD3DCE /* Interface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5624A6B01D80B13300AD3DCE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5624A6BC1D80B13300AD3DCE /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 568C7A941CA6C63100796484 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -292,6 +609,17 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 5624A6AE1D80B13300AD3DCE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5624A6F11D80B1FB00AD3DCE /* Database.swift in Sources */, + 5624A6BA1D80B13300AD3DCE /* ExtensionDelegate.swift in Sources */, + 5624A6F31D80B23800AD3DCE /* Person.swift in Sources */, + 5624A6B81D80B13300AD3DCE /* InterfaceController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 568C7A921CA6C63100796484 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -309,6 +637,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 5624A6B51D80B13300AD3DCE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5624A6B11D80B13300AD3DCE /* GRDBDemoWatchOS Extension */; + targetProxy = 5624A6B41D80B13300AD3DCE /* PBXContainerItemProxy */; + }; + 5624A6BF1D80B13300AD3DCE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5624A6A51D80B13300AD3DCE /* GRDBDemoWatchOS */; + targetProxy = 5624A6BE1D80B13300AD3DCE /* PBXContainerItemProxy */; + }; 568C7ADD1CA6C6D100796484 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GRDBiOS; @@ -317,6 +655,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 5624A6A81D80B13300AD3DCE /* Interface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5624A6A91D80B13300AD3DCE /* Base */, + ); + name = Interface.storyboard; + sourceTree = ""; + }; 568C7A9D1CA6C63100796484 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -336,6 +682,70 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 5624A6C21D80B13400AD3DCE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + IBSC_MODULE = GRDBDemoWatchOS_Extension; + INFOPLIST_FILE = GRDBDemoWatchOS/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = GRDB.GRDBDemoiOS.watchkitapp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Debug; + }; + 5624A6C31D80B13400AD3DCE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + IBSC_MODULE = GRDBDemoWatchOS_Extension; + INFOPLIST_FILE = GRDBDemoWatchOS/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = GRDB.GRDBDemoiOS.watchkitapp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Release; + }; + 5624A6C41D80B13400AD3DCE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = "GRDBDemoWatchOS Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = GRDB.GRDBDemoiOS.watchkitapp.watchkitextension; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Debug; + }; + 5624A6C51D80B13400AD3DCE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = "GRDBDemoWatchOS Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = GRDB.GRDBDemoiOS.watchkitapp.watchkitextension; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Release; + }; 568C7AA61CA6C63100796484 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -454,6 +864,22 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 5624A6EC1D80B13400AD3DCE /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5624A6C41D80B13400AD3DCE /* Debug */, + 5624A6C51D80B13400AD3DCE /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 5624A6EE1D80B13400AD3DCE /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5624A6C21D80B13400AD3DCE /* Debug */, + 5624A6C31D80B13400AD3DCE /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 568C7A911CA6C63100796484 /* Build configuration list for PBXProject "GRDBDemoiOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme b/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme index 72ee9f5dd..3b312fa83 100644 --- a/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme +++ b/GRDB.xcodeproj/xcshareddata/xcschemes/GRDBWatchOS.xcscheme @@ -15,7 +15,7 @@ @@ -46,7 +46,7 @@ @@ -64,7 +64,7 @@ From 55f07e913a95f8121433cf96073a6112bbbd95e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 7 Sep 2016 22:59:03 +0200 Subject: [PATCH 14/14] v0.80.0 --- CHANGELOG.md | 8 ++++++-- GRDB.swift.podspec | 2 +- README.md | 18 +++++++++--------- Support/Info.plist | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 001caf2a4..ee7c22bb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ Release Notes ============= -## Next Version +## 0.80.0 + +Released September 7, 2016 **Fixed** @@ -9,7 +11,9 @@ Release Notes **New** -- `QueryInterfaceRequest.deleteAll(db)` deletes matching database rows: +- WatchOS support + +- `QueryInterfaceRequest.deleteAll()` deletes database rows: ```swift try Wine.filter(corked == true).deleteAll(db) diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index c53399ff1..f288855f9 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GRDB.swift' - s.version = '0.79.4' + s.version = '0.80.0' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A Swift application toolkit for SQLite databases.' s.homepage = 'https://github.com/groue/GRDB.swift' diff --git a/README.md b/README.md index f3acfbe1c..e73c72bea 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ GRDB.swift [![Swift](https://img.shields.io/badge/swift-2.2-orange.svg?style=fla ### A Swift application toolkit for SQLite databases. -**Latest release**: August 17, 2016 • version 0.79.4 • [CHANGELOG](CHANGELOG.md) +**Latest release**: September 7, 2016 • version 0.80.0 • [CHANGELOG](CHANGELOG.md) **Requirements**: iOS 8.0+ / OSX 10.9+ • Xcode 7.3+ • Swift 2.2 (see the [Swift3](https://github.com/groue/GRDB.swift/tree/Swift3) branch for Swift 3). @@ -163,7 +163,7 @@ Documentation **Reference** -- [GRDB Reference](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/index.html) (on cocoadocs.org) +- [GRDB Reference](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/index.html) (on cocoadocs.org) **Getting Started** @@ -335,7 +335,7 @@ let dbQueue = try DatabaseQueue( configuration: config) ``` -See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Structs/Configuration.html) for more details. +See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Structs/Configuration.html) for more details. ## Database Pools @@ -415,7 +415,7 @@ let dbPool = try DatabasePool( configuration: config) ``` -See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Structs/Configuration.html) for more details. +See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Structs/Configuration.html) for more details. Database pools are more memory-hungry than database queues. See [Memory Management](#memory-management) for more information. @@ -1514,10 +1514,10 @@ for person in Person.fetch(db, sql, adapter: adapter) { For more information about row adapters, see the documentation of: -- [RowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Protocols/RowAdapter.html): the protocol that lets you define your custom row adapters -- [ColumnMapping](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Structs/ColumnMapping.html): a row adapter that renames row columns -- [SuffixRowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Structs/SuffixRowAdapter.html): a row adapter that hides the first columns of a row -- [ScopeAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Structs/ScopeAdapter.html): the row adapter that groups several adapters together to define scopes +- [RowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Protocols/RowAdapter.html): the protocol that lets you define your custom row adapters +- [ColumnMapping](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Structs/ColumnMapping.html): a row adapter that renames row columns +- [SuffixRowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Structs/SuffixRowAdapter.html): a row adapter that hides the first columns of a row +- [ScopeAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Structs/ScopeAdapter.html): the row adapter that groups several adapters together to define scopes ## Raw SQLite Pointers @@ -3733,7 +3733,7 @@ let count2 = dbQueue.inDatabase { db in SQLite concurrency is a wiiide topic. -First have a detailed look at the full API of [DatabaseQueue](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Classes/DatabaseQueue.html) and [DatabasePool](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Classes/DatabasePool.html). Both adopt the [DatabaseReader](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Protocols/DatabaseReader.html) and [DatabaseWriter](http://cocoadocs.org/docsets/GRDB.swift/0.79.4/Protocols/DatabaseWriter.html) protocols, so that you can write code that targets both classes. +First have a detailed look at the full API of [DatabaseQueue](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Classes/DatabaseQueue.html) and [DatabasePool](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Classes/DatabasePool.html). Both adopt the [DatabaseReader](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Protocols/DatabaseReader.html) and [DatabaseWriter](http://cocoadocs.org/docsets/GRDB.swift/0.80.0/Protocols/DatabaseWriter.html) protocols, so that you can write code that targets both classes. If the built-in queues and pools do not fit your needs, or if you can not guarantee that a single queue or pool is accessing your database file, you may have a look at: diff --git a/Support/Info.plist b/Support/Info.plist index 66607ff3e..456e4f527 100644 --- a/Support/Info.plist +++ b/Support/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.79.4 + 0.80.0 CFBundleSignature ???? CFBundleVersion