@daydream-technologies/3d-db-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -0
- package/dist/http.js +144 -0
- package/dist/index.js +44 -0
- package/dist/mcp.js +112 -0
- package/dist/setup.js +89 -0
- package/dist/token.js +9 -0
- package/package.json +39 -0
- package/static/assets/index-B0dnwIo5.css +1 -0
- package/static/assets/index-MBzCJJWx.js +5054 -0
- package/static/docs/IMPORT_MONGODB.md +63 -0
- package/static/docs/IMPORT_MYSQL.md +52 -0
- package/static/docs/IMPORT_POSTGRES.md +15 -0
- package/static/docs/IMPORT_SUPABASE.md +82 -0
- package/static/docs/SCHEMA_FORMAT.md +63 -0
- package/static/index.html +14 -0
- package/static/learn/lessons.md +242 -0
- package/static/samples/blog.json +83 -0
- package/static/samples/ecommerce.json +103 -0
- package/static/samples/library.json +79 -0
- package/static/samples/restaurant/13_cte_repeat_customers.sql +20 -0
- package/static/samples/restaurant/14_union_active_contacts.sql +25 -0
- package/static/samples/restaurant/15_distinct_customer_methods.sql +10 -0
- package/static/samples/restaurant/16_full_join_staff_shifts.sql +12 -0
- package/static/samples/restaurant/17_like_menu_search.sql +12 -0
- package/static/samples/restaurant/18_is_null_missing_data.sql +13 -0
- package/static/samples/restaurant/19_offset_pagination.sql +13 -0
- package/static/samples/restaurant/20_from_subquery_top_items.sql +20 -0
- package/static/samples/restaurant/21_between_date_range.sql +13 -0
- package/static/samples/restaurant/22_right_join_unused_promos.sql +14 -0
- package/static/samples/restaurant/proposal-add-loyalty.json +131 -0
- package/static/samples/restaurant/proposal-baseline.json +66 -0
- package/static/samples/restaurant/schema_postgres.sql +221 -0
- package/static/samples/restaurant-antipatterns.json +111 -0
- package/static/samples/restaurant.json +425 -0
- package/static/vite.svg +5 -0
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Restaurant",
|
|
3
|
+
"tables": [
|
|
4
|
+
{
|
|
5
|
+
"name": "roles",
|
|
6
|
+
"rowCount": 4,
|
|
7
|
+
"columns": [
|
|
8
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
9
|
+
{ "name": "code", "type": "text", "nullable": false, "indexed": true },
|
|
10
|
+
{ "name": "name", "type": "text", "nullable": false }
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "order_statuses",
|
|
15
|
+
"rowCount": 5,
|
|
16
|
+
"columns": [
|
|
17
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
18
|
+
{ "name": "code", "type": "text", "nullable": false, "indexed": true },
|
|
19
|
+
{ "name": "name", "type": "text", "nullable": false }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "reservation_statuses",
|
|
24
|
+
"rowCount": 5,
|
|
25
|
+
"columns": [
|
|
26
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
27
|
+
{ "name": "code", "type": "text", "nullable": false, "indexed": true },
|
|
28
|
+
{ "name": "name", "type": "text", "nullable": false }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "waitlist_statuses",
|
|
33
|
+
"rowCount": 3,
|
|
34
|
+
"columns": [
|
|
35
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
36
|
+
{ "name": "code", "type": "text", "nullable": false, "indexed": true },
|
|
37
|
+
{ "name": "name", "type": "text", "nullable": false }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "allergens",
|
|
42
|
+
"rowCount": 4,
|
|
43
|
+
"columns": [
|
|
44
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
45
|
+
{ "name": "name", "type": "text", "nullable": false, "indexed": true }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "kitchen_stations",
|
|
50
|
+
"rowCount": 4,
|
|
51
|
+
"columns": [
|
|
52
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
53
|
+
{ "name": "code", "type": "text", "nullable": false, "indexed": true },
|
|
54
|
+
{ "name": "name", "type": "text", "nullable": false }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "locations",
|
|
59
|
+
"rowCount": 2,
|
|
60
|
+
"columns": [
|
|
61
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
62
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
63
|
+
{ "name": "address", "type": "text", "nullable": false },
|
|
64
|
+
{ "name": "phone", "type": "text", "nullable": true }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "dining_tables",
|
|
69
|
+
"rowCount": 7,
|
|
70
|
+
"columns": [
|
|
71
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
72
|
+
{
|
|
73
|
+
"name": "location_id",
|
|
74
|
+
"type": "integer",
|
|
75
|
+
"nullable": false,
|
|
76
|
+
"foreignKey": { "table": "locations", "column": "id" },
|
|
77
|
+
"indexed": true
|
|
78
|
+
},
|
|
79
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
80
|
+
{ "name": "capacity", "type": "integer", "nullable": false },
|
|
81
|
+
{ "name": "is_active", "type": "integer", "nullable": false }
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "staff",
|
|
86
|
+
"rowCount": 6,
|
|
87
|
+
"columns": [
|
|
88
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
89
|
+
{
|
|
90
|
+
"name": "role_id",
|
|
91
|
+
"type": "integer",
|
|
92
|
+
"nullable": false,
|
|
93
|
+
"foreignKey": { "table": "roles", "column": "id" },
|
|
94
|
+
"indexed": true
|
|
95
|
+
},
|
|
96
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
97
|
+
{ "name": "email", "type": "text", "nullable": true },
|
|
98
|
+
{ "name": "hired_at", "type": "text", "nullable": false },
|
|
99
|
+
{ "name": "is_active", "type": "integer", "nullable": false }
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "customers",
|
|
104
|
+
"rowCount": 8500,
|
|
105
|
+
"columns": [
|
|
106
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
107
|
+
{ "name": "name", "type": "text", "nullable": false, "indexed": true },
|
|
108
|
+
{ "name": "email", "type": "text", "nullable": true },
|
|
109
|
+
{ "name": "phone", "type": "text", "nullable": true, "indexed": true },
|
|
110
|
+
{ "name": "created_at", "type": "text", "nullable": false }
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "menu_categories",
|
|
115
|
+
"rowCount": 5,
|
|
116
|
+
"columns": [
|
|
117
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
118
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
119
|
+
{ "name": "sort_order", "type": "integer", "nullable": false }
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "menu_items",
|
|
124
|
+
"rowCount": 15,
|
|
125
|
+
"columns": [
|
|
126
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
127
|
+
{
|
|
128
|
+
"name": "category_id",
|
|
129
|
+
"type": "integer",
|
|
130
|
+
"nullable": false,
|
|
131
|
+
"foreignKey": { "table": "menu_categories", "column": "id" },
|
|
132
|
+
"indexed": true
|
|
133
|
+
},
|
|
134
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
135
|
+
{ "name": "description", "type": "text", "nullable": true },
|
|
136
|
+
{ "name": "price_cents", "type": "integer", "nullable": false },
|
|
137
|
+
{
|
|
138
|
+
"name": "kitchen_station_id",
|
|
139
|
+
"type": "integer",
|
|
140
|
+
"nullable": true,
|
|
141
|
+
"foreignKey": { "table": "kitchen_stations", "column": "id" }
|
|
142
|
+
},
|
|
143
|
+
{ "name": "is_available", "type": "integer", "nullable": false, "indexed": true }
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "suppliers",
|
|
148
|
+
"rowCount": 3,
|
|
149
|
+
"columns": [
|
|
150
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
151
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
152
|
+
{ "name": "contact_phone", "type": "text", "nullable": true }
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "inventory_items",
|
|
157
|
+
"rowCount": 8,
|
|
158
|
+
"columns": [
|
|
159
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
160
|
+
{ "name": "sku", "type": "text", "nullable": false, "indexed": true },
|
|
161
|
+
{ "name": "name", "type": "text", "nullable": false },
|
|
162
|
+
{ "name": "unit", "type": "text", "nullable": false },
|
|
163
|
+
{ "name": "quantity_on_hand", "type": "real", "nullable": false },
|
|
164
|
+
{ "name": "reorder_point", "type": "real", "nullable": false }
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "promotions",
|
|
169
|
+
"rowCount": 2,
|
|
170
|
+
"columns": [
|
|
171
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
172
|
+
{ "name": "code", "type": "text", "nullable": false, "indexed": true },
|
|
173
|
+
{ "name": "discount_pct", "type": "integer", "nullable": false },
|
|
174
|
+
{ "name": "valid_from", "type": "text", "nullable": false },
|
|
175
|
+
{ "name": "valid_to", "type": "text", "nullable": false }
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "menu_item_allergens",
|
|
180
|
+
"rowCount": 6,
|
|
181
|
+
"columns": [
|
|
182
|
+
{
|
|
183
|
+
"name": "menu_item_id",
|
|
184
|
+
"type": "integer",
|
|
185
|
+
"nullable": false,
|
|
186
|
+
"primaryKey": true,
|
|
187
|
+
"foreignKey": { "table": "menu_items", "column": "id" }
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "allergen_id",
|
|
191
|
+
"type": "integer",
|
|
192
|
+
"nullable": false,
|
|
193
|
+
"primaryKey": true,
|
|
194
|
+
"foreignKey": { "table": "allergens", "column": "id" }
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "supplier_items",
|
|
200
|
+
"rowCount": 8,
|
|
201
|
+
"columns": [
|
|
202
|
+
{
|
|
203
|
+
"name": "supplier_id",
|
|
204
|
+
"type": "integer",
|
|
205
|
+
"nullable": false,
|
|
206
|
+
"primaryKey": true,
|
|
207
|
+
"foreignKey": { "table": "suppliers", "column": "id" }
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "inventory_item_id",
|
|
211
|
+
"type": "integer",
|
|
212
|
+
"nullable": false,
|
|
213
|
+
"primaryKey": true,
|
|
214
|
+
"foreignKey": { "table": "inventory_items", "column": "id" }
|
|
215
|
+
},
|
|
216
|
+
{ "name": "unit_cost_cents", "type": "integer", "nullable": false }
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "menu_item_recipe",
|
|
221
|
+
"rowCount": 8,
|
|
222
|
+
"columns": [
|
|
223
|
+
{
|
|
224
|
+
"name": "menu_item_id",
|
|
225
|
+
"type": "integer",
|
|
226
|
+
"nullable": false,
|
|
227
|
+
"primaryKey": true,
|
|
228
|
+
"foreignKey": { "table": "menu_items", "column": "id" }
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "inventory_item_id",
|
|
232
|
+
"type": "integer",
|
|
233
|
+
"nullable": false,
|
|
234
|
+
"primaryKey": true,
|
|
235
|
+
"foreignKey": { "table": "inventory_items", "column": "id" }
|
|
236
|
+
},
|
|
237
|
+
{ "name": "qty_per_portion", "type": "real", "nullable": false }
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "shifts",
|
|
242
|
+
"rowCount": 2400,
|
|
243
|
+
"columns": [
|
|
244
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
245
|
+
{
|
|
246
|
+
"name": "staff_id",
|
|
247
|
+
"type": "integer",
|
|
248
|
+
"nullable": false,
|
|
249
|
+
"foreignKey": { "table": "staff", "column": "id" },
|
|
250
|
+
"indexed": true
|
|
251
|
+
},
|
|
252
|
+
{ "name": "starts_at", "type": "text", "nullable": false, "indexed": true },
|
|
253
|
+
{ "name": "ends_at", "type": "text", "nullable": false }
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "orders",
|
|
258
|
+
"rowCount": 52000,
|
|
259
|
+
"columns": [
|
|
260
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
261
|
+
{
|
|
262
|
+
"name": "customer_id",
|
|
263
|
+
"type": "integer",
|
|
264
|
+
"nullable": false,
|
|
265
|
+
"foreignKey": { "table": "customers", "column": "id" },
|
|
266
|
+
"indexed": true
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "dining_table_id",
|
|
270
|
+
"type": "integer",
|
|
271
|
+
"nullable": true,
|
|
272
|
+
"foreignKey": { "table": "dining_tables", "column": "id" },
|
|
273
|
+
"indexed": true
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "order_status_id",
|
|
277
|
+
"type": "integer",
|
|
278
|
+
"nullable": false,
|
|
279
|
+
"foreignKey": { "table": "order_statuses", "column": "id" },
|
|
280
|
+
"indexed": true
|
|
281
|
+
},
|
|
282
|
+
{ "name": "placed_at", "type": "text", "nullable": false, "indexed": true },
|
|
283
|
+
{ "name": "notes", "type": "text", "nullable": true }
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "order_lines",
|
|
288
|
+
"rowCount": 145000,
|
|
289
|
+
"columns": [
|
|
290
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
291
|
+
{
|
|
292
|
+
"name": "order_id",
|
|
293
|
+
"type": "integer",
|
|
294
|
+
"nullable": false,
|
|
295
|
+
"foreignKey": { "table": "orders", "column": "id" },
|
|
296
|
+
"indexed": true
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"name": "menu_item_id",
|
|
300
|
+
"type": "integer",
|
|
301
|
+
"nullable": false,
|
|
302
|
+
"foreignKey": { "table": "menu_items", "column": "id" },
|
|
303
|
+
"indexed": true
|
|
304
|
+
},
|
|
305
|
+
{ "name": "qty", "type": "integer", "nullable": false },
|
|
306
|
+
{ "name": "unit_price_cents", "type": "integer", "nullable": false }
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "order_promotions",
|
|
311
|
+
"rowCount": 18000,
|
|
312
|
+
"columns": [
|
|
313
|
+
{
|
|
314
|
+
"name": "order_id",
|
|
315
|
+
"type": "integer",
|
|
316
|
+
"nullable": false,
|
|
317
|
+
"primaryKey": true,
|
|
318
|
+
"foreignKey": { "table": "orders", "column": "id" }
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "promotion_id",
|
|
322
|
+
"type": "integer",
|
|
323
|
+
"nullable": false,
|
|
324
|
+
"primaryKey": true,
|
|
325
|
+
"foreignKey": { "table": "promotions", "column": "id" }
|
|
326
|
+
},
|
|
327
|
+
{ "name": "discount_cents", "type": "integer", "nullable": false }
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "payments",
|
|
332
|
+
"rowCount": 52000,
|
|
333
|
+
"columns": [
|
|
334
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
335
|
+
{
|
|
336
|
+
"name": "order_id",
|
|
337
|
+
"type": "integer",
|
|
338
|
+
"nullable": false,
|
|
339
|
+
"foreignKey": { "table": "orders", "column": "id" },
|
|
340
|
+
"indexed": true
|
|
341
|
+
},
|
|
342
|
+
{ "name": "method", "type": "text", "nullable": false },
|
|
343
|
+
{ "name": "amount_cents", "type": "integer", "nullable": false },
|
|
344
|
+
{ "name": "processed_at", "type": "text", "nullable": false, "indexed": true }
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "reservations",
|
|
349
|
+
"rowCount": 12000,
|
|
350
|
+
"columns": [
|
|
351
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
352
|
+
{
|
|
353
|
+
"name": "customer_id",
|
|
354
|
+
"type": "integer",
|
|
355
|
+
"nullable": false,
|
|
356
|
+
"foreignKey": { "table": "customers", "column": "id" }
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "dining_table_id",
|
|
360
|
+
"type": "integer",
|
|
361
|
+
"nullable": false,
|
|
362
|
+
"foreignKey": { "table": "dining_tables", "column": "id" },
|
|
363
|
+
"indexed": true
|
|
364
|
+
},
|
|
365
|
+
{ "name": "party_size", "type": "integer", "nullable": false },
|
|
366
|
+
{ "name": "start_at", "type": "text", "nullable": false, "indexed": true },
|
|
367
|
+
{ "name": "end_at", "type": "text", "nullable": false },
|
|
368
|
+
{
|
|
369
|
+
"name": "reservation_status_id",
|
|
370
|
+
"type": "integer",
|
|
371
|
+
"nullable": false,
|
|
372
|
+
"foreignKey": { "table": "reservation_statuses", "column": "id" },
|
|
373
|
+
"indexed": true
|
|
374
|
+
},
|
|
375
|
+
{ "name": "notes", "type": "text", "nullable": true }
|
|
376
|
+
]
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "waitlist",
|
|
380
|
+
"rowCount": 3200,
|
|
381
|
+
"columns": [
|
|
382
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
383
|
+
{
|
|
384
|
+
"name": "customer_id",
|
|
385
|
+
"type": "integer",
|
|
386
|
+
"nullable": false,
|
|
387
|
+
"foreignKey": { "table": "customers", "column": "id" }
|
|
388
|
+
},
|
|
389
|
+
{ "name": "party_size", "type": "integer", "nullable": false },
|
|
390
|
+
{ "name": "requested_at", "type": "text", "nullable": false, "indexed": true },
|
|
391
|
+
{
|
|
392
|
+
"name": "waitlist_status_id",
|
|
393
|
+
"type": "integer",
|
|
394
|
+
"nullable": false,
|
|
395
|
+
"foreignKey": { "table": "waitlist_statuses", "column": "id" },
|
|
396
|
+
"indexed": true
|
|
397
|
+
},
|
|
398
|
+
{ "name": "notes", "type": "text", "nullable": true }
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "reviews",
|
|
403
|
+
"rowCount": 28000,
|
|
404
|
+
"columns": [
|
|
405
|
+
{ "name": "id", "type": "integer", "primaryKey": true },
|
|
406
|
+
{
|
|
407
|
+
"name": "customer_id",
|
|
408
|
+
"type": "integer",
|
|
409
|
+
"nullable": false,
|
|
410
|
+
"foreignKey": { "table": "customers", "column": "id" }
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "order_id",
|
|
414
|
+
"type": "integer",
|
|
415
|
+
"nullable": false,
|
|
416
|
+
"foreignKey": { "table": "orders", "column": "id" },
|
|
417
|
+
"indexed": true
|
|
418
|
+
},
|
|
419
|
+
{ "name": "rating", "type": "integer", "nullable": false },
|
|
420
|
+
{ "name": "comment", "type": "text", "nullable": true },
|
|
421
|
+
{ "name": "created_at", "type": "text", "nullable": false }
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
]
|
|
425
|
+
}
|
package/static/vite.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
|
2
|
+
<rect width="32" height="32" rx="6" fill="#1a2332"/>
|
|
3
|
+
<path d="M8 22V10l4 6 4-6v12" stroke="#38bdf8" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M20 10h4v12h-4" stroke="#94a3b8" stroke-width="2" fill="none" stroke-linecap="round"/>
|
|
5
|
+
</svg>
|