Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It does not require you to use Int64, however, it is possible that it only allows that when you specify a numeric primary key. Because sqlite doesn't really have referential integrity checking (though there has been recent discussion of this and perhaps dr hipp has even implemented, i haven't checked lately), all primary key means is "Make this column unique and create an index on it". there isn't much special about it. You can certainly use varchar or text for a primary key. for example, this works:</p> <pre><code>create table t_test ( theID varchar(36) primary key, nm varchar(50) ) </code></pre> <p>in the above you could use theID to store a guid in text form.</p> <p>More info can be found here: <a href="http://www.sqlite.org/lang_createtable.html#rowid" rel="nofollow noreferrer">http://www.sqlite.org/lang_createtable.html#rowid</a></p> <pre><code>@weenet ... per your comments, the following code works just fine. </code></pre> <p>i think you need to post your code if you're still having troubles.</p> <pre><code>create table t_test2 ( theID int32 primary key, nm varchar(50) ); insert into t_test2 (theID, nm) values (1, 'don'); insert into t_test2 (theID, nm) values (2, 'weenet'); select * from t_test2; </code></pre> <p>additionally, this code works fine (varchar as a primary key):</p> <pre><code>create table t_test ( theID varchar(36) primary key, nm varchar(50) ) insert into t_test (theID, nm) values ('abcdefg', 'don'); insert into t_test (theID, nm) values ('hijklmnop', 'weenet'); select * from t_test </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload