+; 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!