view base/datasets/datasets-db/constructors.lisp @ 262:2284dbc7d51a

fix missing description value in mtp-compositions
author Jamie Forth <j.forth@gold.ac.uk>
date Sun, 10 Apr 2011 10:23:04 +0100
parents 6a3adca16910
children
line wrap: on
line source
(cl:in-package #:amuse-datasets)

(defun make-db-dataset-identifier (dataset-id)
  (make-instance 'db-dataset-identifier
		 :dataset-id dataset-id))

(defun make-new-dataset-record (description &optional
				(database
				 amuse-database-admin:*amuse-database*))
  "A dataset is a set of pieces used for a particualar analytical
task. A dataset is not necessarily the same thing as a corpus or
collection (are these things different?). Corpus indicates that a set
of pieces have been curated in some way and in that sense `belong
together'. A dataset is just simply a set of pieces gathered together
to analyse, and the pieces can be from any corpus or backend."
  (let (dataset-id)
    #.(clsql:locally-enable-sql-reader-syntax)
    (clsql:insert-records :into "amuse_datasets"
			  :attributes '([description])
			  :values (list description)
			  :database database)
    #.(clsql:locally-disable-sql-reader-syntax)
    (setf dataset-id (clsql-mysql::mysql-insert-id
		      (clsql-mysql::database-mysql-ptr
		       database)))
    (make-db-dataset-identifier dataset-id)))