@@ -66,7 +66,7 @@ def example_updates():
6666 client .execute ("CREATE TABLE IF NOT EXISTS users (id INT PRIMARY KEY, name VARCHAR, age INT)" )
6767
6868 # Insert
69- rows = client .execute ("INSERT INTO users (name, age) VALUES ('Alice', 25)" )
69+ rows = client .execute ("INSERT INTO users (id, name, age) VALUES (1, 'Alice', 25)" )
7070 print (f"Inserted { rows } rows" )
7171
7272 # Update
@@ -118,11 +118,11 @@ def example_transactions():
118118 with client .begin_transaction ():
119119 # Execute queries in transaction
120120 client .execute (
121- "INSERT INTO users (name, age) VALUES ('Bob', 30)" ,
121+ "INSERT INTO users (id, name, age) VALUES (2, 'Bob', 30)" ,
122122 )
123123
124124 client .execute (
125- "INSERT INTO users (name, age) VALUES ('Carol', 28)" ,
125+ "INSERT INTO users (id, name, age) VALUES (3, 'Carol', 28)" ,
126126 )
127127
128128 # Transaction will be committed automatically or rollback
@@ -170,6 +170,6 @@ def example_metadata():
170170if __name__ == "__main__" :
171171 example_updates ()
172172 example_basic_query ()
173- example_prepared_statement ()
174173 example_transactions ()
174+ example_prepared_statement ()
175175 example_metadata ()
0 commit comments