Documentation?
This project has my interest, and I'd also like to use it in my project, if it's capable of what I think it is. But... there's no documentation linked. Zero. Nothing. Where do I find the API? And a useful introduction?
@zilti In the readme, in the Project Status section, it says:
"No docs at the moment, use examples & Datomic documentation."
So you can use the datomic documentation API. There is a separate section that details how different the datascript api is from datomic's.
Sorry @zilti, docs are not there yet.
Datomic team has excellent intro videos explaining basic concepts:
- http://www.youtube.com/watch?v=RKcqYZZ9RDY
- http://www.youtube.com/watch?v=bAilFQdaiHk
This is one of the best ways to learn about and master DataLog:
- http://www.learndatalogtoday.org
Most of the API is similar to Datomic which is documented here:
- http://docs.datomic.com/query.html
- http://docs.datomic.com/transactions.html
- http://docs.datomic.com/schema.html
- http://docs.datomic.com/identity.html
- http://docs.datomic.com/indexes.html
- http://docs.datomic.com/pull.html
After that, there’s a short section explaining how DataScript is different:
- https://github.com/tonsky/datascript#differences-from-datomic
A good idea might be to listen to a webinar where I write an app using most of DataScript features:
- https://vimeo.com/114688970
Hope that helps!
I’ll maintain an actual list of resources here: https://github.com/tonsky/datascript/wiki/Getting-started
How about some notes on using Datascript from a Javascript project.
I see the core API is defined with export annotations in core.cljs
Would be nice with a quick guide and bullet list of main API.
+1 for JS docs.
Install datascript via npm or directly use the min.js release
Read up on js interop
look at core and other main namespaces.
Use datascript core API like this ;)
var d$ = datascript.core;
d$.q(...);
I started this wiki page on the topic
@kristianmandrup this is a bad idea, you’ll have to do a lot of repetitive manual conversions to bridge with cljs api from js.
DataScript has a dedicated JS api, it’s better to use it. Here’s a lot of examples: https://github.com/tonsky/datascript/blob/master/test/js/tests.js#L101
Thanks @tonsky. I found the js api and listed it here... (WIP) https://github.com/tonsky/datascript/wiki/Javascript-API
Too bad the functions don't yet have doc strings to describe their basic functionality. Then you could also generate docs for each release. Which cljs doc tool is most used/mature?
I started this api overview wiki page. Please help out ;)
nice!
On Mon, Feb 29, 2016 at 4:06 PM Kristian Mandrup [email protected] wrote:
I started this api overview https://github.com/tonsky/datascript/wiki/API-overview wiki page. Please help out ;)
— Reply to this email directly or view it on GitHub https://github.com/tonsky/datascript/issues/135#issuecomment-190136972.
@tonsky Could you please help document how to upsert data ;) Thanks! I don't quite understand the test example.
this is a bad idea, you’ll have to do a lot of repetitive manual conversions to bridge with cljs api from js.
@tonsky https://github.com/typeetfunc/datascript-mori/blob/master/release-js/test/onlyCljsApiUsage.spec.js Example of usage only CLJS API from JS without any conversions(except mori.parse for parsing EDN string). In real-world JS app (in particular React App) you forced to use immutable data structures(otherwise your application will very slow). When using DataScript JS API, you need to convert result of query(q, pull etc.) from JS data structures to immutable data structures(Immutable.js, Mori, etc.) - is not good for perfomance and code cleanliness. It is also possible to combine CLJS API(for quering) and JS API(for other) - see example