Mercurial > hg > amuse
changeset 218:385935631532
Add function assigning a list of composition identifiers to a dataset.
Ignore-this: aa2078c1427801491a54d23ffca7da70
darcs-hash:20090716170022-16a00-d95599a9631d18530c0d0d51ef095133f9bbde5a.gz
committer: Jamie Forth <j.forth@gold.ac.uk>
author | j.forth <j.forth@gold.ac.uk> |
---|---|
date | Thu, 24 Feb 2011 11:23:18 +0000 |
parents | d8f650e3796e |
children | 87320b5ba2e5 |
files | base/database/datasets-functions.lisp base/database/implementations-setup.lisp |
diffstat | 2 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/base/database/datasets-functions.lisp Thu Feb 24 11:23:18 2011 +0000 +++ b/base/database/datasets-functions.lisp Thu Feb 24 11:23:18 2011 +0000 @@ -54,6 +54,16 @@ composition-identifier))) :database database) +(defun assign-compositions-to-dataset (composition-identifiers + dataset-identifier + &optional (database + *amuse-database*)) + "This should be done more sensibly." + (loop for identifier in composition-identifiers + do (assign-composition-to-dataset identifier + dataset-identifier + database))) + (defun get-dataset (dataset-identifier &optional (database *amuse-database*)) (let ((dataset-header (clsql:query (format nil "
--- a/base/database/implementations-setup.lisp Thu Feb 24 11:23:18 2011 +0000 +++ b/base/database/implementations-setup.lisp Thu Feb 24 11:23:18 2011 +0000 @@ -42,6 +42,7 @@ CREATE FUNCTION get_impl_id ( impl_name VARCHAR(255)) RETURNS SMALLINT +READS SQL DATA RETURN (SELECT implementation_id FROM amuse_implementations WHERE implementation_name = impl_name);" @@ -57,6 +58,7 @@ CREATE FUNCTION get_impl_name ( impl_id SMALLINT) RETURNS VARCHAR(255) +READS SQL DATA RETURN (SELECT implementation_name FROM amuse_implementations WHERE implementation_id = impl_id);"