MCPcopy
hub / github.com/openai/swarm / initialize_database

Function initialize_database

examples/personal_shopper/database.py:154–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152
153# Initialize and load database
154def initialize_database():
155 global conn
156
157 # Initialize the database tables
158 create_database()
159
160 # Add some initial users
161 initial_users = [
162 (1, "Alice", "Smith", "alice@test.com", "123-456-7890"),
163 (2, "Bob", "Johnson", "bob@test.com", "234-567-8901"),
164 (3, "Sarah", "Brown", "sarah@test.com", "555-567-8901"),
165 # Add more initial users here
166 ]
167
168 for user in initial_users:
169 add_user(*user)
170
171 # Add some initial purchases
172 initial_purchases = [
173 (1, "2024-01-01", 101, 99.99),
174 (2, "2023-12-25", 100, 39.99),
175 (3, "2023-11-14", 307, 49.99),
176 ]
177
178 for purchase in initial_purchases:
179 add_purchase(*purchase)
180
181 initial_products = [
182 (7, "Hat", 19.99),
183 (8, "Wool socks", 29.99),
184 (9, "Shoes", 39.99),
185 ]
186
187 for product in initial_products:
188 add_product(*product)

Callers

nothing calls this directly

Calls 4

create_databaseFunction · 0.85
add_userFunction · 0.85
add_purchaseFunction · 0.85
add_productFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…