sqlite3-capi

How do I do an atomic INSERT IF NOT EXISTS equivalent in sqlite3?

The questions says it all really. I have a table and I want to insert a row if it doesn't already exist. or should I just do an insert and if the key constraint is violated then ignore it? ...