999 Commits

Author SHA1 Message Date
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
Scott Kyle
3e1889d342 Merge branch 'master' into sk-listview-merge
* master: (207 commits)
  Convert to using new React Native MainActivity template
  Create RealmReactPackage for our Android plugin
  Fix doc for Android
  NPM ignore react-native/android folder
  Skip building Android module under Xcode
  Skip building Android module for iOS tests
  gitignore Android downloads folder
  Update README with instructions to run on Android
  Use un-patched RN for Android by installing hook into JSC
  cleanup build system
  Use Realm in node_modules for ReactTests on Android
  Change Demo => ReactTests
  adding a 'publishAndroid' task to generate the AAR with prebuilt .so files
  Adjust POM_NAME
  Use consistent package naming
  Remove old Demo files
  Add copyright to JNI file
  Cleanup platform.hpp
  Make our Android module buildable as a dependency
  Add `npm test` command
  ...
2016-02-15 14:49:31 -08:00
Ari Lazier
01f92ed72f start of benchmarks
fixes

enumeration test and test setup

add async store api tests

Log benchmark test errors and some other minor edits

Only delete .realm* files for tests

sql lite tests

run all the tests

worthless

Make SQLite benchmarks work

Make Realm insertion benchmark work like SQLite

run each test in release multiple times

Open each database once per benchmark test

Use same AppDelegate for benchmarks as the example

This will load the non-dev JS from the packager.

Make the benchmarks actually match their labels

Delete benchmark databases during setup phase

Some minor code style updates to benchmarks

query tests

make query test mostly work

bug fix and improved logging

remove double insertions

improved logging and bugfix

better logging

batch insersions

more reasonable counts

android
2016-02-15 13:02:25 -08:00
Thomas Goyne
a99cbb7b84 Merge pull request #41 from realm/tg/index_of
Remove the Query version of Results::index_of()
2016-02-12 17:37:24 -08:00
Scott Kyle
6e4b2440ba Create RealmReactPackage for our Android plugin
Also renamed RealmReactAndroid to RealmReactModule to match the convention used by everyone else.
2016-02-12 09:49:11 -08:00
Scott Kyle
415b45be51 Use un-patched RN for Android by installing hook into JSC
This works by installing some assembly into JSGlobalContextCreateInGroup() that will immediately jump out into our own wrapper function so we always can inject the Realm constructor into the context.
2016-02-11 11:14:09 -08:00
Thomas Goyne
5f5510e170 Remove the Query version of Results::index_of()
It didn't work for queries based on a LinkView because for those the arguments
to count() are indexes in the LinkView rather than table rows, and there's
currently no way to check if a query is based on a LinkView.
2016-02-10 10:52:33 -08:00
Scott Kyle
5f02dc9f6d Add copyright to JNI file 2016-02-08 15:56:08 -08:00