Giter Club home page Giter Club logo

Comments (8)

GiacomoLeopizzi avatar GiacomoLeopizzi commented on May 28, 2024 11

@irar2 Hello :),
Is it possible to know when the synchronous api will be released?
Many thanks!

from swift-kuery.

acaland avatar acaland commented on May 28, 2024 4

Hi @irar2,

Having the syncronous API will be great!
Thank you in advance

from swift-kuery.

irar2 avatar irar2 commented on May 28, 2024 3

OK, we can do this.

@shmuelk proposed to use numberOfAffectedRows instead of affectedRows, titles instead of columnNames (because these don't have to be table columns), and rowSequence instead of resultSet.

from swift-kuery.

ndPPPhz avatar ndPPPhz commented on May 28, 2024 2

@irar2 I was reading at the implementation of the MySQL plugin and I didn't find asynchronous call to the database, so actually I was wondering why do you decide to use completion handler instead of simple return and catch ?

from swift-kuery.

SMartorelli avatar SMartorelli commented on May 28, 2024 1

@shmuelk Would be amazing to have a synchronous API

from swift-kuery.

na-gupta avatar na-gupta commented on May 28, 2024

@shmuelk mentioned you were thinking about making Kuery functions throw instead of returning QueryResult.error(). IMO, that would be better. (I just saw that you also mentioned this a possibility above)

Also, if we were to do that, I think it would be worth considering moving rows and titles from ResultSet into QueryResult as optionals and removing ResultSet entirely. Then QueryResult could be as simple as:

public class QueryResult {
    private let resultFetcher: ResultFetcher?

    // number of rows affected by a INSERT/UPDATE/DELETE or
    // number of rows returned by a SELECT (may be -1 if we fetch the result set iteratively)
    public let affectedRows: Int
    public let columnNames: [String]?
    public let resultSet: RowSequence?
    public lazy var rows: [[String: Any?]]? = {
        ...
    }()
}

What do you think?

from swift-kuery.

kilnerm avatar kilnerm commented on May 28, 2024

This item will be addressed by PR #152

from swift-kuery.

kilnerm avatar kilnerm commented on May 28, 2024

We no longer plan on addressing this via the changes related to PR #152.

We will however look at providing a utility function to wrap the asynchronous API which will allow synchronous usage of the SwiftKuery API.

from swift-kuery.

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.