Hi all

I have been trying to find reliable documentation for SQLite to use during 
Android app development.

I assume that to be on the safe side I should go for SQLite 3.4.0, as this 
is stated here: 
http://developer.android.com/reference/android/database/sqlite/package-summary.html

The only reference to SQLite documentation I can find on the developer site 
is here: 
http://developer.android.com/guide/topics/data/data-storage.html#dbwhere there 
is a link 
SQLite. <http://www.sqlite.org/>
Following that link I can only find documentation for the latest version 
(3.7.7.1), not for 3.4.0 (disregarding change notes for each version).
I spent some time Googeling around on the Internet, but I could not find the 
3.4.0 documentation viewable anywhere.

In the end I found a 3.4.0 tarball and built the documentation, but the 
syntax differs from examples in the book Android Wireless Application 
Development, written for Android 2.2.
In that book (on p. 241) there is an example on how to create a foreign key 
and add a constraint using a trigger. In that example, a foreign key is 
defined using syntax like:

a_fk INTEGER NOT NULL CONSTRAINT a_fk REFERENCES another_table(pk) ON DELETE 
CASCADE

The problem is that the definition above uses a syntax that I can not find 
in the 3.4.0 documentation, where the syntax for CREATE TABLE looks like 
below:

CREATE TABLE *sql-command* ::= *CREATE *[*TEMP *|* TEMPORARY*]* TABLE *[*IF 
NOT EXISTS*]* *[*database-name** .*]* **table-name** (
    **column-def** *[*, **column-def*]**
    *[*, **constraint*]**
)* *sql-command* ::= *CREATE *[*TEMP *|* TEMPORARY*]* TABLE *[*database-name
**.*]* **table-name** AS **select-statement* *column-def* ::= *name** *[*
type*]* *[[*CONSTRAINT **name*]* **column-constraint*]* *type* ::= *typename
** *|*
**typename** ( **number** ) *|*
**typename** ( **number** , **number** )* *column-constraint* ::= *NOT NULL 
*[* **conflict-clause** *]* *|*
PRIMARY KEY *[*sort-order*]* *[* **conflict-clause** *]* *[*AUTOINCREMENT*]* 
*|*
UNIQUE *[* **conflict-clause** *]* *|*
CHECK ( **expr** ) *|*
DEFAULT **value** *|*
COLLATE **collation-name* *constraint* ::= *PRIMARY KEY ( **column-list** ) 
*[* **conflict-clause** *]* *|*
UNIQUE ( **column-list** ) *[* **conflict-clause** *]* *|*
CHECK ( **expr** )* *conflict-clause* ::= *ON CONFLICT **conflict-algorithm*I 
can neither find the REFERENCE nor the DELETE keyword in the syntax 
definition.
I have not found any statement in the book saying which SQLite version it is 
written for, though.

So, I'm not certain if I should go for what's in that book, or use the 3.4.0 
documentation I built, and try to figure out myself how to properly create a 
foreign key, constraint and so on.
I really think, that the android developer site, stating that 3.4.0 is the 
right version, should include, or refer to, full documentation for that 
version.

I really wonder how developers do when they create apps using SQLite. How on 
earth do they know what to (not) use?

Can anyone guide me please?

Regards,

Jan




-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to