grantjbutler / fetchr Goto Github PK
View Code? Open in Web Editor NEWA command line utility for interacting with a Core Data store using JavaScript.
A command line utility for interacting with a Core Data store using JavaScript.
Allow users to pass in a JavaScript file to execute, and output the results to the command line (probably as JSON, or some other standardized serialized format).
Current, Objective-C exception take down the application when thrown (see below example). Handle exceptions and return them as errors to the command line.
2015-02-11 10:38:49.553 fetchr[51631:4021541] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath not found in entity <NSSQLEntity Post id=12>'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff93c9566c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff964a176e objc_exception_throw + 43
2 CoreData 0x00007fff8e4ae7e6 -[NSSQLGenerator newSQLStatementForRequest:ignoreInheritance:countOnly:nestingLevel:] + 1238
3 CoreData 0x00007fff8e3997ad -[NSSQLAdapter _newSelectStatementWithFetchRequest:ignoreInheritance:] + 365
4 CoreData 0x00007fff8e399435 -[NSSQLCore newRowsForFetchPlan:] + 117
5 CoreData 0x00007fff8e398c98 -[NSSQLCore objectsForFetchRequest:inContext:] + 520
6 CoreData 0x00007fff8e3986fb -[NSSQLCore executeRequest:withContext:error:] + 299
7 CoreData 0x00007fff8e44d0f9 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3945
8 CoreData 0x00007fff8e45731b gutsOfBlockToNSPersistentStoreCoordinatorPerform + 171
9 libdispatch.dylib 0x00007fff8df19c13 _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff8df1ae5e _dispatch_barrier_sync_f_invoke + 57
11 CoreData 0x00007fff8e446312 _perform + 194
12 CoreData 0x00007fff8e398395 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 533
13 CoreData 0x00007fff8e396beb -[NSManagedObjectContext executeFetchRequest:error:] + 587
14 fetchr 0x00000001066aad17 -[GJBFetchr executeFetchRequest:] + 199
15 CoreFoundation 0x00007fff93b6e3cc __invoking___ + 140
16 CoreFoundation 0x00007fff93b6e222 -[NSInvocation invoke] + 290
17 JavaScriptCore 0x00007fff8bf42791 _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 417
18 JavaScriptCore 0x00007fff8bf42326 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 262
19 JavaScriptCore 0x00007fff8bf42e25 _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_9ExecStateE + 517
20 JavaScriptCore 0x00007fff8bb6f824 _ZN3JSC5LLInt9setUpCallEPNS_9ExecStateEPNS_11InstructionENS_22CodeSpecializationKindENS_7JSValueEPNS_17LLIntCallLinkInfoE + 452
21 JavaScriptCore 0x00007fff8bf2f873 llint_entry + 22733
22 JavaScriptCore 0x00007fff8bf29d81 callToJavaScript + 311
23 JavaScriptCore 0x00007fff8beaf103 _ZN3JSC7JITCode7executeEPNS_2VMEPNS_14ProtoCallFrameE + 35
24 JavaScriptCore 0x00007fff8bb521bc _ZN3JSC11Interpreter7executeEPNS_17ProgramExecutableEPNS_9ExecStateEPNS_8JSObjectE + 8796
25 JavaScriptCore 0x00007fff8bb4fd84 _ZN3JSC8evaluateEPNS_9ExecStateERKNS_10SourceCodeENS_7JSValueEPS5_ + 484
26 JavaScriptCore 0x00007fff8bb4faaa JSEvaluateScript + 394
27 JavaScriptCore 0x00007fff8bed22e9 -[JSContext evaluateScript:withSourceURL:] + 105
28 fetchr 0x00000001066a7ee4 -[GJBApplicationDelegate application:runWithArguments:] + 8436
29 fetchr 0x00000001066aa5cb -[DDCliApplication runWithDelegate:arguments:] + 427
30 fetchr 0x00000001066aa89b -[DDCliApplication runWithClass:] + 283
31 fetchr 0x00000001066aab13 DDCliAppRunWithClass + 99
32 fetchr 0x00000001066aab53 DDCliAppRunWithDefaultClass + 19
33 fetchr 0x00000001066a8a86 main + 38
34 libdyld.dylib 0x00007fff8e0795c9 start + 1
35 ??? 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
See this DevForums post for a solution. Things should work correctly on 10.10. This fix is most likely just for 10.9 and below (for whichever platforms support the JavaScriptCore Objective-C API).
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.