From f5cef91a9968dd8307a4fb578ad447810cd6002d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Sun, 10 Nov 2024 17:05:03 +0100 Subject: [PATCH] Minor improv to datasource accessor If the type is known, this will work: ```swift let personDS: OGoPersonDataSource = db.datasource() ``` --- Sources/ZeeQL/Access/ActiveDataSource.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/ZeeQL/Access/ActiveDataSource.swift b/Sources/ZeeQL/Access/ActiveDataSource.swift index 1c3e2e3..9d68fd1 100644 --- a/Sources/ZeeQL/Access/ActiveDataSource.swift +++ b/Sources/ZeeQL/Access/ActiveDataSource.swift @@ -3,7 +3,7 @@ // ZeeQL // // Created by Helge Hess on 27/02/17. -// Copyright © 2017 ZeeZide GmbH. All rights reserved. +// Copyright © 2017-2024 ZeeZide GmbH. All rights reserved. // /** @@ -211,9 +211,10 @@ fileprivate let countAttr : Attribute = { public extension Database { - func datasource(_ type: Object.Type) -> ActiveDataSource { - // use type argument to capture, is there a nicer way? + @inlinable + func datasource(_ type: Object.Type = Object.self) + -> ActiveDataSource + { return ActiveDataSource(database: self) } - }