fluent-kit
1.47.2
Swift ORM (queries, models, and relations) for NoSQL and SQL databases
vapor/fluent-kit
What's New
1.47.2 - Skip DB execution when all ids for @OptionalParent are nil
2024-03-23T01:37:57Z
What's Changed
Skip DB execution when all ids for @OptionalParent are nil by @mtj0928 in #583
OptionalParentEagerLoader
doesn’t need to fetchTo
objects when all ids of the given models arenil
, because the results of the DB execution will always be empty.Therefore, I’ve modified the logic to skip the DB execution in such cases to improve performance.
New Contributor
This patch was released by @gwynne
Full Changelog: 1.47.1...1.47.2
Description
- Swift Tools 5.6.0
Description
{ "name": "fluent-kit", "path": "/usr/src/package", "targets": [ { "name": "XCTFluent", "path": "Sources/XCTFluent", "type": "library", "c99name": "XCTFluent", "sources": [ "DummyDatabase.swift", "TestDatabase.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "XCTFluent" ], "target_dependencies": [ "FluentKit" ], "product_dependencies": [ "NIOEmbedded" ] }, { "name": "FluentSQL", "path": "Sources/FluentSQL", "type": "library", "c99name": "FluentSQL", "sources": [ "DatabaseQuery+SQL.swift", "DatabaseSchema+SQL.swift", "Exports.swift", "SQLDatabase+Model+Concurrency.swift", "SQLDatabase+Model.swift", "SQLJSONColumnPath.swift", "SQLList+Deprecated.swift", "SQLQualifiedTable.swift", "SQLQueryConverter.swift", "SQLSchemaConverter.swift", "Utilities.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "FluentBenchmark", "FluentSQL" ], "target_dependencies": [ "FluentKit" ], "product_dependencies": [ "SQLKit" ] }, { "name": "FluentKitTests", "path": "Tests/FluentKitTests", "type": "test", "c99name": "FluentKitTests", "sources": [ "AsyncTests/AsyncFilterQueryTests.swift", "AsyncTests/AsyncFluentKitTests.swift", "AsyncTests/AsyncQueryBuilderTests.swift", "CompositeIDTests.swift", "DummyDatabaseForTestSQLSerializer.swift", "FilterQueryTests.swift", "FluentKitTests.swift", "OptionalEnumQueryTests.swift", "OptionalFieldQueryTests.swift", "QueryBuilderTests.swift", "TestUtilities.swift" ], "module_type": "SwiftTarget", "target_dependencies": [ "FluentBenchmark", "FluentSQL", "XCTFluent" ] }, { "name": "FluentKit", "path": "Sources/FluentKit", "type": "library", "c99name": "FluentKit", "sources": [ "Concurrency/AsyncMigration.swift", "Concurrency/AsyncModelMiddleware.swift", "Concurrency/Children+Concurrency.swift", "Concurrency/Database+Concurrency.swift", "Concurrency/EnumBuilder+Concurrency.swift", "Concurrency/Model+Concurrency.swift", "Concurrency/ModelResponder+Concurrency.swift", "Concurrency/OptionalChild+Concurrency.swift", "Concurrency/OptionalParent+Concurrency.swift", "Concurrency/Parent+Concurrency.swift", "Concurrency/QueryBuilder+Concurrency.swift", "Concurrency/Relation+Concurrency.swift", "Concurrency/SchemaBuilder+Concurrency.swift", "Concurrency/Siblings+Concurrency.swift", "Database/Database+Logging.swift", "Database/Database.swift", "Database/DatabaseID.swift", "Database/DatabaseInput.swift", "Database/DatabaseOutput.swift", "Database/Databases.swift", "Database/KeyPrefixingStrategy.swift", "Database/TransactionControlDatabase.swift", "Enum/DatabaseEnum.swift", "Enum/EnumBuilder.swift", "Enum/EnumMetadata.swift", "Enum/EnumProperty.swift", "Enum/OptionalEnumProperty.swift", "Exports.swift", "FluentError.swift", "Middleware/ModelMiddleware.swift", "Middleware/ModelResponder.swift", "Migration/Migration.swift", "Migration/MigrationLog.swift", "Migration/Migrations.swift", "Migration/Migrator.swift", "Model/AnyModel.swift", "Model/EagerLoad.swift", "Model/Fields+Codable.swift", "Model/Fields.swift", "Model/MirrorBypass.swift", "Model/Model+CRUD.swift", "Model/Model.swift", "Model/ModelAlias.swift", "Model/Schema.swift", "Operators/FieldOperators.swift", "Operators/Operators.swift", "Operators/ValueOperators+Array.swift", "Operators/ValueOperators+String.swift", "Operators/ValueOperators.swift", "Properties/Boolean.swift", "Properties/BooleanPropertyFormat.swift", "Properties/Children.swift", "Properties/CompositeChildren.swift", "Properties/CompositeID.swift", "Properties/CompositeOptionalChild.swift", "Properties/CompositeOptionalParent.swift", "Properties/CompositeParent.swift", "Properties/Field.swift", "Properties/FieldKey.swift", "Properties/Group.swift", "Properties/ID.swift", "Properties/OptionalBoolean.swift", "Properties/OptionalChild.swift", "Properties/OptionalField.swift", "Properties/OptionalParent.swift", "Properties/Parent.swift", "Properties/Property.swift", "Properties/Relation.swift", "Properties/Siblings.swift", "Properties/Timestamp.swift", "Properties/TimestampFormat.swift", "Query/Builder/QueryBuilder+Aggregate.swift", "Query/Builder/QueryBuilder+EagerLoad.swift", "Query/Builder/QueryBuilder+Filter.swift", "Query/Builder/QueryBuilder+Group.swift", "Query/Builder/QueryBuilder+Join+DirectRelations.swift", "Query/Builder/QueryBuilder+Join.swift", "Query/Builder/QueryBuilder+Paginate.swift", "Query/Builder/QueryBuilder+Range.swift", "Query/Builder/QueryBuilder+Set.swift", "Query/Builder/QueryBuilder+Sort.swift", "Query/Builder/QueryBuilder.swift", "Query/Database/DatabaseQuery+Action.swift", "Query/Database/DatabaseQuery+Aggregate.swift", "Query/Database/DatabaseQuery+Field.swift", "Query/Database/DatabaseQuery+Filter.swift", "Query/Database/DatabaseQuery+Join.swift", "Query/Database/DatabaseQuery+Range.swift", "Query/Database/DatabaseQuery+Sort.swift", "Query/Database/DatabaseQuery+Value.swift", "Query/Database/DatabaseQuery.swift", "Query/QueryHistory.swift", "Schema/DatabaseSchema.swift", "Schema/SchemaBuilder.swift", "Utilities/OptionalType.swift", "Utilities/RandomGeneratable.swift", "Utilities/SomeCodingKey.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "FluentKit", "FluentBenchmark", "FluentSQL", "XCTFluent" ], "product_dependencies": [ "NIOCore", "Logging", "AsyncKit", "SQLKit" ] }, { "name": "FluentBenchmark", "path": "Sources/FluentBenchmark", "type": "library", "c99name": "FluentBenchmark", "sources": [ "Exports.swift", "FluentBenchmarker.swift", "SolarSystem/GalacticJurisdiction.swift", "SolarSystem/Galaxy.swift", "SolarSystem/Governor.swift", "SolarSystem/Jurisdiction.swift", "SolarSystem/Moon.swift", "SolarSystem/Planet.swift", "SolarSystem/PlanetTag.swift", "SolarSystem/SolarSystem.swift", "SolarSystem/Star.swift", "SolarSystem/Tag.swift", "Tests/AggregateTests.swift", "Tests/ArrayTests.swift", "Tests/BatchTests.swift", "Tests/CRUDTests.swift", "Tests/ChildTests.swift", "Tests/ChildrenTests.swift", "Tests/ChunkTests.swift", "Tests/CodableTests.swift", "Tests/CompositeIDTests.swift", "Tests/CompositeRelationTests.swift", "Tests/EagerLoadTests.swift", "Tests/EnumTests.swift", "Tests/FilterTests.swift", "Tests/GroupTests.swift", "Tests/IDTests.swift", "Tests/JoinTests.swift", "Tests/MiddlewareTests.swift", "Tests/MigratorTests.swift", "Tests/ModelTests.swift", "Tests/OptionalParentTests.swift", "Tests/PaginationTests.swift", "Tests/ParentTests.swift", "Tests/PerformanceTests+Siblings.swift", "Tests/PerformanceTests.swift", "Tests/RangeTests.swift", "Tests/SQLTests.swift", "Tests/SchemaTests.swift", "Tests/SetTests.swift", "Tests/SiblingsTests.swift", "Tests/SoftDeleteTests.swift", "Tests/SortTests.swift", "Tests/TimestampTests.swift", "Tests/TransactionTests.swift", "Tests/UniqueTests.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "FluentBenchmark" ], "target_dependencies": [ "FluentKit", "FluentSQL" ] } ], "products": [ { "name": "FluentKit", "type": { "library": [ "automatic" ] }, "targets": [ "FluentKit" ] }, { "name": "FluentBenchmark", "type": { "library": [ "automatic" ] }, "targets": [ "FluentBenchmark" ] }, { "name": "FluentSQL", "type": { "library": [ "automatic" ] }, "targets": [ "FluentSQL" ] }, { "name": "XCTFluent", "type": { "library": [ "automatic" ] }, "targets": [ "XCTFluent" ] } ], "platforms": [ { "name": "macos", "version": "10.15" }, { "name": "ios", "version": "13.0" }, { "name": "watchos", "version": "6.0" }, { "name": "tvos", "version": "13.0" } ], "dependencies": [ { "url": "https://github.com/apple/swift-nio.git", "type": "sourceControl", "identity": "swift-nio", "requirement": { "range": [ { "lower_bound": "2.55.0", "upper_bound": "3.0.0" } ] } }, { "url": "https://github.com/apple/swift-log.git", "type": "sourceControl", "identity": "swift-log", "requirement": { "range": [ { "lower_bound": "1.5.2", "upper_bound": "2.0.0" } ] } }, { "url": "https://github.com/vapor/sql-kit.git", "type": "sourceControl", "identity": "sql-kit", "requirement": { "range": [ { "lower_bound": "3.28.0", "upper_bound": "4.0.0" } ] } }, { "url": "https://github.com/vapor/async-kit.git", "type": "sourceControl", "identity": "async-kit", "requirement": { "range": [ { "lower_bound": "1.17.0", "upper_bound": "2.0.0" } ] } } ], "tools_version": "5.6", "manifest_display_name": "fluent-kit" }
Package Dump
{ "name": "fluent-kit", "targets": [ { "name": "FluentKit", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "product": [ "NIOCore", "swift-nio", null, null ] }, { "product": [ "Logging", "swift-log", null, null ] }, { "product": [ "AsyncKit", "async-kit", null, null ] }, { "product": [ "SQLKit", "sql-kit", null, null ] } ], "packageAccess": false }, { "name": "FluentBenchmark", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "target": [ "FluentKit", null ] }, { "target": [ "FluentSQL", null ] } ], "packageAccess": false }, { "name": "FluentSQL", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "target": [ "FluentKit", null ] }, { "product": [ "SQLKit", "sql-kit", null, null ] } ], "packageAccess": false }, { "name": "XCTFluent", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "target": [ "FluentKit", null ] }, { "product": [ "NIOEmbedded", "swift-nio", null, null ] } ], "packageAccess": false }, { "name": "FluentKitTests", "type": "test", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "target": [ "FluentBenchmark", null ] }, { "target": [ "FluentSQL", null ] }, { "target": [ "XCTFluent", null ] } ], "packageAccess": false } ], "products": [ { "name": "FluentKit", "type": { "library": [ "automatic" ] }, "targets": [ "FluentKit" ] }, { "name": "FluentBenchmark", "type": { "library": [ "automatic" ] }, "targets": [ "FluentBenchmark" ] }, { "name": "FluentSQL", "type": { "library": [ "automatic" ] }, "targets": [ "FluentSQL" ] }, { "name": "XCTFluent", "type": { "library": [ "automatic" ] }, "targets": [ "XCTFluent" ] } ], "pkgConfig": null, "platforms": [ { "options": [], "version": "10.15", "platformName": "macos" }, { "options": [], "version": "13.0", "platformName": "ios" }, { "options": [], "version": "6.0", "platformName": "watchos" }, { "options": [], "version": "13.0", "platformName": "tvos" } ], "providers": null, "packageKind": { "root": [ "/usr/src/package" ] }, "dependencies": [ { "sourceControl": [ { "identity": "swift-nio", "location": { "remote": [ { "urlString": "https://github.com/apple/swift-nio.git" } ] }, "requirement": { "range": [ { "lowerBound": "2.55.0", "upperBound": "3.0.0" } ] }, "productFilter": null } ] }, { "sourceControl": [ { "identity": "swift-log", "location": { "remote": [ { "urlString": "https://github.com/apple/swift-log.git" } ] }, "requirement": { "range": [ { "lowerBound": "1.5.2", "upperBound": "2.0.0" } ] }, "productFilter": null } ] }, { "sourceControl": [ { "identity": "sql-kit", "location": { "remote": [ { "urlString": "https://github.com/vapor/sql-kit.git" } ] }, "requirement": { "range": [ { "lowerBound": "3.28.0", "upperBound": "4.0.0" } ] }, "productFilter": null } ] }, { "sourceControl": [ { "identity": "async-kit", "location": { "remote": [ { "urlString": "https://github.com/vapor/async-kit.git" } ] }, "requirement": { "range": [ { "lowerBound": "1.17.0", "upperBound": "2.0.0" } ] }, "productFilter": null } ] } ], "toolsVersion": { "_version": "5.6.0" }, "cLanguageStandard": null, "cxxLanguageStandard": null, "swiftLanguageVersions": null }
Dependencies
Dependencies
{ "url": "/usr/src/package", "name": "fluent-kit", "path": "/usr/src/package", "version": "unspecified", "identity": "package", "dependencies": [ { "url": "https://github.com/apple/swift-nio.git", "name": "swift-nio", "path": "/usr/src/package/.build/checkouts/swift-nio", "version": "2.64.0", "identity": "swift-nio", "dependencies": [ { "url": "https://github.com/apple/swift-atomics.git", "name": "swift-atomics", "path": "/usr/src/package/.build/checkouts/swift-atomics", "version": "1.2.0", "identity": "swift-atomics", "dependencies": [] }, { "url": "https://github.com/apple/swift-collections.git", "name": "swift-collections", "path": "/usr/src/package/.build/checkouts/swift-collections", "version": "1.1.0", "identity": "swift-collections", "dependencies": [] }, { "url": "https://github.com/apple/swift-system.git", "name": "swift-system", "path": "/usr/src/package/.build/checkouts/swift-system", "version": "1.2.1", "identity": "swift-system", "dependencies": [] } ] }, { "url": "https://github.com/apple/swift-log.git", "name": "swift-log", "path": "/usr/src/package/.build/checkouts/swift-log", "version": "1.5.4", "identity": "swift-log", "dependencies": [] }, { "url": "https://github.com/vapor/sql-kit.git", "name": "sql-kit", "path": "/usr/src/package/.build/checkouts/sql-kit", "version": "3.29.0", "identity": "sql-kit", "dependencies": [ { "url": "https://github.com/apple/swift-nio.git", "name": "swift-nio", "path": "/usr/src/package/.build/checkouts/swift-nio", "version": "2.64.0", "identity": "swift-nio", "dependencies": [ { "url": "https://github.com/apple/swift-atomics.git", "name": "swift-atomics", "path": "/usr/src/package/.build/checkouts/swift-atomics", "version": "1.2.0", "identity": "swift-atomics", "dependencies": [] }, { "url": "https://github.com/apple/swift-collections.git", "name": "swift-collections", "path": "/usr/src/package/.build/checkouts/swift-collections", "version": "1.1.0", "identity": "swift-collections", "dependencies": [] }, { "url": "https://github.com/apple/swift-system.git", "name": "swift-system", "path": "/usr/src/package/.build/checkouts/swift-system", "version": "1.2.1", "identity": "swift-system", "dependencies": [] } ] }, { "url": "https://github.com/apple/swift-log.git", "name": "swift-log", "path": "/usr/src/package/.build/checkouts/swift-log", "version": "1.5.4", "identity": "swift-log", "dependencies": [] }, { "url": "https://github.com/apple/swift-collections.git", "name": "swift-collections", "path": "/usr/src/package/.build/checkouts/swift-collections", "version": "1.1.0", "identity": "swift-collections", "dependencies": [] } ] }, { "url": "https://github.com/vapor/async-kit.git", "name": "async-kit", "path": "/usr/src/package/.build/checkouts/async-kit", "version": "1.19.0", "identity": "async-kit", "dependencies": [ { "url": "https://github.com/apple/swift-nio.git", "name": "swift-nio", "path": "/usr/src/package/.build/checkouts/swift-nio", "version": "2.64.0", "identity": "swift-nio", "dependencies": [ { "url": "https://github.com/apple/swift-atomics.git", "name": "swift-atomics", "path": "/usr/src/package/.build/checkouts/swift-atomics", "version": "1.2.0", "identity": "swift-atomics", "dependencies": [] }, { "url": "https://github.com/apple/swift-collections.git", "name": "swift-collections", "path": "/usr/src/package/.build/checkouts/swift-collections", "version": "1.1.0", "identity": "swift-collections", "dependencies": [] }, { "url": "https://github.com/apple/swift-system.git", "name": "swift-system", "path": "/usr/src/package/.build/checkouts/swift-system", "version": "1.2.1", "identity": "swift-system", "dependencies": [] } ] }, { "url": "https://github.com/apple/swift-log.git", "name": "swift-log", "path": "/usr/src/package/.build/checkouts/swift-log", "version": "1.5.4", "identity": "swift-log", "dependencies": [] }, { "url": "https://github.com/apple/swift-collections.git", "name": "swift-collections", "path": "/usr/src/package/.build/checkouts/swift-collections", "version": "1.1.0", "identity": "swift-collections", "dependencies": [] }, { "url": "https://github.com/apple/swift-algorithms.git", "name": "swift-algorithms", "path": "/usr/src/package/.build/checkouts/swift-algorithms", "version": "1.2.0", "identity": "swift-algorithms", "dependencies": [ { "url": "https://github.com/apple/swift-numerics.git", "name": "swift-numerics", "path": "/usr/src/package/.build/checkouts/swift-numerics", "version": "1.0.2", "identity": "swift-numerics", "dependencies": [] } ] } ] } ] }