sqlite3

Examining then updating rows in sqlite with Python

I've decided that I'm not fond of the automatic filing and renaming provided by Mendeley, but have found that it keeps track of everything in an sqlite database that I can easily read and modify from Python. My question is, if I'm going to iterate over the rows of a table containing file paths and hashes that are serving as identifiers ...

tried "DROP TABLE/DROP TABLE IF EXISTS tablename", but got a SQLITE_LOCKED, instead of SQLITE_DONE

Hi, guys, I'm developing an iPhone app which is using sqlite library directly instead of CoreData. I tried to drop a table, but no matter how I tried, I always got a SQLITE_LOCKED instead of SQLITE_DONE. I had searched stackoverflow.com, but could not find any similar problems. Here is my code: -DropTable: - (BOOL) dropTable:(NSStri...

sqlite database disk image malformed on iPhone SDK

I'm having an issue with a new application on the iPhone SDK using SQLite as the DB backend. Occasionally, my app will stop loading data to my UITableViews and after downloading the device DB via the Organizer I can access the SQLite DB via the command line. I can query certain tables fine but not others without getting an "SQL error: ...

how to initialize an object(NSObject subclass) at a specific address

Hi I need to initialize an NSObject at a particular location that I specify(through a void* pointer, for example). For a little bit of context, I am writing a sqlite3 aggregate function. To keep temporary results from this function, I have to call a sqlite3_aggregate_context function, which allocates a block of memory for me. I want to s...

DBAdapter design question

Hello. I'm developing an Android application with a database. That database will have more than three tables. Now I'm working on a class called DBAdapter to access the SQLite Database. DBAdpater will have five methods for every table on database (insertEntry, removeEntry, getAllEntries, getEntry and updateEntry). So, if I have five t...

sqlite3 syntax for regexp in "search and replace"

I can use regexp to list hits from a Sqlite3 db, but what is the syntax for a "search and replace" using regexp. ...

sqlite3_step return code 21 during loadView

Experimenting with sqlite, I want to init a list view with data from the DB. My source looks like this: -(void) initTheList { sqlite3 *db; int rows = 0; const char* dbFilePathUTF8 = [searchTermDBLocation UTF8String]; int dbrc = sqlite3_open( dbFilePathUTF8, &db ); // count if (dbrc) { NSLog( @"Could not open the DB" ); } else { ...

Create objects to represent database's tables.

Hello. I'm developing an Android application. I'm wondering if it really necessary to create objects that represent tables from a SQLite database. I'm implementing insert method and instead using a specific object for a table, maybe I can use a HashMap. This Hashmap will be an argument for that method. public boolean insertEntry(Hash...

How to change the column type from string to varchar using script/generate in a rails app?

Trying to migrate a sqlite3 db for a rails app to mysql db. The column named "content" was a string type in sqlite3. I want to change it to varchar (or perhaps text) in mysql. I am not sure if there is a way to do this by using "ruby script/generate" command. Any ideas? Obviously, I could start all over again with desired column types...

How to specify multiple OR conditions in android (sqlite3)?

Hi, I want to know how to specify something like in my database adapter: Select * from _myTable WHERE _columnValue IN ('2','3','4'); Is there a way to use any of the existing query methods specified in SQLiteDatabase? I can write the query in pure sql, but wondering whether there is a better (and easier) way to accomplish what I am a...

Rails 3 - how do I avoid database altogether?

Hi, I'm trying to use rails 3 without any db backend, but it still insists on requiring 'sqlite3' gem when I try to access a page, and throws an error no such file to load -- sqlite3, even though no code in the application requires sqlite, except I left database.yml with its default setting for sqlite3, since removing the content raised...

How to read data from SQLite database?

Hi, I'm trying to make my first simple program that uses databases. I decided to use SQLite as it allows to store database into a single file. I think I have managed to do a database with SQLite Database Browser, but I have no idea how I could read that data in a C/C++ program. So can someone help me to get started or point me some tuto...

jUnit testing Database operations.

Hello. I'm developing an Android application with database storage. I want to test some classes that I use to access database. I've found ActivityInstrumentationTestCase2 to test Activities but I haven't found anything to test classes. How can I do that? I haven't used jUnit before. Thanks. ...

Jumping jee-willigers: sqlite3 GUI browser for Windows?

Is there such a thing ? I'd really like to be able to browse my sqlite 3 databases. Can't seem to find any useful tools. ...

How to increase max pool size in active record

Error "ActiveRecord::ConnectionTimeoutError - could not obtain a database connection within 5 seconds. The max pool size is currently 5; consider increasing it.:" How do I increase the max pool size ? DB CONNECTION DB_CONN = ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => DB_FILE) ...

database sqlite..

I want to delete a particular row fro two tables with the help of single query.. ...

Testing package's classes with JUnit.

Hello. I'm developing an Android application. I have a package to access SQLite3. It isn't a ContentProvider. How can I test the package's classes using JUnit? Thanks. ...

The ADB shell says the column exists but the LogCat says otherwise ...

The sql statement is: SELECT 'customer_address'._id, 'address'.Descriptor AS Name FROM 'customer_address' INNER JOIN 'address' ON 'customer_address'.AddressID='address'._id WHERE 'customer_address'.CustomerID=4 ORDER BY Name When I examine the db using the adb sqlite shell, it reports that the schema for the address table is: CREATE T...

Selecting rows where there are at least X rows with some values in a column via sqlite3?

Say I have the following data: |bookID|data| |1|a| |1|b| |1|c| |2|x| |2|y| |3|t| I want to select all the books that have at least X rows. So if X=3 then I'd only get all the rows with bookID=1. If X=2 then I'd only get all the rows with bookID=1 or bookID=2, etc. Can I do this with SQLite3? ...

How can I convert SQLite 2 to SQLite3 using Python on Windows?

I'm trying to convert a SQLite 2 file to SQLite3 using Python on Windows. On Linux, I'd just pipe a dump from sqlite to sqlite3: os.system("sqlite db.sqlite .dump | sqlite3 db3.sqlite") On Windows, I have no such convenient means of transferring the dump. Here's what I'm doing: sqlite_dump = os.popen('sqlite %s .dump' % sqlite_db)....