Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
notification_db_client
What it is
Part of the notifications feature. Query-only client for the notification tables in MacroDB: devices, user notifications, email-sent/unsubscribe records, and mute state.
Start here
src/lib.rs: the module list — one module per table (notification/,device.rs,user_notification/,notification_email_sent/,unsubscribe/,user_mute_notification.rs,email_unsubscribe_code.rs,channel_notification_email_sent/).fixtures/*.sql: seed data each module's tests build on.
Scope
- Owns: the
sqlx::query!call sites for notification-related tables. - Not here: the tables' schema/migrations →
crates/macro_db_client/migrations(search forcreate_notification_tables); notification business logic →notification.
Boundaries
- Depends on:
model_notifications,model-entity,models_pagination. - Used by:
notification,services/notification_service.
Recipes
- Add a query to an existing table: the module in
src/<table>/→ its tests →nix develop --command just prepare_dbfrom the repo root if SQLx cache metadata is missing. - Add a new table: migration in
crates/macro_db_client/migrationsfirst → new module here,pub modit insrc/lib.rs.
Checks
cargo test -p notification_db_client(SQLX_OFFLINEunset; requires local MacroDB —just setup_macrodb).
Related
- Rules:
.agents/rules/rust/db.md· Docs:docs/development/database.md