nakagami / micropg

PostgreSQL database driver for MicroPython
MIT License
25 stars 2 forks source link

Insert into table don't work #1

Closed divid3d closed 5 years ago

divid3d commented 5 years ago

Im trying to insert some data into table with: cur.execute('INSERT INTO test (serial, lat, long) VALUES ({}, {}, {});'.format(1,lat,long))

but seems nothing happens. Does this library support INSERT operations?

nakagami commented 5 years ago

'serial' and 'long' are data type. Please show me CREATE TABLE statement.

nakagami commented 5 years ago

Version 0.2.2 has released.

Fix error messages, and simple test script is added

https://github.com/nakagami/micropg/blob/master/test_micropg.py Check it

nakagami commented 5 years ago

Are you execute connection.commit() after insert statement ? Probabry you need

connection.commit()

after

cur.execute("insert into...")
divid3d commented 5 years ago

Thank you. Everything works fine. I didn't use conn.commit() after cur.execute().