Sqlite?

5 views
Skip to first unread message

Ben Wilson

unread,
Jul 6, 2007, 3:49:16 PM7/6/07
to we...@googlegroups.com
Greetings,

I'm sort of new to web programming in Python, with a background in PHP
and Perl (professionally since '99); which is to say I know how to web
program (sort of) and am trying to hone my skills in Python. I'm
planning to write a web app using web.py. This app mostly uses flat
files (for now), but will likely use sqlite for some light database
work.

I noticed in db.py a comment to test db.py with sqlite. Looking at
the documentation, I do not see a way of connecting to sqlite. So, the
natural question is "how would I use db.py with sqlite?" Do I connect
to it via the Python module then use db.py to expedite building SQL
statements? Or, is there another way?

Thanks.

--
Ben Wilson
"Words are the only thing which will last forever" Churchill

Karol Tarcak

unread,
Jul 7, 2007, 5:21:00 AM7/7/07
to we...@googlegroups.com
Hi,

you just need to set web.config.db_parameters right :)

web.config.db_parameters = {
                                'dbn' : 'sqlite',   # db engine
                                'db' : ' web.db'   # db name; in case of sqlite name of the db-file
                        }

and then you can use the functions exported by db.py (web.select, web.insert, ...)

Karol
Reply all
Reply to author
Forward
0 new messages