Skip to content

QueryKit/mogenerator-template

Repository files navigation

QueryKit Mogenerator Template

Build Status

These templates are designed to add QueryKit attributes to your managed object subclasses.

NOTE: querykit-cli is preferred over mogenerator-template when you are using Swift 2.0.

@interface _Organisation : NSManagedObject

/// Returns an attribute for the name property.
+ (QKAttribute *)name;

/// Returns an attribute for the relationship members.
+ (PersonAttribute *)members;

@end

@interface _Person : NSManagedObject

/// Returns an attribute for the name property.
+ (QKAttribute *)name;

/// Returns an attribute for the relationship organisation.
+ (OrganisationAttribute *)organisation;

@end

You can use these attributes to perform queries:

NSPredicate *predicate = [[[Person organisation] name] equals:@"Cocode"];

Installation:

$ brew install --HEAD mogenerator
$ git clone https://github.com/QueryKit/mogenerator-template ~/.querykit-mogenerator-template

If you would like to pin to a specific version of the template, I would suggest that instead you use a git submodules within your project to add mogenerator-template pinned to a specific commit.

Usage:

To use the QueryKit template for mogenerator, pass in the template path --template-path ~/.querykit-mogenerator-template when invoking mogenerator.

mogenerator --template-path ~/.querykit-mogenerator-template

About

Mogenerator template for QueryKit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published