RxSwiftCommunity / RxGRDB

Reactive extensions for SQLite
MIT License
218 stars 35 forks source link

Does RxGRDB work with GRDBPlus? #47

Closed siegesmund closed 5 years ago

siegesmund commented 6 years ago

Attempting to add RxGRDB to a medium sized macOS app causes errors to methods that use FTS5:

"Use of unresolved identifier 'FTS5'" and "Value of type 'Database' has no member 'makeFTS5Pattern'"

The application tests, compiles and runs without RxGRDB.

groue commented 6 years ago

Hello @siegesmund,

It is not currently possible, but this is a good idea!

Would you please submit a pull request against the develop branch? We'd need a new subspec named RxGRDB/GRDBPlus in the RxGRDB.podspec file, and an update to the Installation documentation.

groue commented 6 years ago

Any news, @siegesmund?

siegesmund commented 6 years ago

Just saw this. Will do.

groue commented 6 years ago

That's super cool, thank you :-)

groue commented 5 years ago

@siegesmund, this issue is no longer active, and I close it. Your pull request will be super welcome when you're ready!

davidkraus commented 5 years ago

Tried to put a PR together but getting the same problems as you had with Cocoapods and different deployment_target versions for subspecs.

When i introduce a new Subspec:

  s.subspec 'GRDBPlus' do |ss|
    ss.source_files = 'RxGRDB/**/*.{h,swift}'
    ss.dependency "GRDBPlus", "~> 3.5"
  end

i specify GRDBPlus as a dependency but then my project won't build since RxGRDB has a deployment_target lower than that of GRDBPlus.

What do you think - build a RxGRDBPlus 😅 podspec ?

groue commented 5 years ago

Hello @davidkraus,

GRDBPlus has always been all about FTS5. Support for this full-text engine is the only reason why one would want to use GRDBPlus. So I'll assume that you want FTS5.

I slightly regret having shipped GRDBPlus. Another option, I believe, would have been to document how to enable FTS5 with the regular GRDB, along with a warning about deployment targets. Something like:

To use the FTS5 engine that ships with the SQLite library embedded in the operating system, make sure your deployment target is iOS 11.4+, macOS 10.13+, watchOS 4.3+, and append those lines to your Podfile:

# Here the Ruby code that adds the `-D SQLITE_ENABLE_FTS5` to GRDB compiler flags

This is the direction I suggest you look into. And if it succeeds, please tell us the details, so that we can package it in a nice updated documentation for everybody!

groue commented 5 years ago

@davidkraus, I reopen the issue, waiting for your feedback, because I really hope we can find a way out of GRDBPlus.

davidkraus commented 5 years ago

thanks got it working via the compiler flags 👍. Should i put a PR together that documents this in the GRDB Readme?

What to do with GRDBPlus is up to you:

groue commented 5 years ago

@davidkraus, this is great, thank you very much!

Should i put a PR together that documents this in the GRDB Readme?

Yes! Please target the master branch, because this change does not need a version bump.

What to do with GRDBPlus is up to you:

  • deprecate it -> do not mention it anywhere so it dies a slow death. Cocoapods has spec.deprecated = true and spec.deprecated_in_favor_of = 'GRDB'
  • keep updating -> Just document everything: you can use GRDBPlus but not with RxGRDB. If you want to use RxGRDB with FTS5 use this compiler flag ...

Let's pick the deprecation path: it will avoid other people falling in the trap you have experienced (start with GRDBPlus, and later block on RxGRDB). In your GRDB PR, just remove all mentions of GRDBPlus. I'll take care of the deprecated/deprecated_in_favor_of spec options (and thanks for hinting me at those flags).

👍

groue commented 5 years ago

Closing now that an answer has been found:

Does RxGRDB work with GRDBPlus?

Yes, but you have to switch from the GRDBPlus CocoaPod to the regular GRDB.swift CocoaPod. See the updated Enabling FTS5 Support paragraph in GRDB documentation for details.