Re: [web databases] about rowids

On Wed, 2 Sep 2009, João Eiras wrote:
> 
> Hi everyone.
> 
> 1) Currently, SqlResultSet.insertId is defined as a integer. This would 
> prevent user agents to use an underlying database engine that does not 
> rely on integers for rowids. For instance, both SQLite, MS Access, 
> Informix use integers it seems, DB2 uses a transparent type 17 bytes 
> big, Oracle uses strings, Java JDBC uses byte[].
> 
> For the sake of compatibility, it would probably be better to make 
> insertId either a string, or in the case of lack of agreement, a 
> implementation defined type, which is not desirable.

Since we're now requiring a sqlite-compatible backend, integer is right, no?


> 2) insertId only stores one row id. That's not very helpful for the case 
> of a "INSERT INTO table(...) SELECT ..." dml. Considering that the query 
> could produce an arbitrary number of rowids, the insertId field should 
> probably be a SqlResultSetRowList, or an array.

insertId is supposed to expose sqlite3_last_insert_rowid, which doesn't 
seem to support returning an array.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 1 December 2009 02:01:50 UTC