506 Commits

Author SHA1 Message Date
Scott Kyle
4a81b091cb Accept constructor in create() and objects() methods
This will help the linter prevent spelling mistakes and make some code more easily readable.

Resolves #233
2016-03-01 00:46:03 -08:00
Scott Kyle
3858ede7c7 Rename RJSObjectSetProperty to RJSValidatedSetProperty 2016-02-29 12:37:28 -08:00
Scott Kyle
5a9ad4f2b9 Rename InvalidConstructor to UncallableConstructor 2016-02-29 12:35:12 -08:00
Scott Kyle
44a29d8dd4 Expose List and Results constructors into JS 2016-02-29 03:24:58 -08:00
Scott Kyle
154422a3d1 Make realm instances pass instanceof check 2016-02-29 03:24:58 -08:00
Ari Lazier
e495cc4685 add encryption support 2016-02-26 11:08:59 -08:00
Thomas Goyne
b7b2822082 Make it possible to disable the commit notifier background worker
This makes it much easier to write tests which test the work done on the
background thread.
2016-02-25 11:19:00 -08:00
Thomas Goyne
cfc88b6fd5 Rename CachedRealm to WeakRealmNotfier 2016-02-24 16:58:11 -08:00
Thomas Goyne
143cc3b696 Fix compilation with GCC 4.9
4.9 does not correctly implement C++14 aggregate initialization.
2016-02-24 16:58:11 -08:00
Thomas Goyne
99037a7c72 Add an AtomicSharedPtr implementation for gcc 4.9 2016-02-24 16:58:11 -08:00
Thomas Goyne
1e35324d97 Avoid holding locks while calling transaction::advance()
It can call user code due to change notifications, which leads to
deadlocks if that code then tries to add async queries (and advancing is
a potentially expensive operation, so doing it while holding a lock
inhibits parallelism anyway).
2016-02-24 16:58:11 -08:00
Thomas Goyne
8284340729 Remove redundant check in RealmCoordinator::advance_helper_shared_group_to_latest() 2016-02-24 16:58:11 -08:00
Thomas Goyne
4e18a99dfd Update some out-of-date comments 2016-02-24 16:58:10 -08:00
Thomas Goyne
aa67216574 Write a much better comment about thread stuff for AsyncQuery 2016-02-24 16:58:10 -08:00
Thomas Goyne
ad46e307a2 Update the comments for Realm::Internal 2016-02-24 16:58:10 -08:00
Thomas Goyne
1430fcf474 Rename AsyncFriend to Interal 2016-02-24 16:58:10 -08:00
Thomas Goyne
c46a2a34de Fix typos and minor errors in comments 2016-02-24 16:58:10 -08:00
Thomas Goyne
db7d6fa2a8 Don't hold onto the tableview between runs of async queries
Updating the table view in advance_read() can be very expensive, and the
updated data is never actually used.
2016-02-24 16:58:10 -08:00
Thomas Goyne
a95eb50915 Don't create background queries for Results on threads without runloops 2016-02-24 16:58:09 -08:00
Thomas Goyne
3e90c30571 Add more tests and fix bugs 2016-02-24 16:58:09 -08:00
Thomas Goyne
8c4f2a4f30 Reduce the scope of class friendships 2016-02-24 16:58:09 -08:00
Thomas Goyne
13e1054553 Don't continue to run queries in the background if the result is unused 2016-02-24 16:58:09 -08:00
Thomas Goyne
934263f76a Automatically create the async query when converting to a TableView 2016-02-24 16:58:09 -08:00
Thomas Goyne
8f668fdf09 Use a single AsyncQuery per Results regardless of number of callbacks added 2016-02-24 16:58:08 -08:00
Thomas Goyne
d165458601 Add support for running queries asynchronously 2016-02-24 16:58:08 -08:00
Thomas Goyne
bceec93a69 Update to core 0.96.2 2016-02-23 15:01:35 -08:00
Tim Anglade
7cc2f69736 Merge pull request #264 from realm/km-js-fixlicense
License update
2016-02-21 18:56:59 -08:00
Nabil Hachicha
9bcebfaf29 PR feedback 2016-02-19 22:50:30 +00:00
Nabil Hachicha
76981229ab start debug server only on when using chrome debug 2016-02-19 19:05:07 +00:00
Thomas Goyne
ae9d41f9ce Remove an incorrect std::move() 2016-02-18 19:05:02 -08:00
Scott Kyle
2e3a3b5db8 Merge pull request #257 from realm/sk-schema-prop
The schema property should be directly on constructor
2016-02-18 16:27:47 -08:00
Karson Miller
5e9333b699 no message 2016-02-18 15:30:44 -08:00
Scott Kyle
a661350e59 Merge branch 'sk-sorted-results'
* sk-sorted-results:
  Add sorted() method to List
  Further improve argument checking for sorted()
  Improve error message in sorted() method
  Change sortedBy API as discussed
  Allow sortedBy to accept array of properties
  Change sortByProperty to return new Results
