Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relational-matcher #37

Open
egisatoshi opened this issue Jan 29, 2014 · 0 comments
Open

relational-matcher #37

egisatoshi opened this issue Jan 29, 2014 · 0 comments

Comments

@egisatoshi
Copy link
Member

(define $edge-table
  (relational-matcher "edge"
    {["from_id" itos stoi]
     ["to_id" itos stoi]}))

is desgured to

(define $edge-table
  (matcher
    {[<cons <edge ,$px ,$py> $> [edge-table]
      ; select * from edge where from_id = px and to_id = py                                                                                                                                                
      {[$tgt (match (pure-mysql (database-name tgt) (simple-select {"from_id to_id"} (table-name tgt) {["from_id" (itos px)] ["to_id" (itos py)]})) (list [integer integer])
               {[<nil> {}]
                [_ {tgt}]})]}]
     [<cons <edge ,$px $> $> [integer edge-table]
      ; select to_id from edge where from_id = px                                                                                                                                                           
      {[$tgt (map (lambda [$x] [(stoi x) tgt]) (pure-mysql (database-name tgt) (simple-select {"to_id"} (table-name tgt) {["from_id" (itos px)]})))]}]
     [<cons <edge $ ,$px> $> [integer edge-table]
      ; select from_id from edge where to_id = px                                                                                                                                                           
      {[$tgt (map (lambda [$x] [(stoi x) tgt]) (pure-mysql (database-name tgt) (simple-select {"from_id"} (table-name tgt) {["to_id" (itos px)]})))]}]
     [$ [something]
      {[$tgt {tgt}]}]
     }))
@momohatt momohatt changed the title relatioanl-matcher relational-matcher Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant