[plt-scheme] problem using sqlite and web server in combination (empty db file)

From: keydana at gmx.de (keydana at gmx.de)
Date: Thu Jun 11 15:56:04 EDT 2009

Hi all,

I am using snooze (with sqlite) to build a web application with  
database access.
I created tables and test data, which I can successfully query from a  
"normal" file. However, when I try doing the same from a request- 
generating function called with serve/servlet, I get an error that the  
tables don't exist:

./../../../../../Users/hunli/Documents/scheme/webapps/calendar/web.ss: 
109:55: Servlet (@ /calendar) exception:
Could not execute SELECT query: SELECT [P].[id] AS [P-id], [P].[code]  
AS [P-code] FROM [person] AS [P];: SQLite Error: no such table: person

I have configured extra-files-paths like this:

  #:extra-files-paths (list (current-directory) (build-path (current- 
directory) "static-docs"))

and my database file, planning.db, is in the current directory.



As I was in general unsure about where to put  the application files  
and where the server root (with its htdocs subdirectory)  is, I  
searched for it and found it in

/Applications/PLT Scheme v4.1.4/collects/web-server/default-web-root/ 
htdocs

and there I also found an instance of planning.db, only this file was  
empty (so of course there was no table :-;)


Now I wonder how the empty file got there (I would have assumed that  
#:extra-files-paths really just meant a search directive and not  
creating links to or even copying files?) and what I can do to fix it?

Also, in general, where should applications best be put - under some  
user directory like I'm doing now, or directly in an "application"   
subdirectory of "htdocs" ? Coming from Java, I am somehow used to  
having separated "development"  and "deployment" steps...


I'd be grateful for any help or hints about what to do.

Thanks a lot in advance,
Sigrid


  


Posted on the users mailing list.