sqlite

Compiling sqlitejdbc driver with sqlcipher in cygwin

Hey I managed to compile the sqlitejdbc from here. The instructions in the MakeFile there says: Makefile for the native SQLite JDBC Driver No auto-goop. Just try typing 'make'. You should get two interesting files: build/TARGET_OS/LIBNAME build/sqlitejdbc-vXXX-native.jar To combine these, type: cd build mv LI...

Iphone Sqlite3 Query too slow

Hello I'm really stuck with my app. I need to make a simple SELECT on one of my tables with aprox 250.000 rows (50mb) using SQLITE3. When I load with Iphone Simulator the query takes 3 sec aprox. When i test my app on the Device the query takes 90 sec. Unfortunately I can't release my app with 90 sec of wait. Here i post my code: -(void...

storing an jpg image from internet to disk / db

Hi, I don't know which is the most efficient way of organizing images downloaded from server. I will be downloading around 200 images on to my iPhone on request for download. Which is the most efficient way of organizing ? just dropping it as a file on the phone's memory or having it in sqlite (via coredata) after download ? which one i...

Continue loading after IntegrityError

In python, I am populating a SQLITE data base using the importmany, so I can import tens of thousands of rows of data at once. My data is contained as a list of tuples. I had my database set up with the primary keys where I wanted them. Problem I ran into was primary key errors would throw up an IntegrityError. If I handle the except...

Binding a list of strings to an IN clause

Consider this (using apsw here): s = ["A", "B", "C"] c.execute("SELECT foo.y FROM foo WHERE foo.x in (?)", (s, )) This doesn't work, because a binding parameter cannot be a list. I want to bind a list of strings to ?. I know how to build the appropriate query-string manually, but I wonder if there is a way to do this with bindings. ...

About single row query results with parameterized querying

Soo, I'm having a few places in my program where I just fetch a single row (sometimes even a single column in a single row), for example SELECT id,title,posted FROM posts WHERE id=4; Since this will only return a single row (unless I suck at database stuff and somehow manage to have duplicated IDs) I feel it's overkill to go the whole...

How to use a database on the iphone

I have been thinking of saving data using dictionaries and arrays etc. Would it not be more efficient to use a database and just read and write to it rather than running through arrays, getting keys and values, blah blah? It will need to hold a lot of text that is it. How is the database setup and used on the iphone? Also , if one wri...

sqlite database connection/locking question

Folks I am implementing a file based queue (see my earlier question) using sqlite. I have the following threads running in background: thread-1 to empty out a memory structure into the "queue" table (an insert into "queue" table). thread-1 to read and "process" the "queue" table runs every 5 to 10 seconds thread-3 - runs very infrequen...

saving an ArrayList<String> state in a SQLiteDatabase (Android)

Hi, i'm working on a android app that will display Strings to the user, and the user then has the option to add one to a favorite list. I have searched and searched and cannot find the proper way of doing this. I did get one open source project, everything worked until the user removed a favorite. The database would clear the row of data...

CoreData: Releasing ManagedObject

I'm using CoreData (with SQLite as the store) in an iOS 4 iPhone application to store data that i initially retrieve from an xml file. My data model contains more than 15 entities and I am concerned about memory consumption since I saw CoreData creating all the NSManagedObject in memory to represent the object graph of my data model. I p...

ASP.NET MVC 2 Embedded Database

Hi, I am building a very small temprorary website that needs a small backing store. I have built this in ASP.NET MVC 2, and wanted to host with DiscountASP - although this isn't essential. I would like an backing store that will work with ASP.NET MVC 2, VS2010 Express, enabled LINQ (or EF) and work without further charges on a shared h...

Escaping chars in Python and sqlite

Hi, I have a python script that reads raw movie text files into an sqlite database. I use re.escape(title) to add escape chars into the strings to make them db safe before executing the inserts. Why does this not work: In [16]: c.execute("UPDATE movies SET rating = '8.7' WHERE name='\'Allo\ \'Allo!\"\ (1982)'") --------------...

Writing to sqlite db using fmdb?

Ok so I understand that fmdb is totally outdated, and core data is where it's at, but for now, I just need to tweak an app I'm working on that uses fmdb to read from a sqlite db in the resources folder. I need to be able to write to my db. What is the best way to execute queries? I have tried doing the same thing that I do to read from...

Qt - How to bind a QList to a QSqlQuery with a "WHERE ... IN" clause?

Note: this is with SQLite, although I expect the problem is on the Qt side. First, I set up a database table from the SQLite command line tool: sqlite> create table testtable ( id INTEGER PRIMARY KEY NOT NULL, state INTEGER ); sqlite> insert into testtable (state) values (0); sqlite> insert into testtable (state) values (1); sqlite> in...

php sqlite_fetch_array corrupted results

Hi, I started trying to use sqlite to host small websites and on my own personal server, I ran into a glich which kind of spoils the whole idea. I have a very simple test example, on a two row table in a sqlite 2.x database, I am being hosted with 5.2.12, I have also tried with the PDO sqlite3 database, the problem is this. The "users...

Why are session methods unbound in sqlalchemy using sqlite?

Code replicating the error: from sqlalchemy import create_engine, Table, Column, Integer from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker Base = declarative_base() class Message(Base): __tablename__ = 'messages' id = Column(Integer, primary_key=True) message = Column(Integer)...

Pre-loaded Local Database Backend for Javascript (Possible?)

Hello: I have recently seen articles on HTML5 and local Db creation and usage. I have also seen some examples of Javascript connection strings to existing Access Db backends. I am interested in finding a way to build a Db, pre-load it with records, and use a web app to connect and read the Db. For example, I have created many standal...

Detect data type from XML string using python

I have some XML tagged string as follows. <Processor>AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ 2.31 GHz</Processor> <ClockSpeed>2.31</ClockSpeed> <NumberOfCores>2</NumberOfCores> <InstalledMemory>2.00</InstalledMemory> <OperatingSystem>Windows 7 Professional</OperatingSystem> How can I detect the data type automatically using pyt...

sqlite UPDATE trigger firing on INSERT statements also?

Hello, I'm working on setting up a simple SQLite database to access via Python. So far I have one basic table, and a couple of triggers - I want to have one trigger update a field column 'date_added' when a new record is added, and another one to update a column 'date_updated' when a record is later updated. Here is my SQLite syntax f...

how to use database in android?

I am new to mobile application development.I wish to know how to create and use the database in android. Is there any requirements needed to create the database(like sql)? now i use the eclipse ide. ...