USING: accessors compression.zlib sequences io.files io.encodings.binary io.directories byte-arrays kernel namespaces db.tuples db.types db db.sqlite fry ; IN: dataimporter ! this differs from the others in that there's an OR-mapper (db.tuples) TUPLE: row id data ; C: row row "ROW" { { "id" "ID" VARCHAR +unique+ } { "data" "DATA" BLOB } } define-persistent : with-data ( quot -- ) '[ "/home/foo/dbdump/fac-xml.db" _ with-db ] call ; inline : add-data ( file -- ) dup binary file-contents compress data>> insert-tuple ; : main ( -- ) [ row recreate-table begin-transaction "/home/foo/dbdump/outgoing" [ [ add-data ] each ] with-directory-files commit-transaction ] with-data ;