stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.64k stars 1.56k forks source link

Ambiguous use of 'SQLITE_DETERMINISTIC' #986

Closed casperson closed 3 years ago

casperson commented 4 years ago

Xcode Version: 11.3.1 Using Cocoapods

We integrate SQLCipher in with this using the method: pod 'SQLite.swift/SQLCipher', '0.12.2'

I did a pod update that bumped SQLCipher from 4.2.0 (what we had previously) to 4.3.0 and now our Podfile.lock looks like this:

    - SQLCipher/standard (= 4.3.0)
  - SQLCipher/common (4.3.0)
  - SQLCipher/standard (4.3.0):
    - SQLCipher/common
  - SQLite.swift/SQLCipher (0.12.2):
    - SQLCipher (>= 3.4.0)

It was previously this:

    - SQLCipher/standard (= 4.2.0)
  - SQLCipher/common (4.2.0)
  - SQLCipher/standard (4.2.0):
    - SQLCipher/common
  - SQLite.swift/SQLCipher (0.12.2):
    - SQLCipher (>= 3.4.0)

With the update it fails to build giving the issue Ambiguous use of 'SQLITE_DETERMINISTIC' Looks like there's conflicting values in SQLCipher and SQLite. The issue arises in Connection.swift

Screen Shot 2020-02-06 at 12 51 57 PM

ToForgive commented 4 years ago

There's something wrong with SQLCipher

Modify the Podfile like this:

pod 'SQLCipher', '= 4.2.0'
pod 'SQLite.swift/SQLCipher', '~> 0.12.2'

It's work for me!

casperson commented 4 years ago

@ToForgive I understand that that works, since that is the version of SQLCipher we are on currently, as you can see in my Podfile.lock that I shared above. But that doesn't solve the problem of updating to the latest version of SQLCipher. If SQLite.swift claims to support SQLCipher (as it does) then it should support the latest version, or say that it only supports up through 4.2.0. It seems like a naming collision with SQLCipher should be the responsibility of this repo to resolve within SQLCipher.swift.

docpitz commented 4 years ago

In the meantime SQLCipher 4.4.0 is active. Is there any way to stay up-to-date? Especially with an encrypted database you should try to stay as up to date as possible.

docpitz commented 4 years ago

@stephencelis I have built a simple fix for this problem. Can you please put it into your master?

markm77 commented 4 years ago

I get this problem with pod 'SQLite.swift/standalone'. Any workarounds?

nitrag commented 4 years ago

Oops, bump @stephencelis

womandroid commented 3 years ago

I also have this problem for no reason.

pod 'SQLCipher', '3.4.2'
pod 'SQLite.swift/SQLCipher','~> 0.11.5' 

This is an old project. I didn't update anything, and I didn't have this problem before, but now it suddenly appears. I've tried to update SQLCipher to 4.4.0, but then I can't open the encrypted file encrypted by 3.4.2. Now I can only use the temporary solution, replace the SQLITE_DETERMINISTIC with 0x800, But I don't know if there will be any unexpected problems here.

Tybion commented 3 years ago

I also have this problem with ..

pod 'SQLCipher', '3.4.2'
pod 'SQLite.swift/SQLCipher','~> 0.12.2'

.. after upgrading Xcode to version 12.5 (from 11.something)

Tybion commented 3 years ago

I think this Xcode upgrade is also an upgrade from Swift 5.1 to 5.4

marain87 commented 3 years ago

1009 may help you.

Tybion commented 3 years ago

@marain87 Thanks for your help.

Now, my Podfile is ..

pod 'SQLCipher', '3.4.2'
pod 'SQLite.swift/standalone', :git => 'https://github.com/stephencelis/SQLite.swift', :branch => 'master'
# sqlite3 3.35.5 is installed automatically

Now I get just one Fatal error from app build ..

SQLite.swift - 1 issue Lexical or Preprocessor Issue /Users/david/XcodeProjects/ausgeologymaps/Pods/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:9: 'sqlite3.h' file not found

Also lots of messages for sqlite3 like so (for 'MIN' & 'MAX') ..

/Users/david/XcodeProjects/ausgeologymaps/Pods/sqlite3/sqlite-amalgamation-3350500/sqlite3.c:72194:16: Ambiguous expansion of macro 'MIN'

nathanfallet commented 3 years ago

Should be fixed in 0.13.0. If not, please reopen this issue.