On Wed, 24 Oct 2007 05:21:03 +0200 (CEST), you wrote:

>Hello,
>
>I have few questions on SQLite3, i'm using it through
>pdo with php5.
>
>- is unsigned int available?

http://www.sqlite.org/datatype3.html
The range of available positive signed integers is large, and
you can avoid negative values with constraints or triggers.

>- can we insert a row with an autoinc primary key, so
>I don't need to provide it when I insert a new row?

Yes.


>- if NULL values are possible for primary keys, then
>autoinc key can't have this NULL on creation but can
>get it on updates if we updates the key with NULL.
>Right ?

If NULL values are possible, the column isn't suited as a
primary key.

>-if NULL values are possibles and primary key is not
>autoincremented then we have to supply the key during
>insert, then there is a risk of having a NOT UNIQUE
>error during insert and also during updates if we
>supply a NULL value during updates. Right ? 

Duplicates can be avoided using BEFORE triggers.
You cannot update (a single row) if you can't identify it.

>- As I understood, it's recommended to add NOT NULL
>for primary keys because SQLite allow NULL keys which
>are equals to the first signed int (-xxx48) so it's
>not unique if we have one row already and provide a
>NOT UNIQUE error. Right ?

It is recommended.

>-is there a way to manage foreign keys ? 

The syntax is supported and parsed.
You can enforce them with triggers.
http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers

>If unsigned int available for SQLite3 :
>- can integer autoincrement primary keys be unsigned ?
>- if we have an unsigned int primary key, with
>autoinc, does it begins with 0 or 1 ? 

It is signed and starts at 1.

>About text type:
>- What is the maximum value of a text data ?

http://www.sqlite.org/datatype3.html

>- Do (') have to be escaped (\') in the text string ? 
>- is there any ready made function in php to escape
>those (')?

You most likely don't have to escape quotes if you prepare /
bind the values. 

>Web links:
>-Do you know good web tutorials, code samples,
>opensource projects showing how to use SQLite mainly
>with php and pdo ? 

I am sure there are, but I don't know of any, up to now the
information in the PHP PDO documentation is enough for me.
Google is your friend.

>I read about it on php.net, litewebsite.com and
>sqlite.org indeed.
>
>
>Thanks
>David

HTH
-- 
  (  Kees Nuyt
  )
c[_]

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to