Coder Social home page Coder Social logo

flite's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

flite's Issues

0.2.0 Failed to resolve dependencies

Issue while trying to use 0.2.0

because no versions of FLite match the requirement 0.2.1..<1.0.0 and package flite is required using a version-based requirement and it depends on unversion package fluent-sqlite-driver, FLite >=0.2.0 is forbidden.
And because root depends on FLite 0.2.0..<1.0.0, version solving failed.

Temp solution

Use the master branch

Allow for Async usage of Connection

Example

FLite.fetch(model: TodoList.self) { qb in
            qb.filter(\.title == "BIG")
                .first()
                .whenSuccess {
                    bigList = $0
                    semaphore.signal()
            }
        }

Due to the MaxConnection issue

func connection(withHandler handler: @escaping (SQLiteConnection) -> Void,
                    completionHandler completion: @escaping () -> Void) {
        pool.requestConnection().do {
            handler($0)
        }.do { (connection) in
            self.pool.releaseConnection(connection)
        }.whenComplete {
            completion()
        }
    }

App crashes when trying to add to many values

For this test

func testTodoArray() {
        let semaphore = DispatchSemaphore(value: 0)
        var values = (0 ..< 500).map { _ in Todo(title: "Todo #\(Int.random(in: 0 ... 10000))", strings: []) }
        
        FLite.storage = .memory
        
        FLite.manager.set(maxConnections: 10)
        
        FLite.manager.set(id: "Something Else")
        
        FLite.prepare(model: Todo.self) {
            "Prepared".log()
        }
        
        values.forEach { value in 
            FLite.create(model: value) {
                "Created: \($0)".log()
            }
        }
        
        FLite.fetch(model: Todo.self) { qb in
            qb.all()
                .whenSuccess {
                    "Value: \($0)".log()
                    values = $0
                    semaphore.signal()
            }
        }
        
        semaphore.wait()
        XCTAssert(values.count > 0)
    }

Trying to add 500 values

var values = (0 ..< 500).map { _ in Todo(title: "Todo #\(Int.random(in: 0 ... 10000))", strings: []) }

with 10 maxConnections

FLite.manager.set(maxConnections: 10)

Error: NIO-ELT-#0 (9): EXC_BAD_ACCESS (code=2, address=0x700001ebeff8)

warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.

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.