(constant 'STATIC_TRIGGER_EXTENSIONS '(".html"))
; If the path does not have one of the STATIC_TRIGGER_EXTENSIONS, then the
; handler will attempt to modify the URL (not including the GET params) using
-; the STATIC_TRANSFORMATIONS, which is simply a list of possible modific
+; the STATIC_TRANSFORMATIONS, which is simply a list of possible modifications
; to the path, which is bound to the '_' symbol). If one of them matches a file,
; the entire route matches and the file is passed through the template evaluator,
; otherwise it will not match and defer to the other handler(s).
+; findWing is an experiment to check if we really need a database abstraction layer
+; define the resource functions like findWing and implement the necessary db connection in it
+; common types of functions are findAll (SELECT * FROM _ WHERE 1), findOne (SELECT * FROM _ WHERE id = _)
+; GET /findWing/1 would do something like SELECT * FROM wings where ID = 1
+; GET /findAllWings would do something like SELECT * FROM wings where 1
+(define (findWing id response-format)
+; unfortunately in this situation we can't use NL's default values to do this for us...
+; uh-oh! No range checking on 'resource-id' ...
+(if (= response-format "json")
+ (Response:content-type Response:json-type)
+ (print (Json:lisp->json (my-data id)))
+ (Response:content-type Response:text-type)
+ (sql3:open "../databases/main.sqlite")
+ ;(set 'query (string "SELECT * FROM entries WHERE id='"id"'"))
+ (set 'query (string "SELECT * FROM entries WHERE 1"))
+ (print (sql3:sql query))
+ ; hmm...doesn't return nil, maybe the path to db is wrong
+ ; there is a table entries - i know that!