Shaping,

I apologize for being lazy before:  I usually work from an environment where
many things are already loaded.  I also kept starting from what I sent, not
what you had evolved it into. I have no idea where run-fac came from.  There
is a run-factor word in the tools.deploy.backend vocab, but ....

This time I went to the minimal install, added some things to the USING
clause, and made sure it works from a downloaded state.  Here is the code
for a tuple example that works:

USING: db.types db.tuples db.sqlite io.directories fry db calendar ;

TUPLE: entity id author date content ;

entity "entity" {
    { "id" "ID" INTEGER +db-assigned-id+ }
    { "author" "AUTHOR" { VARCHAR 256 } +not-null+ } ! uid
    { "date" "DATE" TIMESTAMP +not-null+ }
    { "content" "CONTENT" TEXT +not-null+ }
} define-persistent

: blog-db ( -- db ) "adhoc" home prepend-path [ make-directories ] [
"adhoc.sqlite" append-path ] bi <sqlite-db> ;
: with-blog-data ( quot -- ) '[ blog-db _ with-db ] call ; inline
: init-db ( -- )  [
    entity ensure-table
     ] with-blog-data ;

"adhoc" home prepend-path "Look in: " prepend .

init-db

entity new "Jim" >>author now >>date "blog entry" >>content

[ insert-tuple ] with-blog-data

entity new "Shaping" >>author now >>date "blog entry reply" >>content

[ insert-tuple ] with-blog-data

[ entity new select-tuples ] with-blog-data

[ "select * from entity order by author" sql-query  ] with-blog-data
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to