from medinfo.db import DBUtil db = DBUtil('mydatabase.db') db.create_table('users', ['id INTEGER PRIMARY KEY', 'name TEXT', 'email TEXT'])
from medinfo.db import DBUtil db = DBUtil('mydatabase.db') db.insert('users', {'name': 'John', 'email': '[email protected]'}) db.insert('users', {'name': 'Jane', 'email': '[email protected]'})
from medinfo.db import DBUtil db = DBUtil('mydatabase.db') result = db.select('users', {'name': 'John'}) print(result)This code selects all records from the `users` table in the `mydatabase.db` database where the `name` column is equal to `'John'` and prints the result to the console. In conclusion, the python medinfo.db DBUtil package library provides a convenient way to interact with databases using python. The examples illustrated how to perform basic database operations such as creating tables, inserting and updating data, and querying the database.