orlandos-nl / MongoKitten

Native MongoDB driver for Swift, written in Swift

Home Page:https://orlandos.nl/docs/mongokitten/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type 'DNSClient' has no member 'connectTS'

saroar opened this issue · comments

Here is error

Type 'DNSClient' has no member 'connectTS' from MongoCluster file

Screenshot 2020-03-17 at 12 37 04 PM

Server-side Swift:

  • OS: macOS
  • Swift Version: [e.g. 5.2]
  • MongoKitten Version [e.g. 6.0.0]

Additional context
Add any other context about the problem here.

Hey, sorry that I missed this issue. Were you using mobile/6.0 by any chance?

I’m experiencing the same issue on master/6.0 and I feel like I’ve tried everything to get it to compile but no dice. 😓

@freyaariel what platform are you building for?

@Joannis this is when building for iOS (inside a Swift package, not Xcode project, if that matters).

It’s weird because I can clearly see that the connectTS() method exists in DNSClient.

Building for macOS works fine; watchOS and tvOS too (after adding these platforms to Package.swift), so it seems like an issue with NIO Transport Services or somehow with the #if canImport(NIOTransportServices) && os(iOS) conditionals.

@freyaariel MongoKitten doesn't support iOS on this branch, even though there's an #if os(iOS) condition. The branch where I maintain iOS support is mobile/6.0, and unless you really know what you're doing I highly suggest not using MongoKitten on an iOS device. In order to connect to MongoDB (or any other database) you'll need to embed the credentials in the binary. At that point hacking your application is trivial.

Thank you for the quick reply and thanks pointing me in the right direction, @Joannis, and I appreciate the security disclaimer also. I’m trying to make an app that can display results of arbitrary queries in widgets. Users input their own server info so no credentials are embedded in this case.

It compiles successfully for iOS using mobile/6.0. ✅🎉

Looks like you're building a competitor to my app :) Good luck!