Mercurial > hg > amuse
comparison base/database/datasets-functions.lisp @ 295:ced696bd9871
add database-admin function to create composition identifiers from file
Ignore-this: ff758dc4be1061baebae471feee53f00
darcs-hash:20090820181949-16a00-389500f68b818adca481631fc7ae26be59a8ad4a.gz
author | j.forth <j.forth@gold.ac.uk> |
---|---|
date | Thu, 20 Aug 2009 19:19:49 +0100 |
parents | 2519652145c3 |
children |
comparison
equal
deleted
inserted
replaced
294:61dfbaea3c0b | 295:ced696bd9871 |
---|---|
62 (loop for identifier in composition-identifiers | 62 (loop for identifier in composition-identifiers |
63 do (assign-composition-to-dataset identifier | 63 do (assign-composition-to-dataset identifier |
64 dataset-identifier | 64 dataset-identifier |
65 database))) | 65 database))) |
66 | 66 |
67 (defun make-composition-identifiers-from-file (package pathname) | |
68 "This reads a file that contains one id per line, and returns a list | |
69 of composition-identifiers (specialised on package). It is useful for | |
70 reading files that have been exported from the database, for use with | |
71 the above functions." | |
72 (with-open-file (stream pathname :direction :input) | |
73 (loop for id = (read stream nil) | |
74 while id | |
75 collect (make-composition-identifier package id)))) | |
76 | |
67 (defun get-dataset (dataset-identifier &optional (database | 77 (defun get-dataset (dataset-identifier &optional (database |
68 *amuse-database*)) | 78 *amuse-database*)) |
69 (let ((dataset-header (clsql:query (format nil " | 79 (let ((dataset-header (clsql:query (format nil " |
70 SELECT description | 80 SELECT description |
71 FROM amuse_datasets | 81 FROM amuse_datasets |