tarunon / barrel Goto Github PK
View Code? Open in Web Editor NEWA simple type-safe library for NSPredicate and NSExpresion.
License: MIT License
A simple type-safe library for NSPredicate and NSExpresion.
License: MIT License
These methods are not works
Aggregate::groupBy(keyPath: (T) -> U) -> Group
Group::groupBy(keyPath: (T) -> U) -> Group
I'll make organization of Barrel (or rename?).
And separate CoreData and Realm support library.
That sounds refreshObject bad solution...
e.g.)
context.fetch(Person).filter{ $0 == person }.execute().all()
Cannot use this workaround no longer.
Needs to update every types.
protocol A { associatedtype B }
class C: A { typealias B = C }
extension A where Self: C { typealias B = Self }
For example, a Person class has property name, age.
And a Staff class extends Person, and use Staff type in attribute.
e.g.)
context.fetch(Staff).filter{ $0.age > 20 }.execute()
This code crash in execute() state, caused filter() parameter.
Think the Person model.
class Person: NSManagedObject {
@NSManaged var name: String
@NSManaged var age: NSNumber
@NSManaged var parent: Person
@NSManaged var children: Set<Person>
}
In this case, you can evaluate value in closure type name, age, or parent.
If you evaluate children value in closure, unfortunately, Barrel will be crashed.
This issues caused PropertyAttributeCoder protocol supported only String type.
e.g.)
context.fetch().orderBy{ $1.age < $0.age }
in orderBy closure case $1 before than $0
Because of attribute and completion object created at same context.
e.g.)
class Note: NSManagedObject {
@NSManaged public var title: String
@NSManaged public var created: NSDate
@NSManaged public var content: String?
}
In this case, Barrel crash when evaluate content in closure.
context.fetch(Note).filter{ $0.content == nil }.execute()
Because created is Optional property.
Type of created be hound Optional, And in Expression.init or SortDescriptor.init argument type is also Optional...
It is necessary to unwrap Optional in Expression.init() and SortDescriptor.init().
brl_
prefix is not match Swift3 coding style.
use brl.
instead of brl_
.
It is taking too time in this line.
https://github.com/tarunon/Barrel/blob/master/Barrel/Attribute.swift#L105
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.