From memgraph
Configures Memgraph database triggers, transactions, storage modes, snapshots, WAL, and memory limits. Useful for runtime configuration and data durability settings.
How this skill is triggered — by the user, by Claude, or both
Slash command
/memgraph:memgraph-database-configurationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
CREATE TRIGGER name
[SECURITY DEFINER|INVOKER]
[ON [() | -->] CREATE|UPDATE|DELETE]
[BEFORE|AFTER COMMIT]
EXECUTE <cypher statements>
Default security: DEFINER. Triggers are persisted to disk.
| Event | Available variables |
|---|---|
ON () CREATE | createdVertices |
ON --> CREATE | createdEdges |
ON CREATE | createdVertices, createdEdges, createdObjects |
ON () UPDATE | setVertexProperties, removedVertexProperties, setVertexLabels, removedVertexLabels, updatedVertices |
ON --> UPDATE | setEdgeProperties, removedEdgeProperties, updatedEdges |
ON UPDATE | All update vars + updatedObjects |
ON () DELETE | deletedVertices |
ON --> DELETE | deletedEdges |
ON DELETE | deletedVertices, deletedEdges, deletedObjects |
| No event | All variables available |
Auto-set creation timestamp:
CREATE TRIGGER setCreatedAt
ON () CREATE AFTER COMMIT EXECUTE
UNWIND createdVertices AS v SET v.created_at = timestamp();
Auto-set updated_at:
CREATE TRIGGER setUpdatedAt
ON UPDATE AFTER COMMIT EXECUTE
UNWIND updatedObjects AS obj
WITH CASE
WHEN obj.vertex IS NOT null THEN obj.vertex
WHEN obj.edge IS NOT null THEN obj.edge
END AS entity
SET entity.updated_at = timestamp();
Dynamic PageRank via trigger:
CREATE TRIGGER pagerankTrigger
BEFORE COMMIT EXECUTE
CALL pagerank_online.update(createdVertices, createdEdges, deletedVertices, deletedEdges)
YIELD node, rank SET node.rank = rank;
DROP TRIGGER name;
SHOW TRIGGERS;
BEGIN;
MATCH (n:Account {id: 1}) SET n.balance = n.balance - 100;
MATCH (n:Account {id: 2}) SET n.balance = n.balance + 100;
COMMIT;
ROLLBACK; to discard. If any query fails, the transaction cannot be committed.
SHOW TRANSACTIONS;
SHOW RUNNING TRANSACTIONS;
TERMINATE TRANSACTIONS "tid1", "tid2";
Requires TRANSACTION_MANAGEMENT privilege to see/terminate other users' transactions.
SET GLOBAL TRANSACTION ISOLATION LEVEL SNAPSHOT ISOLATION;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET NEXT TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SHOW STORAGE INFO;
| Level | Default | Protects against |
|---|---|---|
SNAPSHOT ISOLATION | Yes (IN_MEMORY_TRANSACTIONAL) | Dirty read, non-repeatable read, phantom |
READ COMMITTED | Dirty read | |
READ UNCOMMITTED | Nothing (read-only access) |
IN_MEMORY_ANALYTICAL has no isolation levels.
ON_DISK_TRANSACTIONAL supports only SNAPSHOT ISOLATION.
| Type | Notes |
|---|---|
Null | Same as property absent |
String | |
Boolean | |
Integer | |
Float | Resolution via --storage-floating-point-resolution-bits |
List | Homogeneous for storage as node property |
Map | Must replace entirely |
Duration | duration("P2DT3H") |
Date | date("2024-01-15") |
LocalTime | localTime("14:30:00") |
LocalDateTime | localDateTime("2024-01-15T14:30:00") |
ZonedDateTime | datetime("2024-01-15T14:30:00Z") |
Enum | Must be defined first (see memgraph-indexes-and-constraints) |
Point | 2D/3D, Cartesian or WGS-84 |
Lists and Maps cannot be mutated element-by-element - replace the whole value.
Duration +/- Duration = Duration. Date +/- Duration = Date. Date - Date = Duration. Same for LocalTime, LocalDateTime, ZonedDateTime.
| Type | SRID | Constructor |
|---|---|---|
| WGS-84 2D | 4326 | point({longitude: -73.93, latitude: 40.73}) |
| WGS-84 3D | 4979 | point({longitude: -73.93, latitude: 40.73, height: 10}) |
| Cartesian 2D | 7203 | point({x: 0, y: 1}) |
| Cartesian 3D | 9157 | point({x: 0, y: 1, z: 2}) |
STORAGE MODE IN_MEMORY_TRANSACTIONAL;
STORAGE MODE IN_MEMORY_ANALYTICAL;
STORAGE MODE ON_DISK_TRANSACTIONAL;
SHOW STORAGE INFO;
| Mode | ACID | WAL | Periodic snapshots | Use case |
|---|---|---|---|---|
IN_MEMORY_TRANSACTIONAL | Full | Yes | Yes | Default - concurrent reads/writes |
IN_MEMORY_ANALYTICAL | No | No | Manual only | Bulk import, analytics (up to 6x faster) |
ON_DISK_TRANSACTIONAL | Snapshot isolation | RocksDB | - | Experimental, larger-than-memory |
Cannot switch in-memory to on-disk with data present. Cannot switch with active transactions.
CREATE SNAPSHOT;
SHOW SNAPSHOTS;
Periodic interval (runtime):
SET DATABASE SETTING "storage.snapshot.interval" TO "1200";
SET DATABASE SETTING "storage.snapshot.interval" TO "* * 12 * * *";
Flags: --storage-snapshot-interval, --storage-snapshot-on-exit,
--storage-parallel-snapshot-creation.
Enabled by default (--storage-wal-enabled). Cannot use WAL without snapshots.
Older WAL files are deleted after each snapshot.
LOCK DATA DIRECTORY;
UNLOCK DATA DIRECTORY;
DATA DIRECTORY LOCK STATUS;
MATCH (n) RETURN n QUERY MEMORY LIMIT 50 MB;
CALL proc() PROCEDURE MEMORY LIMIT 100 MB YIELD *;
FREE MEMORY;
SHOW STORAGE INFO;
Instance limit: --memory-limit (MiB). Property compression:
--storage-property-store-compression-enabled.
RAM ≈ nodes × 204B + edges × 154B + properties + indexes
For 50+ indexes add ~20% overhead.
IN_MEMORY_ANALYTICAL has no isolation levels or ACID guaranteesIN_MEMORY_TRANSACTIONAL (see memgraph-indexes-and-constraints)Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
npx claudepluginhub memgraph/skills