sqlite

SQLite FTS3 sumulate LIKE somestrin%

I'm writing a dictionary app and need to do the usual word suggesting while typing. LIKE somestrin% is rather slow (~1300ms on a ~100k row table) so I've turned to FTS3. Problem is, I haven't found a sane way to search from the beginning of a string. Now I'm performing a query like SELECT word, offsets(entries) FROM entries WHERE wo...

How can I figure out where all these extra sqlite3 selects are being generated in my rails app?

I'm trying to figure out where a whole pile of extra queries are being generated by my rails app. I need some ideas on how to tackle it. Or, if someone can give me some hints, I'd be grateful. I get these: SQL (1.0ms) SELECT name FROM sqlite_master WHERE type = 'table' AND NOT name = 'sqlite_sequence' SQL (0.8ms) SELECT na...

How to transfer SQLite db to web server on android phone

Hi, I have an application that creates an SQLite database and saves information to it over the course of a day. At the end of the day i want to export this database to a web server. Could anyone point me in the right direction for this? Should I use httppost or put. I have researched this myself online but there seems to be so many di...

Why does sqlite database randomly revert to previous version in xCode Core Data iPhone project?

Hi All, I'm developing an iPhone Core Data app with a pre-populated sqlite database. In parallel with developing the app in Xcode, we continue to add new data to our sqlite database and so every few days we update the new sqlite database in the project. This is done by adding the sqlite file as a resource in the Xcode project, deleting...

Light-weight client/server DB?

Hello, (This question falls between programming and finding a tool, so I guess I'll ask here in SO since it has more activity than SuperUser.) I like the simplicity of SQLite, but by design, it doesn't support concurrent access. The apps I write don't have heavy needs, so I'd like to avoid heavier solutions like MySQL that are more dif...

SQLite vs Firebird

The scenario I'm looking at is "This program uses Postgres. Oh, you want to just use it single-user for the moment, and put off having to deal with installing a database server? Okay, in the meantime you can use it with the embedded single-user database." The question is then which embedded database is best. As I understand it, the two ...

SQLite subquery syntax/error/difference from MySQL

I was under the impression this is valid SQLite syntax: SELECT *, (SELECT amount AS target FROM target_money WHERE start_year <= p.bill_year AND start_month <= p.bill_month ORDER BY start_year ASC, start_month ASC LIMIT 1) AS target FROM payments AS p; But I guess it's not, because SQLite returns this erro...

About sqlite use.

Hi, There are some things my application needs to do on first start up(first startup after update) . These actions could be described in a .txt file and then when it is the case read the file and do according to it ,or on the other hand (I lean to use this option) a sqlite database could be used to store the information . The apk file ...

Python SQLite: database is locked

I'm trying this code: import sqlite connection = sqlite.connect('cache.db') cur = connection.cursor() cur.execute('''create table item (id integer primary key, itemno text unique, scancode text, descr text, price real)''') connection.commit() cur.close() I'm catching this exception: Traceback (most recent call last): Fi...

Core Data store corruption

A handful of customers for my iPhone app are experiencing Core Data store corruption (I assume so, since the error is "Failed to save to data store: Operation could not be completed. (Cocoa error 259.)") Has anyone else experienced this kind of store corruption? I am worried since I aim to soon push an update which performs a schema mig...

VS2010/EntityFramework - Is it possible to execute generated sql for a Sqlite database?

Hi, VS2010/EntityFramework - Is it possible to execute generated sql for a Sqlite database? (like you can for SQL Server). When I try to do this I only seem to get SQL Server type options re which database to execute the SQL against (even though my Entity Framework design was based on the initial/successful upload from a SQLite databas...

INSERT OR IGNORE in a trigger

I have a database (for tracking email statistics) that has grown to hundreds of megabytes, and I've been looking for ways to reduce it. It seems that the main reason for the large file size is that the same strings tend to be repeated in thousands of rows. To avoid this problem, I plan to create another table for a string pool, like so...

SQL select descendants of a row

Suppose a tree structure is implemented in SQL like this: CREATE TABLE nodes ( id INTEGER PRIMARY KEY, parent INTEGER -- references nodes(id) ); Although cycles can be created in this representation, let's assume we never let that happen. The table will only store a collection of roots (records where parent is null) and their...

extract android 1.6 calendar fields to vcal

Hi, I want to extract android 1.6 calendar fields and put them into a vcalendar file my problem is that i can't find some fields in the database like: DTSTAMP UID LAST-MODIFIED SEQUENCE does anyone have a clue on how to find them? thanks! ...

How to plan for schema changes in an SQLite database?

I am currently developing an application that will store data in an SQLite database. The database will have much more read- than write-access (in fact, it will be filled with data once, and then almost only reading will happen). The read-performance is therefore much mre important. The schema I am currently developing is very likely to c...

to find the last 7 days Records in sqlite?

i would need to know the past 7 days record. i want to wrote a query for that in where condition. i have very basic knowledge in sqlite. Please help me for this query. ...

Change text_factory in Django/sqlite

I have a django project that uses a sqlite database that can be written to by an external tool. The text is supposed to be UTF-8, but in some cases there will be errors in the encoding. The text is from an external source, so I cannot control the encoding. Yes, I know that I could write a "wrapping layer" between the external source and ...

Saving Blob data from SQLite database to a file

Hello, I'm trying to save blob data from a SQLite database (Safari cache: Cache.db) to a file, but for some reason sqlite won't read the whole blob. I eventually would like to do this in ruby, but for now something that works directly in sqlite command prompt is fine. Also, I've read all of the entries that talk about this here on stack...

SQLite connection pooling with Fluent NHibernate

Is there a way to setup SQLite connection pooling using Fluent NHibernate configuration? E.g. equivalent of DataSource=:memory: would be: var sessionFactory = Fluently .Configure() .Database(SQLiteConfiguration.Standard.InMemory) (etc.) Is there something eqivalent to "Pooling=True;Max Pool Size=1;"? ...

sqlite3 date operations when joining two tables in a view?

In short, how to add minutes to a datetime from an integer located in another table, in one select statement, by joining them, in sqlite3? I have a sqlite3 db with: table P(int id, ..., int minutes) and a table S(int id, int p_id, datetime start) I want to generate a view that gives me PS(S.id, P.id, S.start + P.minutes) by joining S....