Code Monkey home page Code Monkey logo

Comments (6)

vitobellini avatar vitobellini commented on June 6, 2024

yep, it would be great.
I was just started over with your wrapper and I'm stuck because I can't see something to get blob columns.
May be I'm gonna write by myself the implementation and pull over here

from squeal.

vitobellini avatar vitobellini commented on June 6, 2024

might it helps.
do you think is better to return NSData or [Bytes]?

public func blobValue(columnName:String) -> Bool? {
    if let columnIndex = indexOfColumnNamed(columnName) {
        return boolValueAtIndex(columnIndex)
    } else {
        return nil
    }
}

public func blobValueAtIndex(columnIndex:Int) -> NSData? {
    if sqliteStatement == nil {
        return nil
    }
    let blobPtr = sqlite3_column_blob(sqliteStatement, Int32(columnIndex))
    let blobSize = sqlite3_column_bytes(sqliteStatement, Int32(columnIndex))
    let blob = NSData(bytes: blobPtr, length: Int(blobSize))
    return blob
}

from squeal.

nerdyc avatar nerdyc commented on June 6, 2024

I would think NSData for now, because most Objective-C libraries use it. But that's a question I asked myself as well.

How have other Swift libraries worked with byte arrays?

from squeal.

vitobellini avatar vitobellini commented on June 6, 2024

nope!

from squeal.

nerdyc avatar nerdyc commented on June 6, 2024

Thanks @progeny ! There was a bit more work needed to support NULL and empty blobs, plus some work to bind BLOBs.

But BLOBs work now, and I hope it helps!

from squeal.

vitobellini avatar vitobellini commented on June 6, 2024

Thank you very much!

Inviato da iPhone

Il giorno 14/set/2014, alle ore 20:56, Christian Niles [email protected] ha scritto:

Thanks @progeny ! There was a bit more work needed to support NULL and empty blobs, plus some work to bind BLOBs.

But BLOBs work now, and I hope it helps!


Reply to this email directly or view it on GitHub.

from squeal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.