2016-02-18 15:21:35 -08:00
Scott Kyle
5b2e7b37af Add script to update version in package.json and iOS
This uses agvtool to update the CURRENT_PROJECT_VERSION and DYLIB_CURRENT_VERSION project variables. The Info.plist files have been updated to propagate this value.
2016-02-18 13:58:12 -08:00
Scott Kyle
5332131c14 Add sorted() method to List 2016-02-18 13:41:11 -08:00
Scott Kyle
d847fbceb1 Further improve argument checking for sorted() 2016-02-18 12:55:54 -08:00
Scott Kyle
bd766297ef Improve error message in sorted() method 2016-02-18 12:50:44 -08:00
Scott Kyle
05d84b23a2 Change sortedBy API as discussed
If provided an array, then each member can optionally be an array of [propName, reverse]
2016-02-18 12:47:18 -08:00
Scott Kyle
76865d0da4 Allow sortedBy to accept array of properties
It now optionally accepts an array of properties for both parameters and the tests have been updated to reflect new capabilities.
2016-02-18 11:58:39 -08:00
Scott Kyle
249bcd8f3f Change sortByProperty to return new Results
The method name changed to sortedBy to reflect that it returns a new Results object and to be more succinct. Also, the second optional argument instead reflects descending (or rather, reverse) since it's an anti-pattern to have an optional argument default to true in JS, and this also follows precedences set by other JS libraries and by Python's sorted function.
2016-02-18 11:58:39 -08:00
Scott Kyle
b34e52b290 The schema property should be directly on constructor
The constructor is now also called with `this` set as the constructed object.

Fixes #232
2016-02-18 11:10:02 -08:00
Ari Lazier
b3486c0d0e final fixes 2016-02-17 20:51:03 -08:00
Ari Lazier
1d01a1db73 don't copy query unnecessarily 2016-02-17 20:48:27 -08:00
Ari Lazier
e578b05058 pr feedback 2016-02-17 20:39:29 -08:00
Ari Lazier
6d02614eaa add List.filtered 2016-02-17 20:24:08 -08:00
Ari Lazier
e91ef42ebb add filtered method 2016-02-17 20:06:42 -08:00
Ari Lazier
98951f52ac Merge pull request #244 from realm/al-benchmarks
Benchmarks
2016-02-17 13:15:47 -08:00
Thomas Goyne
87655793b7 Merge pull request #40 from realm/tg/list
Wrap more of LinkView in List
2016-02-16 17:35:58 -08:00
Thomas Goyne
7c350031d6 Merge pull request #37 from realm/tg/index-set-tests
Add IndexSet tests
2016-02-16 10:07:11 -08:00
Thomas Goyne
f5ae1bdf80 Merge pull request #39 from realm/tg/validate-schema-changes
Handle allowed schema changes in the transaction log observer
2016-02-16 10:07:01 -08:00