SQLite Forum

Avoiding adding duplicate entries
Login
The argument to the execute method of a cursor is the SQL Statement String:

```
c.execute('create unique index table1timestamp on table1(timestamp)')
```

Note that this will create the index if it does not exist or throw an exception if an error occurs (such as the index already exists).