sqlite

SQLite transaction doesn't work as expected

I prepared 2 files, "1.php" and "2.php". "1.php" is like this. <?php $dbh = new PDO('sqlite:test1'); $dbh->beginTransaction(); print "aaa<br>"; sleep(55); $dbh->commit(); print "bbb"; ?> and "2.php" is like this. <?php $dbh = new PDO('sqlite:test1'); $dbh->beginTransaction(); print "ccc<br>"; $dbh->commit(); print "ddd"; ?> and...

Dump only part of sqlite database

Is it possible to dump only part of a database? I have a database containing 250'000 entries. I want to create a second one with a tenth of the data in it... using select * from table where id % 10 = 0 and setting .output out.sql yields a file that does not have the binary data encoded in the same way as when using .dump dump ->...

Replacing a DateTime.MinValue in a DataGridView

I am working on a name record application and the information is stored in a SQLite database. All columns in the database are TEXT types, except for the date of birth column, which is a DATETIME. The original Access database that I transferred to the SQLite database allowed nulls for the date of birth, so when I copied it over, I set all...

Django and Sqlite Concurrency issue

I've done a bit of reading related to the concurrency issues with sqlite, but I don't see how they'd apply to Django since it's inherently single threaded. I'm not using any multiprocess modules either. I have absolutely no experience with concurrent programming either, so if someone can identify WHY the following code is causing an Oper...

Can I embed a sqlite datbase in an Air application?

Is it always necessary to create a database for the user in an adobe air application or can you ship an empty database as part of the distributed app? ...

Property-values database

I have a number of objects, each one have an arbitrary number of shared, and distinct property-value pairs (more specifically: files, and their related properties -such as width, and height values for images, album/artist/length for music files, etc). I'd like to be able to search for objects having specific property/values (such as: by ...

How can I reference columns by their names in python calling SQLite?

Hi, I have some code which I've been using to query MySQL, and I'm hoping to use it with SQLite. My real hope is that this will not involve making too many changes to the code. Unfortunately, the following code doesn't work with SQLite: cursor.execute(query) rows = cursor.fetchall() data = [] for row in rows data.append(row["column...

Python ORM that auto-generates/updates tables and uses SQLite?

I am doing some prototyping for a new desktop app i am writing in Python, and i want to use SQLite and an ORM to store data. My question is, are there any ORM libraries that support auto-generating/updating the database schema and work with SQLite? ...

Where can I find a SQLite code editor with schema intellisense?

Is there a SQL editor that supports SQLite databases and also features schema intellisense? I can't seem to find anything out there. ...

How do I use a boolean field in a where clause in SQLite?

It seems like a dumb question, and yet. It could be my IDE that's goofing me up. Here's the code (this is generated from DbLinq): SELECT pics$.Caption, pics$.Id, pics$.Path, pics$.Public, pics$.Active, portpics$.PortfolioID FROM main.Pictures pics$ inner join main.PortfolioPictures portpics$ on pics$.Id = portpics$.PictureId WHER...

sqlite prepared statements - how to debug

I'm writing some c++ code that uses the sqlite3 library. I'm using a prepared statement to which I bind a variable at runtime. How do I examine the SQL query in the statement after the bindings? For example, the code below doesn't return a row. When using a premade string and sqlite3_exec, I get the results I expect. sqlite3_stmt *sta...

py2exe + sqlalchemy + sqlite problem

I am playing around with getting some basic stuff to work in Python before i go into full speed dev mode. Here are the specifics: Python 2.5.4 PyQt4 4.4.3 SqlAlchemy 0.5.2 py2exe 0.6.9 setuptools 0.6c9 pysqlite 2.5.1 setup.py: from distutils.core import setup import py2exe setup(windows=[{"script" : "main.py"}], options={"py2exe" : ...

SQLite vs. SQLCE vs. ? in a Mobile Application

When developing a mobile application on Windows Mobile, what are some of the database choices you've made? Why did you make that choice? In particular we've got a mobile app that we're building which will have up to 360,000 records in some of the tables. We were planning to use SQLCE 3.5 but we've got a number of drawbacks when working...

Database design of survey query system

Hello, guys I am working on a so-called Behavioral Risk Factor Surveillance System (BRFSS), a web query system dealing with questionnaires coming every year. I had hard time in coming up with a suitable database design for it. Here is the problem: Each questionnaire contains about 80 questions, with demographic info, e.g. age, educati...

How to create report with tickets closed at certain date in Trac

I wish to create a report that would list all the tickets that were closed in a certain period of time. The pseudo-code would be like SELECT * FROM tickets WHERE closed AND date_closed = 'january 2009' The part I am unable to resolve is date_closed = 'january 2009'. Is there a way to do it in Trac? I am not interested in particular...

Checking sqlite query results

How do I check if an sqlite query returned anything before I stop looping through results. //see if there are results and do something if not while(sqlite3_step(selectstmt) == SQLITE_ROW) { /*process on reults */} ...

SQLite synchronization when accessed by applications on different machines

I'm wondering how SQLite implements it. Is it based on file-locking? Surely the entire DB isn't locked for every user that accesses it; that would be extremely inefficient. Is it based on multiple files or just one big file? Would be nice if someone could give a short overview of how synchronization and locking is done in sqlite, or, o...

Propagated delete in code or database?

I'm working on an iPhone application with a few data relationships (Author -> Books for example). When a user deletes an Author object from the application, I have a few SQLite triggers that run on the delete to remove any books from the database that have a foreign key matching the Author's primary key. I'm also using a trigger to i...

What is the best way to generate XML from a C based CGI application using the SQLite API?

Learning the basics of XML for the first time from W3C tutorials. How are most XML files generated? Does the server side application usually print a complete XML file to be parsed each time there is new data? I have a CGI application in C and it includes the SQLite API. Is the best way to do some sort of printf to a XML file (using my ...

Why does sqlite insert only one column?

I get only the second value inserted into the database. dataHold.Id has a value, as does aTextField. However, when I look at the database, the Id isn't being inserted. Is the sqlite below correct? const char *sql = "insert into Userdata (Id, Name) Values(?, ?)"; sqlite3_stmt *selectstmt; if(sqlite3_prepare_v2(database, sql, -1, &se...