4

I'm creating a WebSQL table in Chrome with the following statement:

'CREATE TABLE IF NOT EXISTS recs(id, fname,lname,email,country,comments, synced     integer,PRIMARY KEY(id))'

Inserting records does not appear to be creating primary keys. How should one go about creating unique keys in webSQL?

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
Fred
  • 3,786
  • 7
  • 41
  • 52

1 Answers1

4

Use the unique keyword and check for the constraint error to verify.

'CREATE TABLE IF NOT EXISTS recs (id unique, fname, lname)'
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265