Skip to content

Commit 589cb68

Browse files
committed
Allow for key changes (resolves #326)
1 parent 7cd83fe commit 589cb68

26 files changed

+733
-135
lines changed

DOCUMENTATION.md

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- Comparators
2929
- Batch Operations
3030
- Sharding
31+
- Key Changing
3132
- Files
3233
- Validation *
3334
- Migrations *
@@ -44,6 +45,7 @@
4445
- PouchDB
4546
- StorkJS
4647
- PubSub
48+
- AJAX
4749
- Defining your Models
4850
- Add-Ons
4951
- Validation

Gulpfile.js

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var build = {
3232
'./src/lib/Database.js',
3333
'./src/lib/Model.js',
3434
'./src/lib/Map.js',
35+
'./src/lib/Dependents.js',
3536
'./src/lib/keys/KeyHandler.js',
3637
'./src/lib/keys/KeySimple.js',
3738
'./src/lib/keys/KeyComposite.js',
@@ -88,6 +89,7 @@ var modularized = {
8889
'./src/lib/Database.js',
8990
'./src/lib/Model.js',
9091
'./src/lib/Map.js',
92+
'./src/lib/Dependents.js',
9193
'./src/lib/keys/KeyHandler.js',
9294
'./src/lib/keys/KeySimple.js',
9395
'./src/lib/keys/KeyComposite.js',

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Rekord is the most powerful client-side Model/Active Record/ORM you'll find guar
2222
- Supports composite keys
2323
- Specify default values
2424
- Handle collisions with a "revision" field
25+
- Handle propagating primary key changes returned by the server
2526
- Automatically refresh when application becomes online
2627
- Cache no data, all data, or only pending changes
2728
- Send only changed values to REST/real-time APIs or entire object
@@ -54,7 +55,7 @@ No, of course not. It interacts with a REST API.
5455
Working with relational data in javascript can be painful. Rekord eases that pain by allowing you to use plain looking objects that can have any type of relationship with other objects. Rekord takes into consideration things like foreign keys - where you need object A successfully remotely saved before you can save object B. These types of constraints are ugly and bothersome to handle yourself and easily result in bugs. If you're familiar with server-side ORMs, then Rekord should be really easy to pick up. You'll find all the same features and even more!
5556

5657
3. *How are ID collisions avoided?*
57-
The key for a model can be given when creating a model - otherwise the key will be given a UUID. This is necessary to be offline capable, models need keys so related models can reference it.
58+
The key for a model can be given when creating a model - otherwise the key will be given a UUID. This is necessary to be offline capable, models need keys so related models can reference it. If the `keyChanges` option is used the server can return a different key (like an auto-incrementing value) and the key changes will be propagated to all references to that model (foreign keys).
5859

5960
4. *What do you mean by capable?*
6061
Caching data/changes locally and real-time behavior is optional - if you don't want either feature then you don't need to include an implementation.
@@ -69,7 +70,7 @@ The `Rekord.Model` and `Rekord.Search` classes can have custom properties theref
6970

7071
The easiest way to install rekord is through bower via `bower install rekord`.
7172

72-
- `rekord.js` is `390KB` (`67KB` gzipped)
73+
- `rekord.js` is `387KB` (`68KB` gzipped)
7374
- `rekord.min.js` is `115KB` (`29KB` gzipped)
7475

7576
**Examples**

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rekord",
3-
"version": "1.2.7",
3+
"version": "1.3.0",
44
"homepage": "https://github.com/Rekord/rekord",
55
"authors": [
66
"Philip Diffenderfer <pdiffenderfer@gmail.com>"

0 commit comments

Comments
 (0)