Advertisement
Shinmera

Radiance Database Impl

Jul 3rd, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.41 KB | None | 0 0
  1. (defimpl database
  2.     "Base database interface. Tries to be as abstract as possible while still providing all essential functionality."
  3.   (db-connect (dbname &key (host (config-tree :database :host))
  4.                       (port (config-tree :database :port))
  5.                       (user (config-tree :database :user))
  6.                       (pass (config-tree :database :pass)))
  7.               "Connects to the database given the information in the arguments.")
  8.   (db-disconnect () "Disconnects the database")
  9.   (db-connected-p () "Returns T if the database is connected, otherwise NIL.")
  10.   (db-collections () "Returns a list of all existing collections.")
  11.   (db-create ((collection collection) &key indices) "Create a new collection with an optional list of indexed fields.")
  12.   (db-select ((collection collection) query) "Retrieve data from the collection. Query is a plist containing field specifiers.")
  13.   (db-insert ((collection collection) data) "Insert the data into the collection. Data is a list of plists.")
  14.   (db-remove ((collection collection) query) "Delete data from the collection. Query is a plist containing field specifiers.")
  15.   (db-update ((collection collection) query data) "Update data in the collection. Query is a plist containing field specifiers and data is a list of plists.")
  16.   (db-apropos ((collection collection)) "Returns a list of all available fields and their type or NIL if any field is possible."))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement