geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

Documentation for Adapters #100

Open Emerson opened 11 years ago

Emerson commented 11 years ago

Howdy,

Really wanting to try out this library, but being new-(ish) to server side javascript, and after spending a few hours - I can't seem to figure out how to setup a simple Postgres adapter.

Is there anyway we could get some basic docs for this? Everything else seems really well documented.

mde commented 11 years ago

We've been mostly focused on Model as a part of the Geddy framework, so there's not a lot of doc for bootstrapping it standalone. The best examples you can look at currently are the Postgres tests:

https://github.com/mde/model/blob/master/test/integration/adapters/sql/postgres.js

It bootstraps an adapter in the 'before' method.

What specifically would you like to see in the way of docs for this?

arjunmehta commented 10 years ago

Like Emerson, I was also looking to bootstrap the Postgres adapter. It would be super awesome if this was an easy to configure/bootstrap method built into Model as a standalone module.

Ala:

var model = require('model');
model.use("postgres", "mongo", "whateverelse");

or

model.configure({
  "postgres": {
    "user": "postgres"
  , "database": "model_test"
  , "host": "127.0.0.1"
  }
});

I'm guessing this isn't really possible, looking at the code and the documentation.

Would love to help if I can.

mde commented 10 years ago

Great getting specific feedback about how you'd like this to work. I'm happy to make changes and additions to make things easier.

I should add I think it's great if you find other projects that are better suited for your purposes, but actively recommending alternative projects based on "sexy" docs isn't something I'm keen on seeing on a comment thread in this project if you're not interested in helping out.

arjunmehta commented 10 years ago

Agreed. Apologies for supporting that. I want to just repost my comment that this is related to issue #93. And the API could leverage what's already happening there.