Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible DROP TABLE solution #22

Open
nonplus opened this issue Feb 7, 2014 · 2 comments
Open

Possible DROP TABLE solution #22

nonplus opened this issue Feb 7, 2014 · 2 comments

Comments

@nonplus
Copy link

nonplus commented Feb 7, 2014

FYI, I've been working on WindowsRT support for WebSQL (using the amalgamated C source rather than CsharpSqlight) and executing multiple DROP TABLE statements within a transaction was failing with SQLITE_ERROR.

It turned out that the issue was cause by my code not initializing the sqlite3_temp_directory. The second DROP TABLE required SQLite to create a temporary file and it couldn't do so since sqlite3_temp_directory was NULL.

It's possible this is the cause of the problem you're facing in your plugin.

http://www.sqlite.org/c3ref/temp_directory.html

@marcucio
Copy link
Owner

marcucio commented Feb 8, 2014

great thanks, I will check it out when I get a sec

@d-ross
Copy link

d-ross commented Jun 3, 2014

I was having a bunch of other problems with inserts containing large amounts of data not working (also using the USE_WP8_NATIVE_SQLITE flag) and it turned out setting the SQL temp dir also solved that problem.

Right now I just do this right after the SQLiteConnection is created:

string tempPath = ApplicationData.Current.LocalFolder.Path;
var cmd = this.db.CreateCommand("PRAGMA temp_store_directory = '"+tempPath+"';");
int rowsAffected = cmd.ExecuteNonQuery();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants