benlilaj / gears

Automatically exported from code.google.com/p/gears
0 stars 1 forks source link

If there a way to create in-memory SQLITE database with Gears? #778

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This fails:

db.open(':memory:')

And since ATTACH is disabled, I guess there's no other way to use SQLITE 
in-memory database (no files on disk).

That would be very useful, because sometimes I don't want to store offline 
data on client computer but to use SQLITE database as temporary storage for  
my data and in-memory databases are much faster.

This can also be solved very simple - just execute inside Gears

"ATTACH ':memory:' AS mem"

on every database after open() and users gets an opportunity to create in-
memory table (CREATE TABLE mem.FOO), index and use it besides on-disk 
tables.

Thanks.

Original issue reported on code.google.com by ggrigore...@gmail.com on 6 Dec 2008 at 11:59