Multi-source ORM for NodeJS & the browser
This documentation section is a readable version of the code, for quick review. Please visit the Manual website, the Quick Code Review or the API Documentation
Important note: Diaspora is very young and under heavy development. You are totally free to use it or contribute, but be aware that some important features are incomplete or absent:
- Relations: Not implemented
- Browser version: Not ready
- Query language: Only supports equality
- Registering external adapter: Soon
Here is a short API overview. For a detailed API documentation, check... The doc that does not exist yet ^^'
Create an entity, defining its properties with provided props
. The returned entity should be persisted later.
See make
or spawn
.
Create an entity, defining its properties with provided props
, and persist it immediately.
See insertMany
.
Retrieve an entity matching query
. If query
isn't an object, it is considered as an ID.
See find
Delete an entity matching query
. If query
isn't an object, it is considered as an ID. options
can contain allowEmptyQuery
.
See delete
Update a single entity matching query
with attributes in newAttrs
. If query
isn't an object, it is considered as an ID. options
can contain allowEmptyQuery
.
updateMany(object || Any query
, object newAttrs
, [object options
], [string source
]) => Promise(Entity[])
See update
Delete this entity from the specified source
. Source hash object is set to undefined
Save current entity to the specified source
.
Reload entity from specified source
.
Manual change of ID
Unsure > Entity may change mode to desync
?
P2P Adapter
Unsure > May be interesting... Check for possible problems about data modification, etc etc.
IndexedDB Adapter (browser)
Unsure > Technology may be too immature. See MDN about IndexedDB
Auto-switch to API server/client
Planned > Wait for at least Mongo & Localstorage adapters.