Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLTable.new doesn't add new rows. #131

Open
GoogleCodeExporter opened this issue Apr 8, 2016 · 1 comment
Open

SQLTable.new doesn't add new rows. #131

GoogleCodeExporter opened this issue Apr 8, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

from pygr import sqlgraph

si = sqlgraph.SQLiteServerInfo("/tmp/foo.sqlite")
tbl = sqlgraph.SQLTable("foo", serverInfo=si, writeable=True, 
createTable="CREATE TABLE foo (cid INT PRIMARY KEY, foo VARCHAR(40));")

tbl.new(cid=0, foo="ABC")
tbl.new(cid=1, foo="DEF")

What is the expected output? What do you see instead?
I would expect that there would be two rows in my new table; there are none 
added.

This functionality also does not work if I use MySQLServerInfo (or 
DBServerInfo).

Please use labels and text to provide additional information.
Using pygr-0.8.1, python 2.6.2, sqlite 3.6.23.1.

Original issue reported on code.google.com by kmda...@gmail.com on 15 Nov 2010 at 9:47

@GoogleCodeExporter
Copy link
Author

Adding this to the end fixes it, for sqlite:

si._connection.commit()

Original comment by kmda...@gmail.com on 18 Nov 2010 at 7:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant