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 didn't evolve it.  I don't actually remember where I got it, but wherever
that was, the result was a gross copy of something, not a tweak.  

 

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

 

I tried it and got the same error.  :c shows this:

 

(U)

Quotation: [ set-namestack init-catchstack self quot>> call -> stop ]

(O)

Word: listener-thread

(O)

Word: listener

(O)

Word: (listener)

(U)

Quotation: [

    [ ~quotation~ dip swap ~quotation~ dip ] dip swap

    [ call datastack ] dip -> swap [ set-datastack ] dip

]

(U)

Quotation: [ call -> datastack ]

(U)

Quotation: [

    entity "entity"

    { ~array~ ~array~ ~array~ ~array~ } define-persistent

    "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

]

(O)

Word: init-db

(O)

Method: M\ sqlite-db db-open

(O)

Word: sqlite-open

(U)

Quotation: [

    63 special-object error-thread set-global

    continuation -> error-continuation set-global

    [ original-error set-global ] [ rethrow ] bi

]

 

 

Shaping

------------------------------------------------------------------------------
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
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to