
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
@caleblawson/cloudflare-d1
Advanced tools
A Mastra store for Cloudflare D1 SQL databases, supporting threads, messages, workflows, evaluations, and traces with robust SQL features.
pnpm add @mastra/cloudflare-d1
import { D1Store } from '@mastra/cloudflare-d1';
const store = new D1Store({
binding: env.DB, // D1Database binding from Worker environment
tablePrefix: 'mastra_', // optional
});
import { D1Store } from '@mastra/cloudflare-d1';
const store = new D1Store({
accountId: '<your-account-id>',
databaseId: '<your-d1-database-id>',
apiToken: '<your-api-token>',
tablePrefix: 'mastra_', // optional
});
saveThread(thread): Create or update a threadgetThreadById({ threadId }): Get a thread by IDgetThreadsByResourceId({ resourceId }): Fetch all threads associated with a resource.updateThread({ id, title, metadata }): Update the title and/or metadata of a thread.deleteThread({ threadId }): Delete a thread and all its messages.saveMessages({ messages }): Save multiple messages in a batch operation (uses prepared statements).getMessages({ threadId, selectBy? }): Retrieve messages for a thread, with optional filtering (e.g., last N, include surrounding messages).persistWorkflowSnapshot({ workflowName, runId, snapshot }): Save workflow state for a given workflow/run.loadWorkflowSnapshot({ workflowName, runId }): Load persisted workflow state.getTraces({ name?, scope?, page, perPage, attributes? }): Query trace records with optional filters and pagination.getEvalsByAgentName({ agentName, type? }): Query evaluation results by agent name.clearTable({ tableName }): Remove all records from a logical table.batchInsert({ tableName, records }): Batch insert multiple records.insert({ tableName, record }): Insert a single record into a table.The D1 store supports the following data types:
text: Stringtimestamp: ISO8601 string (converted to/from Date)uuid: Stringjsonb: JSON-encoded objectinteger: Integer (for internal counters, etc)All metadata and custom fields are automatically serialized/deserialized as JSON.
| Option | Type | Description |
|---|---|---|
| binding | D1Database | D1 Workers binding (for Workers) |
| accountId | string | Cloudflare Account ID (for REST API) |
| databaseId | string | D1 Database ID (for REST API) |
| apiToken | string | Cloudflare API Token (for REST API) |
| tablePrefix | string | Optional prefix for all table names |
Each logical Mastra table maps to a SQL table in D1 (with optional prefix):
mastra_threads — stores threadsmastra_messages — stores messagesmastra_workflow_snapshot — stores workflow snapshotsmastra_evals — stores evaluationsmastra_traces — stores traces(The prefix is configurable via tablePrefix.)
No explicit cleanup is required. Connections are managed by the platform.
FAQs
D1 provider for Mastra - includes db storage capabilities
We found that @caleblawson/cloudflare-d1 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.