A pysqlite in-memory database is created and loaded at startup, and
goes away after the connection is lost. Here is pysqlite code that
works:
con = sqlite3.connect(":memory:")
cur = con.cursor()
query = "CREATE TABLE table.A (field.A INTEGER, field.B TEXT)"
cur.execute(query)
cur.executemany("INSERT INTO table.A(field.A, field.B) VALUES (?, ?)",
data)
con.commit()
testData = ['%string 1%', '%string 2%', '%string 3%', '%string 3%',
'%string 4%']
for q in testData:
query = "SELECT field.A FROM table.A WHERE field.A LIKE '%s' LIMIT
10" %(q,)
for row in cur.execute(query):
print row
return
I tried to use this code within a webpy application but it doesn't
work. I really wanted to use raw pysqlite instead of db.py but the
first problem is resolving the pysqlite connection pooling issue
(which is why the webpy version is not working). What is the best
method/practice for solving connection pooling in webpy? Otherwise,
have to use db.py.
Cheers!
On Apr 12, 3:53 pm, Mark <[EMAIL PROTECTED]> wrote:
> can you share some sample code forboth in-memory and on-diskso we can play
> around with it
> dineshv wrote:Yes, it didn't work. The pysqlite code for both in-memory and
> on-disk works without using webpy but doesn't work with webpy. On Apr 11,
> 9:17 pm, bubblboy<[EMAIL PROTECTED]>wrote:dineshv wrote:Does db.py support
> sqlite's in-memory database function?did you try?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---