-
-
Notifications
You must be signed in to change notification settings - Fork 18
Home
Philip Diffenderfer edited this page Jul 12, 2019
·
2 revisions
The following ramblings are for the next version of Rekord.
- Session = keeps track of live data, once an instance is no longer referenced by a session, stop live
- Transaction = collection of operations to perform at once in commit or rollback
- Atomic = similar to transaction except it needs to be done in one function and can be called multiple times if the underlying data changes
- Local/Cache = stores pending changes and caches models
- Store = remotely stores values
- Shard/Scale = Given a model, which store(s) should
- View/Projection = which fields and relationships to load
- Query = has search & pagination parameters and results. can be live.
- Stream = a query which defines a live sequential stream that can have new records added, and more can be added to past
- Source/StoreFactory =
View { name, live?, fields, relationships }
db.session()
db.transaction()
db.atomic(async (txn) => ...)
task = Task.load(session, ids)
session.parent // parent session,
session.get() // cached instance, look at parent if exists
session.load(task, ids, [view])
session.save(task)
session.create(task)
session.update(task)
session.remove(task)
session.query(params)
session.stream(params)
session.child()
session.transaction()
session.destroy() // clean up
txn.load(task, ids, [view])
txn.save(task)
txn.create(task)
txn.update(task)
txn.remove(task)