Skip to content

Commit

Permalink
Fix overload of fetchObjects
Browse files Browse the repository at this point in the history
Wasn't picking up the dictionary one
for dictionaries.
  • Loading branch information
helje5 committed Nov 30, 2024
1 parent e266a9f commit 4b83aa5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/ZeeQL/Access/AccessDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ public extension AccessDataSourceType {
* - keysAndValues: The key/value pairs to apply as bindings.
* - Returns: The fetched objects.
*/
@inlinable
func fetchObjects(_ fetchSpecificationName: String,
_ binds: [ String : Any ]) throws -> [ Object ]
_ binds: [ String : Any ] = [:]) throws -> [ Object ]
{
guard let findEntity = entity else {
// TBD: improve exception
Expand Down Expand Up @@ -222,9 +223,12 @@ public extension AccessDataSourceType {
* - Returns: The fetched objects.
*/
func fetchObjects(_ fetchSpecificationName: String,
_ firstKey: String, _ firstValue: Any,
_ keysAndValues: Any...) throws -> [ Object ]
{
try fetchObjects(fetchSpecificationName, .createArgs(keysAndValues))
var binds = [ String: Any ].createArgs(keysAndValues)
binds[firstKey] = firstValue
return try fetchObjects(fetchSpecificationName, binds)
}

// MARK: - Bindings
Expand Down

0 comments on commit 4b83aa5

Please sign in to comment.