Skip to content

Instantly share code, notes, and snippets.

@bmeck
Created August 20, 2010 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmeck/541071 to your computer and use it in GitHub Desktop.
Save bmeck/541071 to your computer and use it in GitHub Desktop.
  • MyDBClient(...) //arguments are db client specific
    • .connect() - connect to the database
    • .disconnect() - disconnect from the database
    • .state() - connected | disconnected
    • .collection('name') // empty is acceptable
    • Collection() - return an interface that modifies the db through this particular client
      • .client() - returns MyDBClient
      • .get('id','id2') - get by primary key
      • .query('querystring') - run a query specific to this db
        • Result()
          • [#] - Get result by row number (may include the table structure)
      • .set('id','id2') - set by primary key
      • .remove('id','id2') - remove by primary key
      • .update(...) - update by primary key if it exists already
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment