For example, I have table names
: id integer primary key, name text unique
and unique index for names(name)
.
I want to select records by index-style syntax: (n12, nBill) = (Name[12], Name['Bill'])
or with Name.get['Smitt']
.
As documentation says, it can be done with "natural keys", but how create them at SQLite?
update:
@Frost: As Spotlight on... Composite Keys says, records with composite keys must be called with both keys:
Name.get(1, 'Smitt')
, it is wrong for me. I need something to select record by any key:
Name[1] == Name['Smitt']
.