ryanfowler / SwiftData

Simple and Effective SQLite Handling in Swift
MIT License
518 stars 93 forks source link

It is not possible to store or retrieve an Int64 #21

Open st3fan opened 9 years ago

st3fan commented 9 years ago

The library currently does not support the Int64 type. It should be possible to store and retrieve Int64 values by wrapping them in an NSNumber.

zwang commented 9 years ago

I submitted a pull request to fix this issue: https://github.com/ryanfowler/SwiftData/pull/26

RegisStGelais commented 9 years ago
/**
Return the column value as an Int64
:returns:  An Optional Int64 corresponding to the apprioriate column value. Will be nil if: the column name does not exist, the value cannot be cast as a Int64, or the value is NULL
*/
public func asInt64() -> Int64?
{
    return value as? Int64
}