0xlet / flite Goto Github PK
View Code? Open in Web Editor NEW๐ฒ FluentSQLiteDriver Wrapper for iOS and macOS
Home Page: https://github.com/0xLeif/FLite
License: MIT License
๐ฒ FluentSQLiteDriver Wrapper for iOS and macOS
Home Page: https://github.com/0xLeif/FLite
License: MIT License
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.
Use the master
branch
Relates to #10
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()
}
}
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.