Greg Slepak avatar Greg Slepak committed 045dbb3

moved changes from wings.lsp into test_sql.lsp, and added a rule to hgignore to ignore all .lsp files prefixed by test_

Comments (0)

Files changed (2)

 \.log$
 \.DS_Store$
 plugins-active/_config\.lsp$
+test_.+\.lsp$

example-site/resources/wings.lsp

 (context 'Resource.Wings)
 
 (set 'my-data
-  '(
-	(wings (left right))
+  '((wings (left right))
 	(wings-condition ("good" "excellent"))
-	(wings-opacity 0.5)
-   )
+	(wings-opacity 0.5))
 )
 
 (define (Resource.Wings:Resource.Wings id response-format)
 	)
 )
 
-; findWing is an experiment to check if we really need a database abstraction layer
-; my thoughts:
-; 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
-;
-; - Marc
-;
-
-(define (findWing id response-format)
-
-	(DF:activate-plugin "sqlite3")
-
-	; unfortunately in this situation we can't use NL's default values to do this for us...
-	(if-not id (set 'id 0))
-
-	; uh-oh! No range checking on 'resource-id' ...
-	(if (= response-format "json")
-		(begin
-			(Response:content-type Response:json-type)
-			(print (Json:lisp->json (my-data id)))
-		)
-		(begin
-		
-			(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 query "\r\n")
-			(print (sql3:sql query))
-			; hmm...doesn't return nil, maybe the path to db is wrong
-			; there is a table entries - i know that!
-		)
-	)
-
-)
-
 (context MAIN)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.