Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Non-functional custom SQL functions in Swift 2 version (update+check docs) #266

Closed
voltaek opened this issue Nov 3, 2015 · 2 comments
Closed
Milestone

Comments

@voltaek
Copy link

voltaek commented Nov 3, 2015

When trying to declare a custom SQL function as shown in the documentation, I'm getting an error of "Cannot invoke 'createFunction' with an argument list of type '(String, deterministic: Bool, (CFString, CFString) -> Bool)'". This error happens even when trying to use the exact example given in the documentation. These declarations were operating fine before I updated this library to the Swift 2 version in my project. I've done a full removal of the old version, cleaned the project, properly added the new version per the documentation, and updated my code to account for the changes (Table and Connection, etc).

@hiltonc
Copy link
Contributor

hiltonc commented Feb 10, 2016

+1

@hiltonc
Copy link
Contributor

hiltonc commented Feb 15, 2016

This works:

let typeConformsTo: (Expression<String>, Expression<String>) -> Expression<Bool> = (
    try db.createFunction("typeConformsTo", deterministic: true) { UTI, conformsToUTI in
        return UTTypeConformsTo(UTI, conformsToUTI)
    }
)

@jberkel jberkel changed the title Non-functional custom SQL functions in Swift 2 version Non-functional custom SQL functions in Swift 2 version (update+check docs) Dec 8, 2016
@jberkel jberkel added this to the 0.11.2 milestone Dec 8, 2016
@jberkel jberkel modified the milestones: 0.11.2, 0.11.3 Dec 29, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants