Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can argue that SQLite doesn't support data <em>types</em> at all. In SQLite3, you can do this, for example.</p> <pre><code>sqlite&gt; create table test (id wibblewibble primary key); </code></pre> <p>SQLite will happily create a column with the "data type" wibblewibble. SQLite will also happily create columns with the "data types" uuid, guid, and SuperChicken.</p> <p>The crucial point for you is probably how to automatically generate a uid. SQLite can't help you much there. </p> <p>You can leave it entirely up to the client program. If you're programming in python, use the <a href="http://www.doughellmann.com/PyMOTW/uuid/" rel="noreferrer">uuid module</a>. In ruby, you have the <a href="http://rubydoc.info/stdlib/securerandom/1.9.2/SecureRandom#uuid-class_method" rel="noreferrer">SecureRandom.uuid function</a>. Other languages have similar features or workarounds.</p> <p>You can write your own uid-generating function in C. (See <a href="http://www.sqlite.org/c3ref/create_function.html" rel="noreferrer">Create or Redefine SQL Functions</a>.) I'd call this a relatively extreme approach. </p> <p>You can store it in either <a href="https://stackoverflow.com/q/1039461/562459">binary</a> or <a href="https://stackoverflow.com/q/5066392/562459">text</a> format.</p> <hr> <p>Other conversations online suggest that there's a widespread misunderstanding about what a UUID <em>is</em>. A UUID is not simply a 128-bit random number. A UUID has structure and rules. See <a href="https://www.ietf.org/rfc/rfc4122.txt" rel="noreferrer">RFC 4122</a>.</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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