sqlite

SQLIite - how to add special data?

Hi, I is there a way to add "additional info" to a sqlite database. Something like date of creation of a database, amount of entries or name of user who created it. If I don't want to create special tables in order to store all this info especially if there will only be one of each type. Thank you in advance. ...

SQLite3 object not understood?

Now I'm geting an error: 1>c:\development\document_manager\document_manager\storage_manager.h(7) : error C2079: 'storage_manager::db' uses undefined struct 'sqlite3' with #pragma once #include "sqlite3.h" class storage_manager { sqlite3 db; sqlite3** db_pp; public: void open() { sqlite3_open("data.db", db_pp); ...

What is the most practical Solution to Data Management using SQLite on the iPhone?

I'm developing an iPhone application and am new to Objective-C as well as SQLite. That being said, I have been struggling w/ designing a practical data management solution that is worthy of existing. Any help would be greatly appreciated. Here's the deal: The majority of the data my application interacts with is stored in five tables ...

What are the performance characteristics of sqlite with very large database files?

I know that sqlite doesn't perform well with extremely large database files even when they are supported (there used to be a comment on the sqlite website stating that if you need file sizes above 1GB you may want to consider using an enterprise rdbms. Can't find it anymore, might be related to an older version of sqlite). However, for ...

PRAGMA journal_mode=OFF is not working.why?

I am running SQLite3 version sqlite-3.6.12 and I have successfully ported it to my OS. The problem I am seeing is that when I execute the command "PRAGMA journal_mode = OFF" it returns "OFF" but I am still seeing *.db-journal files being created. It is critical that these files are not created for the purpose of my project. When I step t...

SQLite3 trouble under VC9

Hi everyone. I imported sqlite3.c sqlite3.h into my project - and I'm having trouble compiling it. Errors: 1>c:\...\storage_manager.h(7) : error C2079: 'storage_manager::db' uses undefined struct 'sqlite3' 1>storage_manager.cpp 1>c:\...\storage_manager.h(7) : error C2079: 'storage_manager::db' uses undefined struct 'sqlite3...

Rails & SQLite3: Date Mis-Match

Rails is returning the wrong date from my database records. For my model ("Target"), if I run in script/console: Target.find :all I get all my records with the "recorded_on" field reading dates from "2000-01-01 xx:xx:xx". If I take the same database and run in the sqlite3 console: SELECT * FROM targets; I get all my records with ...

Sqlite over a network share

Does anyone have real world experience running a Sqlite database on an SMB share on a LAN (Windows or Linux)? Its clear from the documentation that this is not really the fastest way to share a Sqlite database. The obvious caveats are that it may be slow, and Sqlite only supports a single thread writing to the DB at a time. So you bec...

Sqlite3: Disabling primary key index while inserting?

I have an Sqlite3 database with a table and a primary key consisting of two integers, and I'm trying to insert lots of data into it (ie. around 1GB or so) The issue I'm having is that creating primary key also implicitly creates an index, which in my case bogs down inserts to a crawl after a few commits (and that would be because the da...

How can I import the sqlite3 module into Python 2.4?

The sqlite3 module is included in Python version 2.5+. However, I am stuck with version 2.4. I uploaded the sqlite3 module files, added the directory to sys.path, but I get the following error when I try to import it: Traceback (most recent call last): File "<stdin>", line 1, in ? File "sqlite3/__init__.py", line 23, in ? from d...

One-Click install for Ruby/Rails/SQLite?

I'm really excited to start programming in Ruby with the Rails framework; I've read great things about Ruby on Rails! I've gotten myself a couple of books, thumbed through a few tutorials, read some forum threads, but I'm already stuck on Step One: Installation. I guess I'm more used to the One-Click install local environments of MAMP. ...

iphone - open and close sqlite database every time I use it

I am writing an iPhone app that uses SQLite. I am use to opening and closing my connections every time I use a database. However, I do not know if that is a good practice in the iPhone/SQLite environment. I want to know if I should open the database 1 time or if it is OK to open and close the database each time I use it. Please let m...

DateTime to Single with C#

Hi, I'm trying to build an interface between iTunes e MediaMonkeys. When I imported my tracks from iTunes to MM, the field LastPlayed wasn't considered. So I decided to build an interface that reads the value from iTunes and updates the MM database. I'm using the package from phxsoftware in order to access the SQLite database used by ...

How can I embed a SQLite Database in a .NET DLL and then use it from C#?

Hi Girls and Guys! I'm currently working on some evaluation work for a project that I'm planning. I recently looked at solutions for a data storage mechanism for my application and while researching stumbled upon SQLite. I currently use SQLite with the System.Data.SQLite wrapper. I really like the way it works but I have one problem w...

SQLite - complex queries

Hi, I am getting random row from my table using the following query: SELECT value_id FROM table1 ORDER BY RANDOM() LIMIT 1 I have 3 tables: table1 and table2 - they are tables that have an id of a row and its value. there is as well table3 which has as its columns IDs of rows in table1 and table2. i.e. : table1: 1 - Canada 2 - USA 3...

How to know if a row doesn't exist?

Hi, I have the following query: SELECT rowid FROM table1 ORDER BY RANDOM() LIMIT 1 And as well I have another table (table3). In that table I have columns table1_id and table2_id. table1_id is a link to a row in table1 and table2_id is a link to a row in another table. I want in my query to get only those results that are defined in ...

Does a multi-column index work for single column selects too?

I've got (for example) an index: CREATE INDEX someIndex ON orders (customer, date); Does this index only accelerate queries where customer and date are used or does it accelerate queries for a single-column like this too? SELECT * FROM orders WHERE customer > 33; I'm using SQLite. If the answer is yes, why is it possible to crea...

SQLite - sorting question

Hi, I am using the following query to display database rows in an alphabetical order: SELECT word_id FROM table1 ORDER BY word ASC But I want to get values from table2, where I don't have column "word" and to sort it by column "word" which is in table1. I want something like this: SELECT word_id FROM table2 ORDER BY table1.word ASC ...

iPhone SQLite - getting sqlite3error()

Hi I am trying to reuse a sqlite statement in my application in a method. Here's the relevant code if(getsets_statement == nil){ const char *sql = "SELECT DISTINCT num,roll FROM mytable WHERE cls like ? and divname like ?"; if(sqlite3_prepare_v2(database, sql, -1, &getsets_statement, NULL) != SQLITE_OK){ NSAssert1(0, @"Error: Faile...

SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE()

I'd like to avoid having many checks like the following in my code: myObj.someStringField = rdr.IsDBNull(someOrdinal) ? string.Empty : rdr.GetString(someOrdinal); I figured I could just have my query take care of the nulls by doing something like this: SELECT myField1, [isnull](myField1, '') FROM myTable1 WHERE myField1 = someCondit...