Since this doesn't touch a real problem of mine I'm somwhat uncertain, if it is even worth to be asked here. However maybe some of you would like to share your opinion on that.
In general I have to admit, that 'better' means anything and nothing at all at the same time. So I probably should be more specific, but I tried not to overflow...
How can I write my own aggregate functions with SQLAlchemy? As an easy example I would like to use numpy to calculate the variance. With sqlite it would look like this:
import sqlite3 as sqlite
import numpy as np
class self_written_SQLvar(object):
def __init__(self):
import numpy as np
self.values = []
def step(self, value)...
Could someone please give me a Perl example on how to load an image file into a blob in SQLite?
...
As stated in the documentation on sqlite_popen php tries to make use of a persistent resource mechanism. Where is this mechanism described in detail? Is it possible to view all resources currently stored/used? Is it possible to access this mechanism and store/read other values?
...
I am developing a web application in Django. My application is already up, and some users are are using it (say about 5-10). The database is SQLite. Should I move to MySQL now?
Or, wait till the user base increases? I don't have any user registration feature, yet. The basic usage of app is - problems are served n users solve them.
...
I was planning to benchmark that but since it's a lot of work, I'd like to check if I didn't miss any obvious answer before.
I have a huge query that gets some more details for each row with a subquery.
Each row is then used in a ListAdapter that is plugged in a ListView, so another loop take each row one by one to make it a ListItem.
...
I'm trying to use NHibernate (and FluentNHibernate) over a legacy database.
I'm also using SQLite for tests.
When I try to create a test for the mappings using FluentNHibernate's PersistenceSpecification, I get the following exception:
NHibernate.Exceptions.GenericADOException : could not fetch initial value for increment generator
I'...
A very simple example I am trying to create as I grasp iPhone App programming.
First TableView shows the makes, selecting one takes user to different view(Can I use the same view to show models) to show models. If the models TableView, that displays the car models, allows user to add a new record, how and where do I capture the primary...
For instance, if I am able to display a UITableView with all the movies and the Genre. Clicking Edit on the movie should load a new view(is this the right way, loading an edit view?) with a text box and some sort of selector or another view to choose the Genre. Once the Genre is selected, how do I capture the GenreId to save in the movie...
The following post relates to the System.Data.SQLite data provider by phxsoftware (http://sqlite.phxsoftware.com)
I have a question (and possibly a problem) with DbDataReader’s Read method and/or Visual Studio 2008. In many examples I see things like the following (and I know this code doesn't make a lot of sense ... but it serves a pu...
I'm investigating SQLite as a storage engine, and am curious to know whether SQLite locks the database file on reads.
I am concerned about read performance as my planned project will have few writes, but many reads. If the database does lock, are there measures that can be taken (such as memory caching) to mitigate this?
...
I have this line that works OK:
c.execute('select cleanseq from cleanseqs WHERE newID="%s"'%name)
But I want to use SQLite parameter substitution instead instead of string substitution (because I see here that this is safer).
This is my (failed) try:
t = (name,)
c.execute('select cleanseq from cleanseqs WHERE newID="?"',t)
But thi...
Hello,
I have a tableview (linked to a database) and a search bar. When I type something in the search bar, I do a quick search in the database and display the results as I type.
The query looks like this:
SELECT * FROM MyTable WHERE name LIKE '%NAME%'
Everything works fine as long as I use only ASCII characters. What I want is to t...
I have a table and in it a certain value - by default it is set to -1, but I want to change it to 0 for a random row.
What is the right query for this operation?
Here is what I tried:
UPDATE statuses SET status = 0
WHERE word_id = (
SELECT word_id FROM statuses WHERE status = -1 ORDER BY RANDOM() LIMIT 1
)
...
I'm writing an application with a GUI frontend (GTK) and an SQLite backend. When something is changed via the GUI, I want the change to show up in the GUI if and only if it completed successfully in the DB.
Is watching the return code from sqlite3_step for SQLITE_ERROR sufficient to ensure that I don't give false feedback to the use...
Hi,
I have some SQL similar to the following, which joins four tables and then orders the results by the "status" column of the first:
SELECT *
FROM a, b, c, d
WHERE b.aid=a.id AND c.id=a.cid AND a.did=d.id AND a.did='XXX'
ORDER BY a.status
It works. However, it's slow. I've worked out this is because of the ORDER BY clause and ...
I'm reading data from a sqlite3 database using the C api. sqlite3_column_int64 returns a sqlite3_int64 object. How do I convert this to a long?
...
From my iPhone app I insert some data in my sqlite database that include a date using the CURRENT_TIMESTAMP default value. Everything works great except for the fact that the time is 1 hour behind the time it should be. And that happens both on the device and the Simulator.
Any sqlite settings (like current time) i can access somewhere?
...
Most sqlite examples I've found talk about creating a db file from the commandline first and then adding that to your app. For my project, I'd like to be able to create my database within the app when it starts up for the first time and then save it to a db file in the user's sandbox. Is there a way to do that?
...
Hi all! I have a rather basic problem: I can't seem to connect CakePHP to my SQLite database. Surprisingly, I didn't find lots of information about it on the internet, though I may be looking up the wrong keywords. Nevertheless, this is my connection code:
var $default = array(
'driver' => 'sqlite',
'connect' =>'sqlite_popen',
'pe...