@mastra/mysql 0.0.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.
Files changed (52) hide show
  1. package/README.md +81 -0
  2. package/dist/index.cjs +10820 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +10803 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/storage/domains/agents/index.d.ts +62 -0
  9. package/dist/storage/domains/agents/index.d.ts.map +1 -0
  10. package/dist/storage/domains/background-tasks/index.d.ts +33 -0
  11. package/dist/storage/domains/background-tasks/index.d.ts.map +1 -0
  12. package/dist/storage/domains/blobs/index.d.ts +22 -0
  13. package/dist/storage/domains/blobs/index.d.ts.map +1 -0
  14. package/dist/storage/domains/channels/index.d.ts +34 -0
  15. package/dist/storage/domains/channels/index.d.ts.map +1 -0
  16. package/dist/storage/domains/datasets/index.d.ts +75 -0
  17. package/dist/storage/domains/datasets/index.d.ts.map +1 -0
  18. package/dist/storage/domains/experiments/index.d.ts +63 -0
  19. package/dist/storage/domains/experiments/index.d.ts.map +1 -0
  20. package/dist/storage/domains/favorites/index.d.ts +49 -0
  21. package/dist/storage/domains/favorites/index.d.ts.map +1 -0
  22. package/dist/storage/domains/mcp-clients/index.d.ts +61 -0
  23. package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -0
  24. package/dist/storage/domains/mcp-servers/index.d.ts +61 -0
  25. package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -0
  26. package/dist/storage/domains/memory/index.d.ts +110 -0
  27. package/dist/storage/domains/memory/index.d.ts.map +1 -0
  28. package/dist/storage/domains/observability/index.d.ts +35 -0
  29. package/dist/storage/domains/observability/index.d.ts.map +1 -0
  30. package/dist/storage/domains/operations/index.d.ts +106 -0
  31. package/dist/storage/domains/operations/index.d.ts.map +1 -0
  32. package/dist/storage/domains/prompt-blocks/index.d.ts +42 -0
  33. package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -0
  34. package/dist/storage/domains/schedules/index.d.ts +33 -0
  35. package/dist/storage/domains/schedules/index.d.ts.map +1 -0
  36. package/dist/storage/domains/scorer-definitions/index.d.ts +43 -0
  37. package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
  38. package/dist/storage/domains/scores/index.d.ts +87 -0
  39. package/dist/storage/domains/scores/index.d.ts.map +1 -0
  40. package/dist/storage/domains/skills/index.d.ts +61 -0
  41. package/dist/storage/domains/skills/index.d.ts.map +1 -0
  42. package/dist/storage/domains/tool-provider-connections/index.d.ts +46 -0
  43. package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
  44. package/dist/storage/domains/utils.d.ts +40 -0
  45. package/dist/storage/domains/utils.d.ts.map +1 -0
  46. package/dist/storage/domains/workflows/index.d.ts +78 -0
  47. package/dist/storage/domains/workflows/index.d.ts.map +1 -0
  48. package/dist/storage/domains/workspaces/index.d.ts +61 -0
  49. package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
  50. package/dist/storage/index.d.ts +58 -0
  51. package/dist/storage/index.d.ts.map +1 -0
  52. package/package.json +68 -0
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @mastra/mysql
2
+
3
+ MySQL storage provider for Mastra.
4
+
5
+ ## Stable v1.5 Compatibility
6
+
7
+ This version has been adapted to meet the stable v1.5 contract for Mastra storage adapters. It supports:
8
+
9
+ - Full observability/tracing (spans, traces)
10
+ - Workflow run management
11
+ - Thread and message persistence
12
+ - Scoring and evaluation storage
13
+
14
+ To verify compatibility:
15
+
16
+ ```bash
17
+ pnpm exec tsc --noEmit
18
+ pnpm test src/storage/index.unit.test.ts
19
+ ```
20
+
21
+ ## Running the test suite
22
+
23
+ ### Unit tests (no database required)
24
+
25
+ Run unit tests that don't require a database connection:
26
+
27
+ ```bash
28
+ # Run all unit tests
29
+ pnpm test src/storage/domains/utils.test.ts src/storage/index.unit.test.ts
30
+
31
+ # Or run just the unit test file
32
+ pnpm test src/storage/index.unit.test.ts
33
+ ```
34
+
35
+ ### Integration tests (requires Docker)
36
+
37
+ The integration test suite uses Docker to run a MySQL instance:
38
+
39
+ ```bash
40
+ # Ensure Docker is running, then run all tests including integration tests
41
+ pnpm test
42
+ ```
43
+
44
+ This will automatically start a MySQL container, run the tests, and clean up afterward.
45
+
46
+ ## Environment Variables
47
+
48
+ You can override the default database connection settings:
49
+
50
+ - `MYSQL_HOST` (default: localhost)
51
+ - `MYSQL_PORT` (default: 3306)
52
+ - `MYSQL_USER` (default: mastra)
53
+ - `MYSQL_PASSWORD` (default: mastra)
54
+ - `MYSQL_DB` (default: mastra)
55
+
56
+ ## Rollback Procedure
57
+
58
+ If issues arise with this version, follow these steps to rollback:
59
+
60
+ 1. Checkout the last known good commit:
61
+ ```bash
62
+ git checkout <last-known-good-commit>
63
+ ```
64
+ 2. Reinstall dependencies:
65
+ ```bash
66
+ pnpm install
67
+ ```
68
+ 3. Verify the previous state:
69
+ ```bash
70
+ pnpm exec tsc --noEmit
71
+ pnpm test src/storage/index.unit.test.ts
72
+ ```
73
+
74
+ ## Notes
75
+
76
+ - Integration tests require Docker to be running
77
+ - The test suite includes both unit tests and integration tests
78
+ - Unit tests use mocked MySQL connections and run quickly without external dependencies
79
+ - Integration tests verify real database interactions and require a running MySQL instance
80
+ - AI tracing features (span creation, updates, pagination, and batch operations) are supported by the MySQL observability domain.
81
+ - Observability tables are initialized during store setup.