Giter VIP home page Giter VIP logo

Comments (5)

HiveHicks avatar HiveHicks commented on August 26, 2024

Isn't simple while ([result next]) shorter? :)

from fmdb.

dodikk avatar dodikk commented on August 26, 2024

It's not that obvious.
I spent some time searching and reading main.m to find out that you have to invoke [ result next ] to read the first record.

In fact, I'm ok with while ([result next]) but it would be NICE to have Objective-C fast enumeration support.

from fmdb.

ccgus avatar ccgus commented on August 26, 2024

To say it's not obvious is a bit dramatic. It's right there in the readme under "Executing Queries:"
https://github.com/ccgus/fmdb/blob/master/README.markdown

I've thought about adding fast enumeration in the past, but I didn't seen the benefits to it. If someone wrote a patch for it and came up with some nice examples, I would reconsider it.

from fmdb.

dodikk avatar dodikk commented on August 26, 2024

My bad. Instead of the readme I've considered the "main.m" code.

Anyway, the semantic of FMResultSet seems a bit strange. It represents both a set and an iterator for it at the same time. And iterator semantic is closer to the one used in Java world. It's not similar either to ObjC fast enumeration or to STL style iterators.

If underlying SQLite API enforces this kind of behaviour - so be it.

from fmdb.

dodikk avatar dodikk commented on August 26, 2024

I'll see if I'll be able to do anything about a patch. However, I'm a bit busy at the moment.
And @ccgus, thank you for a great library.

from fmdb.

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.