Closed allanberry closed 5 years ago
That's sort of the intended behaviour. I'd reframe the sample like this:
db = dataset.connect('sqlite:///data/stuff.db')
if 'people' not in db:
table = db['people']
table.insert(dict(name='John Doe', age=46, country='China'))
Hi there, good software; thanks.
I bumped into this; seems like a bug to me, but as I'm new to the system, I might have missed something.
This works fine:
But if I try and make a table after checking whether it exists, it fails:
I get this:
If the table doesn't exist, shouldn't it just create it, regardless of whether it's in the
if not
clause?Thanks.