Tag Info

Hot answers tagged

21

I recommend reading the official answer to your question, Appropriate Uses For SQLite. Specifically, the "Situations Where Another RDBMS May Work Better" warns that SQLite does not support concurrent writing: SQLite supports an unlimited number of simultaneous readers, but it will only allow one writer at any instant in time. For many situations, ...


13

You absolutely could write SQL queries and store whatever data you need in a SQLite database or just write raw data to a file. In fact you are free to do so right now in an iOS app. Why then might we want a different abstraction? Immediately you're going to notice that your application is working with objects and you need to translate them into some form ...


9

You are looking for the File Locking And Concurrency documentation. SQLite processes use a series of locks to handle concurrency; to read, several processes can obtain a SHARED lock. A process that writes, will need to obtain a RESERVED lock, and only when actually having to flush changes to disk does it move to the PENDING state. Any reading process will ...


7

You must consider the particular pressures that apply to your situation and decide based on that. The general truths are: If you put every possible attribute into your definition of 'item' as a field, many items will have redundant fields, which might waste space if you are very constrained on space. Also, introducing a new attribute will require a ...


5

Short version: Web SQL was deprecated because standards are really important and turning Web SQL into a proper standard would have been prohibitively difficult. Since existing implementations of Web SQL are basically wrappers around SQLite, any attempt to define a standard of it was basically "do what SQLite does." This isn't good enough; a true standard ...


5

Putting on my IT Director hat I see a few no-gos here: Risk of data corruption. Perhaps more percieved than real but end of the day this is a non-transactional file type DB that does not have much if any recourse to bad writes besides asking if you've got a recent backup. Speaking of which . . . How do I back this thing up? In a manner I know I've got a ...


5

I can't add comments to expand on k3b's answer... so I have to add a new answer. YOU should decide how to handle the onUpgrade process yourself. Notice the arguments in onUpgrade: public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {...} You are provided with the "oldVersion" and the "newVersion". oldVersion is the ...


3

Yes. Just store those strings. Sqlite always works with unicode strings. Java String is also unicode. So everything should work out of the box. If it does not, than say what that is. Internally sqlite encodes all strings either in utf-8 or utf-16 (there is a per-database option), but since it always converts them as needed (to one or other for comparison ...


3

It is the naming convention chosen to be used in Core Data SQLLite. There are several reasons why it was chosen. One of the main reasons is Z is one of the least used letters of the alphabet so they surely felt by pre-fixing table names and entity names with Z they open more options for developers to name their own tables with fewer chances of stomping on ...


2

I wrote this stuff a long time ago for a C++ application and made a post on my blog (link at bottom). Here's a quick summary (since the article is quite long and contains file attachments): in SQLite you write callbacks in raw c++ header file (file.h) #include <iostream> #include <sqlite3.h> #include <cstdlib> #include <assert.h> ...


2

For the sqlite3 library, the cursor.execute() call always returns the cursor object again. Both your statements are identical here: >>> import sqlite3 >>> conn = sqlite3.connect(':memory:') >>> conn.cursor().execute('SELECT DATE()') <sqlite3.Cursor object at 0x1083d89d0> >>> cursor = conn.cursor() >>> ...


2

2gb limit is very old -- IIRC that was MSDE, which you could call Sql Express 2000. 2005 had 4gb, 2008 had 8gb and I think 2012 has 10gb limits. Anyhow, since all SQL Express is is a hamstrung version of SQL server the path I would take is to build / test against and distribute for SQL Express and let folks upsize to full-blown SQL Servers when they need ...


2

from http://developer.android.com/guide/topics/providers/content-providers.html You don't need to develop your own provider if you don't intend to share your data with other applications. However, you do need your own provider to provide custom search suggestions in your own application. You also need your own provider if you want to copy and paste ...


2

I don't think there's a good off-the-shelf solution at the database level. The way would approach this is roughly this: The database schema includes versioning information; this can be as simple as created/modified timestamps on each row, or you can fully historize everything, depending on your practical needs. The key here is that you need to be able to ...


2

SQLite itself has no problem with 100mb databases, as you can see here it can handle upwards of 140TB in a single database file. As for Android, each system has different constraints since various providers can decide how much physical memory to install along with which apps run at startup, etc. I imagine there should be little problem with a 100mb ...


1

Since you have this tagged as PHP... For PHP versions 5.0 up to but not including 5.4, SQLite was included in PHP by default. So there's nothing to install unless your particular build was compiled specifically not to include it. For later versions, you'll need to install the SQLite extension. On linux you can do this by installing the php5-sqlite3 ...


1

The database seems a bit pointless to me, if you don't need the data to be persistent you shouldn't be using a database, just an an array of structs instead. The cards however should be stored as a database to allow the system to be easily expanded, just remember to keep SQL injection in mind.


1

Generally speaking, when working with a database it should be set up so you don't have to worry about things like that. As EIYusubov suggested, you need to look into the code you are using for for DB access. What types of reads and writes are you requesting? (Most) DBs are intended to be multi-user and multi-threaded / multi-session. Sending data every ...



Only top voted, non community-wiki answers of a minimum length are eligible