[{"data":1,"prerenderedAt":2896},["ShallowReactive",2],{"navigation":3,"\u002Fservices\u002Ftransactions":927,"mdc-pylded-key":2856,"mdc--qaueos-key":2871,"mdc-12bfc2-key":2883},[4,40,114,446,474,498,596,903],{"title":5,"path":6,"stem":7,"children":8},"Architecture","\u002Farchitecture","architecture",[9,14,28,32,36],{"title":10,"path":6,"stem":11,"access":12,"icon":13},"Overview","architecture\u002Findex","public","i-lucide-network",{"title":10,"path":15,"stem":16,"children":17,"access":12,"icon":19},"\u002Farchitecture\u002Fkernel","architecture\u002F1.kernel\u002Findex",[18,20,24],{"title":10,"path":15,"stem":16,"access":12,"icon":19},"i-lucide-box",{"title":21,"path":22,"stem":23,"access":12},"Enclave","\u002Farchitecture\u002Fkernel\u002Fenclave","architecture\u002F1.kernel\u002Fenclave",{"title":25,"path":26,"stem":27,"access":12},"Forking the enclave","\u002Farchitecture\u002Fkernel\u002Fforking-the-enclave","architecture\u002F1.kernel\u002Fforking-the-enclave",{"title":29,"path":30,"stem":31,"access":12},"Ports","\u002Farchitecture\u002Fports","architecture\u002F2.ports",{"title":33,"path":34,"stem":35,"access":12},"Service layers","\u002Farchitecture\u002Fservice-layers","architecture\u002F3.service-layers",{"title":37,"path":38,"stem":39,"access":12},"Families","\u002Farchitecture\u002Ffamilies","architecture\u002F4.families",{"title":41,"path":42,"stem":43,"children":44},"Core","\u002Fcore","core",[45,47,50,53,56,88,97],{"title":10,"path":42,"stem":46,"access":12,"icon":19},"core\u002Findex",{"title":10,"path":48,"stem":49,"access":12},"\u002Fcore\u002F01-overview","core\u002F01-overview",{"title":10,"path":51,"stem":52,"access":12},"\u002Fcore\u002F05-stores","core\u002F05-stores",{"title":10,"path":54,"stem":55,"access":12},"\u002Fcore\u002F06-permissions-and-keyring","core\u002F06-permissions-and-keyring",{"title":10,"path":57,"stem":58,"children":59,"access":12},"\u002Fcore\u002Fnoydb","core\u002F2.noydb\u002Findex",[60,61,65,68,72,76,80,84],{"title":10,"path":57,"stem":58,"access":12},{"title":62,"path":63,"stem":64,"access":12},"Noydb","\u002Fcore\u002Fnoydb\u002Fmethods","core\u002F2.noydb\u002F1.methods",{"title":21,"path":66,"stem":67,"access":12},"\u002Fcore\u002Fnoydb\u002Fenclave","core\u002F2.noydb\u002F2.enclave",{"title":69,"path":70,"stem":71,"access":12},"Secret & keyring","\u002Fcore\u002Fnoydb\u002Fkeyring","core\u002F2.noydb\u002F3.keyring",{"title":73,"path":74,"stem":75,"access":12},"Authentication","\u002Fcore\u002Fnoydb\u002Fauthentication","core\u002F2.noydb\u002F4.authentication",{"title":77,"path":78,"stem":79,"access":12},"Auth recovery","\u002Fcore\u002Fnoydb\u002Frecovery","core\u002F2.noydb\u002F5.recovery",{"title":81,"path":82,"stem":83,"access":12},"Configuration","\u002Fcore\u002Fnoydb\u002Fconfiguration","core\u002F2.noydb\u002F6.configuration",{"title":85,"path":86,"stem":87,"access":12},"Strategies","\u002Fcore\u002Fnoydb\u002Fstrategies","core\u002F2.noydb\u002F7.strategies",{"title":10,"path":89,"stem":90,"children":91,"access":12},"\u002Fcore\u002Fvault","core\u002F3.vault\u002Findex",[92,93],{"title":10,"path":89,"stem":90,"access":12},{"title":94,"path":95,"stem":96,"access":12},"Vault","\u002Fcore\u002Fvault\u002Fmethods","core\u002F3.vault\u002F1.methods",{"title":10,"path":98,"stem":99,"children":100,"access":12},"\u002Fcore\u002Fcollection","core\u002F4.collection\u002Findex",[101,102,106,110],{"title":10,"path":98,"stem":99,"access":12},{"title":103,"path":104,"stem":105,"access":12},"Collection","\u002Fcore\u002Fcollection\u002Fmethods","core\u002F4.collection\u002F1.methods",{"title":107,"path":108,"stem":109,"access":12},"Querying","\u002Fcore\u002Fcollection\u002Fquerying","core\u002F4.collection\u002F2.querying",{"title":111,"path":112,"stem":113,"access":12},"Schema","\u002Fcore\u002Fcollection\u002Fschema","core\u002F4.collection\u002F3.schema",{"title":37,"path":115,"stem":116,"children":117},"\u002Ffamilies","families",[118,121,168,194,208,212,216,294,340],{"title":10,"path":115,"stem":119,"access":12,"icon":120},"families\u002Findex","i-lucide-plug",{"title":122,"path":123,"stem":124,"children":125,"access":12,"icon":127},"as-Exports","\u002Ffamilies\u002Fas","families\u002Fas\u002Findex",[126,128,132,136,140,144,148,152,156,160,164],{"title":122,"path":123,"stem":124,"access":12,"icon":127},"i-lucide-book-open",{"title":129,"path":130,"stem":131,"access":12},"aws-s3","\u002Ffamilies\u002Fas\u002Faws-s3","families\u002Fas\u002Faws-s3",{"title":133,"path":134,"stem":135,"access":12},"blob","\u002Ffamilies\u002Fas\u002Fblob","families\u002Fas\u002Fblob",{"title":137,"path":138,"stem":139,"access":12},"csv","\u002Ffamilies\u002Fas\u002Fcsv","families\u002Fas\u002Fcsv",{"title":141,"path":142,"stem":143,"access":12},"json","\u002Ffamilies\u002Fas\u002Fjson","families\u002Fas\u002Fjson",{"title":145,"path":146,"stem":147,"access":12},"ndjson","\u002Ffamilies\u002Fas\u002Fndjson","families\u002Fas\u002Fndjson",{"title":149,"path":150,"stem":151,"access":12},"noydb","\u002Ffamilies\u002Fas\u002Fnoydb","families\u002Fas\u002Fnoydb",{"title":153,"path":154,"stem":155,"access":12},"sql","\u002Ffamilies\u002Fas\u002Fsql","families\u002Fas\u002Fsql",{"title":157,"path":158,"stem":159,"access":12},"xlsx","\u002Ffamilies\u002Fas\u002Fxlsx","families\u002Fas\u002Fxlsx",{"title":161,"path":162,"stem":163,"access":12},"xml","\u002Ffamilies\u002Fas\u002Fxml","families\u002Fas\u002Fxml",{"title":165,"path":166,"stem":167,"access":12},"zip","\u002Ffamilies\u002Fas\u002Fzip","families\u002Fas\u002Fzip",{"title":169,"path":170,"stem":171,"children":172,"access":12,"icon":127},"at-Seals","\u002Ffamilies\u002Fat","families\u002Fat\u002Findex",[173,174,178,182,186,190],{"title":169,"path":170,"stem":171,"access":12,"icon":127},{"title":175,"path":176,"stem":177,"access":12},"aws-kms","\u002Ffamilies\u002Fat\u002Faws-kms","families\u002Fat\u002Faws-kms",{"title":179,"path":180,"stem":181,"access":12},"azure-keyvault","\u002Ffamilies\u002Fat\u002Fazure-keyvault","families\u002Fat\u002Fazure-keyvault",{"title":183,"path":184,"stem":185,"access":12},"env","\u002Ffamilies\u002Fat\u002Fenv","families\u002Fat\u002Fenv",{"title":187,"path":188,"stem":189,"access":12},"gcp-kms","\u002Ffamilies\u002Fat\u002Fgcp-kms","families\u002Fat\u002Fgcp-kms",{"title":191,"path":192,"stem":193,"access":12},"macos-keychain","\u002Ffamilies\u002Fat\u002Fmacos-keychain","families\u002Fat\u002Fmacos-keychain",{"title":195,"path":196,"stem":197,"children":198,"access":12,"icon":127},"by-Sessions","\u002Ffamilies\u002Fby","families\u002Fby\u002Findex",[199,200,204],{"title":195,"path":196,"stem":197,"access":12,"icon":127},{"title":201,"path":202,"stem":203,"access":12},"peer","\u002Ffamilies\u002Fby\u002Fpeer","families\u002Fby\u002Fpeer",{"title":205,"path":206,"stem":207,"access":12},"tabs","\u002Ffamilies\u002Fby\u002Ftabs","families\u002Fby\u002Ftabs",{"title":209,"path":210,"stem":211,"access":12},"Classifying a package","\u002Ffamilies\u002Fclassification","families\u002Fclassification",{"title":213,"path":214,"stem":215,"access":12},"Command-line tools","\u002Ffamilies\u002Fcli","families\u002Fcli",{"title":217,"path":218,"stem":219,"children":220,"access":12,"icon":127},"in-Frameworks","\u002Ffamilies\u002Fin","families\u002Fin\u002Findex",[221,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290],{"title":217,"path":218,"stem":219,"access":12,"icon":127},{"title":223,"path":224,"stem":225,"access":12},"ai","\u002Ffamilies\u002Fin\u002Fai","families\u002Fin\u002Fai",{"title":227,"path":228,"stem":229,"access":12},"devtools","\u002Ffamilies\u002Fin\u002Fdevtools","families\u002Fin\u002Fdevtools",{"title":231,"path":232,"stem":233,"access":12},"devtools-tui","\u002Ffamilies\u002Fin\u002Fdevtools-tui","families\u002Fin\u002Fdevtools-tui",{"title":235,"path":236,"stem":237,"access":12},"liff","\u002Ffamilies\u002Fin\u002Fliff","families\u002Fin\u002Fliff",{"title":239,"path":240,"stem":241,"access":12},"nextjs","\u002Ffamilies\u002Fin\u002Fnextjs","families\u002Fin\u002Fnextjs",{"title":243,"path":244,"stem":245,"access":12},"nuxt","\u002Ffamilies\u002Fin\u002Fnuxt","families\u002Fin\u002Fnuxt",{"title":247,"path":248,"stem":249,"access":12},"pinia","\u002Ffamilies\u002Fin\u002Fpinia","families\u002Fin\u002Fpinia",{"title":251,"path":252,"stem":253,"access":12},"pwa","\u002Ffamilies\u002Fin\u002Fpwa","families\u002Fin\u002Fpwa",{"title":255,"path":256,"stem":257,"access":12},"react","\u002Ffamilies\u002Fin\u002Freact","families\u002Fin\u002Freact",{"title":259,"path":260,"stem":261,"access":12},"relay","\u002Ffamilies\u002Fin\u002Frelay","families\u002Fin\u002Frelay",{"title":263,"path":264,"stem":265,"access":12},"rest","\u002Ffamilies\u002Fin\u002Frest","families\u002Fin\u002Frest",{"title":267,"path":268,"stem":269,"access":12},"solid","\u002Ffamilies\u002Fin\u002Fsolid","families\u002Fin\u002Fsolid",{"title":271,"path":272,"stem":273,"access":12},"svelte","\u002Ffamilies\u002Fin\u002Fsvelte","families\u002Fin\u002Fsvelte",{"title":275,"path":276,"stem":277,"access":12},"tanstack-query","\u002Ffamilies\u002Fin\u002Ftanstack-query","families\u002Fin\u002Ftanstack-query",{"title":279,"path":280,"stem":281,"access":12},"tanstack-table","\u002Ffamilies\u002Fin\u002Ftanstack-table","families\u002Fin\u002Ftanstack-table",{"title":283,"path":284,"stem":285,"access":12},"vue","\u002Ffamilies\u002Fin\u002Fvue","families\u002Fin\u002Fvue",{"title":287,"path":288,"stem":289,"access":12},"yjs","\u002Ffamilies\u002Fin\u002Fyjs","families\u002Fin\u002Fyjs",{"title":291,"path":292,"stem":293,"access":12},"zustand","\u002Ffamilies\u002Fin\u002Fzustand","families\u002Fin\u002Fzustand",{"title":295,"path":296,"stem":297,"children":298,"access":12,"icon":127},"on-Auth","\u002Ffamilies\u002Fon","families\u002Fon\u002Findex",[299,300,304,308,312,316,320,324,328,332,336],{"title":295,"path":296,"stem":297,"access":12,"icon":127},{"title":301,"path":302,"stem":303,"access":12},"email-otp","\u002Ffamilies\u002Fon\u002Femail-otp","families\u002Fon\u002Femail-otp",{"title":305,"path":306,"stem":307,"access":12},"magic-link","\u002Ffamilies\u002Fon\u002Fmagic-link","families\u002Fon\u002Fmagic-link",{"title":309,"path":310,"stem":311,"access":12},"oidc","\u002Ffamilies\u002Fon\u002Foidc","families\u002Fon\u002Foidc",{"title":313,"path":314,"stem":315,"access":12},"password","\u002Ffamilies\u002Fon\u002Fpassword","families\u002Fon\u002Fpassword",{"title":317,"path":318,"stem":319,"access":12},"pin","\u002Ffamilies\u002Fon\u002Fpin","families\u002Fon\u002Fpin",{"title":321,"path":322,"stem":323,"access":12},"recovery","\u002Ffamilies\u002Fon\u002Frecovery","families\u002Fon\u002Frecovery",{"title":325,"path":326,"stem":327,"access":12},"shamir","\u002Ffamilies\u002Fon\u002Fshamir","families\u002Fon\u002Fshamir",{"title":329,"path":330,"stem":331,"access":12},"threat","\u002Ffamilies\u002Fon\u002Fthreat","families\u002Fon\u002Fthreat",{"title":333,"path":334,"stem":335,"access":12},"totp","\u002Ffamilies\u002Fon\u002Ftotp","families\u002Fon\u002Ftotp",{"title":337,"path":338,"stem":339,"access":12},"webauthn","\u002Ffamilies\u002Fon\u002Fwebauthn","families\u002Fon\u002Fwebauthn",{"title":341,"path":342,"stem":343,"children":344,"access":12,"icon":127},"to-Stores","\u002Ffamilies\u002Fto","families\u002Fto\u002Findex",[345,346,350,353,357,361,365,370,374,378,382,386,390,394,398,402,406,410,414,417,421,425,429,434,438,442],{"title":341,"path":342,"stem":343,"access":12,"icon":127},{"title":347,"path":348,"stem":349,"access":12},"aws-dynamo","\u002Ffamilies\u002Fto\u002Faws-dynamo","families\u002Fto\u002Faws-dynamo",{"title":129,"path":351,"stem":352,"access":12},"\u002Ffamilies\u002Fto\u002Faws-s3","families\u002Fto\u002Faws-s3",{"title":354,"path":355,"stem":356,"access":12},"browser-fs","\u002Ffamilies\u002Fto\u002Fbrowser-fs","families\u002Fto\u002Fbrowser-fs",{"title":358,"path":359,"stem":360,"access":12},"browser-idb","\u002Ffamilies\u002Fto\u002Fbrowser-idb","families\u002Fto\u002Fbrowser-idb",{"title":362,"path":363,"stem":364,"access":12},"browser-local","\u002Ffamilies\u002Fto\u002Fbrowser-local","families\u002Fto\u002Fbrowser-local",{"title":366,"path":367,"stem":368,"access":12,"icon":369},"Choosing a store","\u002Ffamilies\u002Fto\u002Fchoosing-a-store","families\u002Fto\u002Fchoosing-a-store","i-lucide-split",{"title":371,"path":372,"stem":373,"access":12},"cloudflare-d1","\u002Ffamilies\u002Fto\u002Fcloudflare-d1","families\u002Fto\u002Fcloudflare-d1",{"title":375,"path":376,"stem":377,"access":12},"cloudflare-r2","\u002Ffamilies\u002Fto\u002Fcloudflare-r2","families\u002Fto\u002Fcloudflare-r2",{"title":379,"path":380,"stem":381,"access":12},"drive","\u002Ffamilies\u002Fto\u002Fdrive","families\u002Fto\u002Fdrive",{"title":383,"path":384,"stem":385,"access":12},"file","\u002Ffamilies\u002Fto\u002Ffile","families\u002Fto\u002Ffile",{"title":387,"path":388,"stem":389,"access":12},"icloud","\u002Ffamilies\u002Fto\u002Ficloud","families\u002Fto\u002Ficloud",{"title":391,"path":392,"stem":393,"access":12},"memory","\u002Ffamilies\u002Fto\u002Fmemory","families\u002Fto\u002Fmemory",{"title":395,"path":396,"stem":397,"access":12},"meter","\u002Ffamilies\u002Fto\u002Fmeter","families\u002Fto\u002Fmeter",{"title":399,"path":400,"stem":401,"access":12},"mysql","\u002Ffamilies\u002Fto\u002Fmysql","families\u002Fto\u002Fmysql",{"title":403,"path":404,"stem":405,"access":12},"nfs","\u002Ffamilies\u002Fto\u002Fnfs","families\u002Fto\u002Fnfs",{"title":407,"path":408,"stem":409,"access":12},"postgres","\u002Ffamilies\u002Fto\u002Fpostgres","families\u002Fto\u002Fpostgres",{"title":411,"path":412,"stem":413,"access":12},"probe","\u002Ffamilies\u002Fto\u002Fprobe","families\u002Fto\u002Fprobe",{"title":263,"path":415,"stem":416,"access":12},"\u002Ffamilies\u002Fto\u002Frest","families\u002Fto\u002Frest",{"title":418,"path":419,"stem":420,"access":12},"smb","\u002Ffamilies\u002Fto\u002Fsmb","families\u002Fto\u002Fsmb",{"title":422,"path":423,"stem":424,"access":12},"sqlite","\u002Ffamilies\u002Fto\u002Fsqlite","families\u002Fto\u002Fsqlite",{"title":426,"path":427,"stem":428,"access":12},"ssh","\u002Ffamilies\u002Fto\u002Fssh","families\u002Fto\u002Fssh",{"title":430,"path":431,"stem":432,"access":12,"icon":433},"Store-locator descriptors","\u002Ffamilies\u002Fto\u002Fstore-locator","families\u002Fto\u002Fstore-locator","i-lucide-map-pin",{"title":435,"path":436,"stem":437,"access":12},"supabase","\u002Ffamilies\u002Fto\u002Fsupabase","families\u002Fto\u002Fsupabase",{"title":439,"path":440,"stem":441,"access":12},"turso","\u002Ffamilies\u002Fto\u002Fturso","families\u002Fto\u002Fturso",{"title":443,"path":444,"stem":445,"access":12},"webdav","\u002Ffamilies\u002Fto\u002Fwebdav","families\u002Fto\u002Fwebdav",{"title":447,"path":448,"stem":449,"children":450},"Faq","\u002Ffaq","faq",[451,454,458,462,466,470],{"title":10,"path":448,"stem":452,"access":12,"icon":453},"faq\u002Findex","i-lucide-circle-help",{"title":455,"path":456,"stem":457,"access":12},"Where can noy-db run?","\u002Ffaq\u002Fwhere-can-noy-db-run","faq\u002F1.where-can-noy-db-run",{"title":459,"path":460,"stem":461,"access":12},"Native mobile & PWA","\u002Ffaq\u002Fmobile-and-pwa","faq\u002F2.mobile-and-pwa",{"title":463,"path":464,"stem":465,"access":12},"Threat model","\u002Ffaq\u002Fthreat-model","faq\u002F3.threat-model",{"title":467,"path":468,"stem":469,"access":12},"Community & ecosystem","\u002Ffaq\u002Fcommunity-and-ecosystem","faq\u002F4.community-and-ecosystem",{"title":471,"path":472,"stem":473,"access":12},"Licensing","\u002Ffaq\u002Flicensing","faq\u002F5.licensing",{"title":475,"path":476,"stem":477,"children":478},"Glossary","\u002Fglossary","glossary",[479,482,486,490,494],{"title":10,"path":476,"stem":480,"access":12,"icon":481},"glossary\u002Findex","i-lucide-book-a",{"title":483,"path":484,"stem":485,"access":12},"Core vocabulary","\u002Fglossary\u002Fcore-vocabulary","glossary\u002Fcore-vocabulary",{"title":487,"path":488,"stem":489,"access":12},"Deletion vocabulary","\u002Fglossary\u002Fdeletion","glossary\u002Fdeletion",{"title":491,"path":492,"stem":493,"access":12},"Satellite collection vocabulary","\u002Fglossary\u002Fsatellite-collections","glossary\u002Fsatellite-collections",{"title":495,"path":496,"stem":497,"access":12},"Schema migration vocabulary","\u002Fglossary\u002Fschema-migration","glossary\u002Fschema-migration",{"title":499,"path":500,"stem":501,"children":502},"Recipes","\u002Frecipes","recipes",[503,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,567,571,575,580,584,588,592],{"title":10,"path":500,"stem":504,"access":12,"icon":505},"recipes\u002Findex","i-lucide-play",{"title":507,"path":508,"stem":509,"access":12},"Accounting app","\u002Frecipes\u002Faccounting-app","recipes\u002Faccounting-app",{"title":511,"path":512,"stem":513,"access":12},"Analytics app","\u002Frecipes\u002Fanalytics-app","recipes\u002Fanalytics-app",{"title":515,"path":516,"stem":517,"access":12},"Attestation verifier","\u002Frecipes\u002Fattestation-verifier","recipes\u002Fattestation-verifier",{"title":519,"path":520,"stem":521,"access":12},"AWS-KMS attestation","\u002Frecipes\u002Faws-kms-pdf-attestation","recipes\u002Faws-kms-pdf-attestation",{"title":523,"path":524,"stem":525,"access":12},"Browser durability","\u002Frecipes\u002Fbrowser-durability","recipes\u002Fbrowser-durability",{"title":527,"path":528,"stem":529,"access":12},"Production cloud store","\u002Frecipes\u002Fcloud-store","recipes\u002Fcloud-store",{"title":531,"path":532,"stem":533,"access":12},"Compose your own setup","\u002Frecipes\u002Fcompose-your-own","recipes\u002Fcompose-your-own",{"title":535,"path":536,"stem":537,"access":12},"Confidential HR records","\u002Frecipes\u002Fconfidential-hr","recipes\u002Fconfidential-hr",{"title":539,"path":540,"stem":541,"access":12},"Composing an echo secret","\u002Frecipes\u002Fecho-secret-enrollment","recipes\u002Fecho-secret-enrollment",{"title":543,"path":544,"stem":545,"access":12},"Email archive","\u002Frecipes\u002Femail-archive","recipes\u002Femail-archive",{"title":547,"path":548,"stem":549,"access":12},"Email archive — threads & revisions","\u002Frecipes\u002Femail-archive-threads-revisions","recipes\u002Femail-archive-threads-revisions",{"title":551,"path":552,"stem":553,"access":12},"Export & portability","\u002Frecipes\u002Fexport-portability","recipes\u002Fexport-portability",{"title":555,"path":556,"stem":557,"access":12},"Passwordless OIDC (AWS Cognito)","\u002Frecipes\u002Fpasswordless-oidc","recipes\u002Fpasswordless-oidc",{"title":559,"path":560,"stem":561,"access":12},"Personal notebook","\u002Frecipes\u002Fpersonal-notebook","recipes\u002Fpersonal-notebook",{"title":563,"path":564,"stem":565,"access":12,"icon":566},"Playgrounds","\u002Frecipes\u002Fplaygrounds","recipes\u002Fplaygrounds","i-lucide-gamepad-2",{"title":568,"path":569,"stem":570,"access":12},"React invoice app","\u002Frecipes\u002Freact-invoices","recipes\u002Freact-invoices",{"title":572,"path":573,"stem":574,"access":12},"Collaborative app","\u002Frecipes\u002Frealtime-crdt-app","recipes\u002Frealtime-crdt-app",{"title":576,"path":577,"stem":578,"access":12,"icon":579},"Run the showcases","\u002Frecipes\u002Frun-the-showcases","recipes\u002Frun-the-showcases","i-lucide-flask-conical",{"title":581,"path":582,"stem":583,"access":12},"Search & RAG","\u002Frecipes\u002Fsearch-rag","recipes\u002Fsearch-rag",{"title":585,"path":586,"stem":587,"access":12},"Team vault topology","\u002Frecipes\u002Fteam-vault-topology","recipes\u002Fteam-vault-topology",{"title":589,"path":590,"stem":591,"access":12},"Unlock ceremonies","\u002Frecipes\u002Funlock-ceremonies","recipes\u002Funlock-ceremonies",{"title":593,"path":594,"stem":595,"access":12},"User preferences","\u002Frecipes\u002Fuser-preferences","recipes\u002Fuser-preferences",{"title":597,"path":598,"stem":599,"children":600},"Services","\u002Fservices","services",[601,604,608,612,616,620,624,628,632,636,640,644,648,652,656,660,664,668,672,676,680,684,688,692,696,700,704,710,714,718,722,726,730,734,738,742,746,750,755,759,763,767,771,775,779,783,787,791,795,799,803,807,811,815,819,823,827,831,835,839,843,847,851,855,859,863,867,871,875,879,883,887,891,895,899],{"title":10,"path":598,"stem":602,"access":12,"icon":603},"services\u002Findex","i-lucide-layers",{"title":605,"path":606,"stem":607,"access":12},"archive","\u002Fservices\u002Farchive","services\u002Farchive",{"title":609,"path":610,"stem":611,"access":12},"attestation","\u002Fservices\u002Fattestation","services\u002Fattestation",{"title":613,"path":614,"stem":615,"access":12},"auth-introspection","\u002Fservices\u002Fauth-introspection","services\u002Fauth-introspection",{"title":617,"path":618,"stem":619,"access":12},"auth-landscape","\u002Fservices\u002Fauth-landscape","services\u002Fauth-landscape",{"title":621,"path":622,"stem":623,"access":12},"blobs","\u002Fservices\u002Fblobs","services\u002Fblobs",{"title":625,"path":626,"stem":627,"access":12},"broker","\u002Fservices\u002Fbroker","services\u002Fbroker",{"title":629,"path":630,"stem":631,"access":12},"bundle","\u002Fservices\u002Fbundle","services\u002Fbundle",{"title":633,"path":634,"stem":635,"access":12},"classified","\u002Fservices\u002Fclassified","services\u002Fclassified",{"title":637,"path":638,"stem":639,"access":12},"computed","\u002Fservices\u002Fcomputed","services\u002Fcomputed",{"title":641,"path":642,"stem":643,"access":12},"consent","\u002Fservices\u002Fconsent","services\u002Fconsent",{"title":645,"path":646,"stem":647,"access":12},"cover","\u002Fservices\u002Fcover","services\u002Fcover",{"title":649,"path":650,"stem":651,"access":12},"coverage","\u002Fservices\u002Fcoverage","services\u002Fcoverage",{"title":653,"path":654,"stem":655,"access":12},"crdt","\u002Fservices\u002Fcrdt","services\u002Fcrdt",{"title":657,"path":658,"stem":659,"access":12},"cross-join","\u002Fservices\u002Fcross-join","services\u002Fcross-join",{"title":661,"path":662,"stem":663,"access":12},"custody","\u002Fservices\u002Fcustody","services\u002Fcustody",{"title":665,"path":666,"stem":667,"access":12},"derivations","\u002Fservices\u002Fderivations","services\u002Fderivations",{"title":669,"path":670,"stem":671,"access":12},"directory","\u002Fservices\u002Fdirectory","services\u002Fdirectory",{"title":673,"path":674,"stem":675,"access":12},"search — AI","\u002Fservices\u002Fembeddings","services\u002Fembeddings",{"title":677,"path":678,"stem":679,"access":12},"Field metadata","\u002Fservices\u002Ffield-metadata","services\u002Ffield-metadata",{"title":681,"path":682,"stem":683,"access":12},"Foreign refs","\u002Fservices\u002Fforeign-refs","services\u002Fforeign-refs",{"title":685,"path":686,"stem":687,"access":12},"forget","\u002Fservices\u002Fforget","services\u002Fforget",{"title":689,"path":690,"stem":691,"access":12},"governance","\u002Fservices\u002Fgovernance","services\u002Fgovernance",{"title":693,"path":694,"stem":695,"access":12},"guards","\u002Fservices\u002Fguards","services\u002Fguards",{"title":697,"path":698,"stem":699,"access":12},"history","\u002Fservices\u002Fhistory","services\u002Fhistory",{"title":701,"path":702,"stem":703,"access":12},"i18n","\u002Fservices\u002Fi18n","services\u002Fi18n",{"title":705,"path":706,"stem":707,"children":708,"access":12},"indexing","\u002Fservices\u002Findexing","services\u002Findexing",[709],{"title":705,"path":706,"stem":707,"access":12},{"title":711,"path":712,"stem":713,"access":12},"introspection","\u002Fservices\u002Fintrospection","services\u002Fintrospection",{"title":715,"path":716,"stem":717,"access":12},"joins","\u002Fservices\u002Fjoins","services\u002Fjoins",{"title":719,"path":720,"stem":721,"access":12},"lazy","\u002Fservices\u002Flazy","services\u002Flazy",{"title":723,"path":724,"stem":725,"access":12},"links","\u002Fservices\u002Flinks","services\u002Flinks",{"title":727,"path":728,"stem":729,"access":12},"live","\u002Fservices\u002Flive","services\u002Flive",{"title":731,"path":732,"stem":733,"access":12},"lookup","\u002Fservices\u002Flookup","services\u002Flookup",{"title":735,"path":736,"stem":737,"access":12},"manifest","\u002Fservices\u002Fmanifest","services\u002Fmanifest",{"title":739,"path":740,"stem":741,"access":12},"materialized-views","\u002Fservices\u002Fmaterialized-views","services\u002Fmaterialized-views",{"title":743,"path":744,"stem":745,"access":12},"Metadata ladder","\u002Fservices\u002Fmetadata-ladder","services\u002Fmetadata-ladder",{"title":747,"path":748,"stem":749,"access":12},"Metadata riders","\u002Fservices\u002Fmetadata-riders","services\u002Fmetadata-riders",{"title":751,"path":752,"stem":753,"access":12,"badge":754},"metrics","\u002Fservices\u002Fmetrics","services\u002Fmetrics","Planned",{"title":756,"path":757,"stem":758,"access":12,"badge":754},"migrations","\u002Fservices\u002Fmigrations","services\u002Fmigrations",{"title":760,"path":761,"stem":762,"access":12},"money","\u002Fservices\u002Fmoney","services\u002Fmoney",{"title":764,"path":765,"stem":766,"access":12},"numbering","\u002Fservices\u002Fnumbering","services\u002Fnumbering",{"title":768,"path":769,"stem":770,"access":12},"overlay-views","\u002Fservices\u002Foverlay-views","services\u002Foverlay-views",{"title":772,"path":773,"stem":774,"access":12,"badge":754},"partitioning","\u002Fservices\u002Fpartitioning","services\u002Fpartitioning",{"title":776,"path":777,"stem":778,"access":12},"periods","\u002Fservices\u002Fperiods","services\u002Fperiods",{"title":780,"path":781,"stem":782,"access":12},"persisted-schemas","\u002Fservices\u002Fpersisted-schemas","services\u002Fpersisted-schemas",{"title":784,"path":785,"stem":786,"access":12},"plaintext-bypass","\u002Fservices\u002Fplaintext-bypass","services\u002Fplaintext-bypass",{"title":788,"path":789,"stem":790,"access":12},"pod-redirect","\u002Fservices\u002Fpod-redirect","services\u002Fpod-redirect",{"title":792,"path":793,"stem":794,"access":12},"pod-signature","\u002Fservices\u002Fpod-signature","services\u002Fpod-signature",{"title":796,"path":797,"stem":798,"access":12},"policy","\u002Fservices\u002Fpolicy","services\u002Fpolicy",{"title":800,"path":801,"stem":802,"access":12},"portability","\u002Fservices\u002Fportability","services\u002Fportability",{"title":804,"path":805,"stem":806,"access":12},"reduce","\u002Fservices\u002Freduce","services\u002Freduce",{"title":808,"path":809,"stem":810,"access":12},"routing","\u002Fservices\u002Frouting","services\u002Frouting",{"title":812,"path":813,"stem":814,"access":12},"satellites","\u002Fservices\u002Fsatellites","services\u002Fsatellites",{"title":816,"path":817,"stem":818,"access":12},"schema-identifiers","\u002Fservices\u002Fschema-identifiers","services\u002Fschema-identifiers",{"title":820,"path":821,"stem":822,"access":12},"schema-update","\u002Fservices\u002Fschema-update","services\u002Fschema-update",{"title":824,"path":825,"stem":826,"access":12},"sealed-record","\u002Fservices\u002Fsealed-record","services\u002Fsealed-record",{"title":828,"path":829,"stem":830,"access":12},"sealing provider id","\u002Fservices\u002Fsealing-pid-stability","services\u002Fsealing-pid-stability",{"title":832,"path":833,"stem":834,"access":12},"search — full-text","\u002Fservices\u002Fsearch","services\u002Fsearch",{"title":836,"path":837,"stem":838,"access":12},"sequence","\u002Fservices\u002Fsequence","services\u002Fsequence",{"title":840,"path":841,"stem":842,"access":12},"session","\u002Fservices\u002Fsession","services\u002Fsession",{"title":844,"path":845,"stem":846,"access":12},"session-tiers","\u002Fservices\u002Fsession-tiers","services\u002Fsession-tiers",{"title":848,"path":849,"stem":850,"access":12},"shadow","\u002Fservices\u002Fshadow","services\u002Fshadow",{"title":852,"path":853,"stem":854,"access":12},"share-link","\u002Fservices\u002Fshare-link","services\u002Fshare-link",{"title":856,"path":857,"stem":858,"access":12},"snapshots","\u002Fservices\u002Fsnapshots","services\u002Fsnapshots",{"title":860,"path":861,"stem":862,"access":12},"store capabilities","\u002Fservices\u002Fstorage-capability-matrix","services\u002Fstorage-capability-matrix",{"title":864,"path":865,"stem":866,"access":12},"sync","\u002Fservices\u002Fsync","services\u002Fsync",{"title":868,"path":869,"stem":870,"access":12},"team","\u002Fservices\u002Fteam","services\u002Fteam",{"title":872,"path":873,"stem":874,"access":12},"tiers","\u002Fservices\u002Ftiers","services\u002Ftiers",{"title":876,"path":877,"stem":878,"access":12},"transactions","\u002Fservices\u002Ftransactions","services\u002Ftransactions",{"title":880,"path":881,"stem":882,"access":12},"partitions","\u002Fservices\u002Ftransferable-partitions","services\u002Ftransferable-partitions",{"title":884,"path":885,"stem":886,"access":12},"user-envelope","\u002Fservices\u002Fuser-envelope","services\u002Fuser-envelope",{"title":888,"path":889,"stem":890,"access":12,"badge":754},"validation","\u002Fservices\u002Fvalidation","services\u002Fvalidation",{"title":892,"path":893,"stem":894,"access":12},"vault-head","\u002Fservices\u002Fvault-head","services\u002Fvault-head",{"title":896,"path":897,"stem":898,"access":12},"via","\u002Fservices\u002Fvia","services\u002Fvia",{"title":900,"path":901,"stem":902,"access":12},"withdrawal","\u002Fservices\u002Fwithdrawal","services\u002Fwithdrawal",{"title":904,"path":905,"stem":906,"children":907},"Start","\u002Fstart","start",[908,911,915,919,923],{"title":10,"path":905,"stem":909,"access":12,"icon":910},"start\u002Findex","i-lucide-flag",{"title":912,"path":913,"stem":914,"access":12},"Install","\u002Fstart\u002Finstall","start\u002F1.install",{"title":916,"path":917,"stem":918,"access":12},"Your first vault","\u002Fstart\u002Ffirst-vault","start\u002F2.first-vault",{"title":920,"path":921,"stem":922,"access":12},"Your first service","\u002Fstart\u002Ffirst-service","start\u002F3.first-service",{"title":924,"path":925,"stem":926,"access":12},"See the ciphertext","\u002Fstart\u002Fsee-the-ciphertext","start\u002F4.see-the-ciphertext",{"id":928,"title":876,"access":12,"apiToc":929,"body":930,"category":2847,"description":2848,"extension":2849,"meta":2850,"navigation":2847,"nest":2851,"path":877,"seo":2852,"sinceVersion":2847,"status":2853,"stem":878,"subtitle":2847,"tier":2854,"tocExternal":2847,"__hash__":2855},"docs\u002Fservices\u002Ftransactions.md",false,{"type":931,"value":932,"toc":2824},"minimark",[933,936,940,945,980,984,1004,1008,1068,1072,1264,1268,1707,1717,1722,1740,2128,2165,2168,2198,2205,2295,2298,2302,2351,2361,2385,2389,2395,2418,2429,2435,2438,2463,2468,2479,2484,2512,2518,2565,2588,2608,2612,2662,2665,2717,2721,2770,2774,2820],[934,935,876],"h1",{"id":876},[937,938],"service-meta",{":rows":939},"[{\"label\":\"Subpath\",\"value\":\"`@noy-db\u002Fhub\u002Ftransactions`\"},{\"label\":\"Factory\",\"value\":\"`withTransactions()`\"},{\"label\":\"Layer\",\"value\":\"`with-commit`\"}]",[941,942,944],"h2",{"id":943},"what-it-does","What it does",[946,947,948,949,953,954,957,958,963,964,968,969,972,973,953,976,979],"p",{},"By default, noy-db writes one record at a time: every ",[950,951,952],"code",{},"put()","\u002F",[950,955,956],{},"delete()"," on a ",[959,960,962],"a",{"href":961},"..\u002Fcore\u002F01-overview","collection"," commits on its own and is visible immediately. The transactions service adds ",[965,966,967],"strong",{},"multi-record atomic writes"," on top of that: ",[950,970,971],{},"db.transaction(async (tx) => { ... })"," runs a callback whose body stages ",[950,974,975],{},"put",[950,977,978],{},"delete"," operations across any number of collections or vaults, and the hub commits every staged op together — or none of them — when the callback returns or throws. Reads inside the body see your own staged writes (\"read-your-writes\") even though nothing is persisted until commit. The service is a tree-shake seam: ~280 lines of transaction-executor code only reach your bundle once you opt in.",[941,981,983],{"id":982},"when-you-need-it","When you need it",[985,986,987,991,994,1001],"ul",{},[988,989,990],"li",{},"Cross-collection invariants (an invoice and its payment must both succeed, or neither does)",[988,992,993],{},"Cross-vault writes (the same logical operation touching two tenants)",[988,995,996,997,1000],{},"Optimistic concurrency control via ",[950,998,999],{},"expectedVersion"," on staged ops",[988,1002,1003],{},"Workflows where a partial write would corrupt downstream state",[941,1005,1007],{"id":1006},"prerequisites","Prerequisites",[985,1009,1010,1024,1049],{},[988,1011,1012,1015,1016,1019,1020,1023],{},[965,1013,1014],{},"None"," — ",[950,1017,1018],{},"withTransactions()"," alone enables ",[950,1021,1022],{},"db.transaction(fn)",".",[988,1025,1026,1030,1031,1034,1035,1038,1039,1042,1043,1046,1047,1023],{},[1027,1028,1029],"em",{},"For the amendment form:"," guard declarations (",[950,1032,1033],{},"guardStrategies",") plus ",[950,1036,1037],{},"admin",", ",[950,1040,1041],{},"owner",", or ",[950,1044,1045],{},"custodian"," role on every vault the body touches — see ",[959,1048,693],{"href":694},[988,1050,1051,1054,1055,1058,1059,1062,1063,1067],{},[1027,1052,1053],{},"Atomicity note:"," true all-or-nothing storage atomicity needs a store that declares ",[950,1056,1057],{},"txAtomic"," ",[965,1060,1061],{},"and"," a batch that is statically safe — see ",[959,1064,1066],{"href":1065},"#atomicity-guarantee","Atomicity guarantee"," below. Every other transaction falls back to the per-record OCC executor described in this page, with best-effort unwind.",[941,1069,1071],{"id":1070},"opt-in","Opt in",[1073,1074,1079],"pre",{"className":1075,"code":1076,"language":1077,"meta":1078,"style":1078},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createNoydb } from '@noy-db\u002Fhub'\nimport { withTransactions } from '@noy-db\u002Fhub\u002Ftransactions'\nimport { toMemory } from '@noy-db\u002Fto-memory'\n\nconst db = await createNoydb({\n  store: toMemory(),\n  user: 'alice',\n  secret: 'a-strong-secret',\n  transactionsStrategy: withTransactions(),\n})\n","ts","",[950,1080,1081,1114,1135,1156,1163,1188,1206,1224,1241,1255],{"__ignoreMap":1078},[1082,1083,1086,1090,1094,1098,1101,1104,1107,1111],"span",{"class":1084,"line":1085},"line",1,[1082,1087,1089],{"class":1088},"s7zQu","import",[1082,1091,1093],{"class":1092},"sMK4o"," {",[1082,1095,1097],{"class":1096},"sTEyZ"," createNoydb",[1082,1099,1100],{"class":1092}," }",[1082,1102,1103],{"class":1088}," from",[1082,1105,1106],{"class":1092}," '",[1082,1108,1110],{"class":1109},"sfazB","@noy-db\u002Fhub",[1082,1112,1113],{"class":1092},"'\n",[1082,1115,1117,1119,1121,1124,1126,1128,1130,1133],{"class":1084,"line":1116},2,[1082,1118,1089],{"class":1088},[1082,1120,1093],{"class":1092},[1082,1122,1123],{"class":1096}," withTransactions",[1082,1125,1100],{"class":1092},[1082,1127,1103],{"class":1088},[1082,1129,1106],{"class":1092},[1082,1131,1132],{"class":1109},"@noy-db\u002Fhub\u002Ftransactions",[1082,1134,1113],{"class":1092},[1082,1136,1138,1140,1142,1145,1147,1149,1151,1154],{"class":1084,"line":1137},3,[1082,1139,1089],{"class":1088},[1082,1141,1093],{"class":1092},[1082,1143,1144],{"class":1096}," toMemory",[1082,1146,1100],{"class":1092},[1082,1148,1103],{"class":1088},[1082,1150,1106],{"class":1092},[1082,1152,1153],{"class":1109},"@noy-db\u002Fto-memory",[1082,1155,1113],{"class":1092},[1082,1157,1159],{"class":1084,"line":1158},4,[1082,1160,1162],{"emptyLinePlaceholder":1161},true,"\n",[1082,1164,1166,1170,1173,1176,1179,1182,1185],{"class":1084,"line":1165},5,[1082,1167,1169],{"class":1168},"spNyl","const",[1082,1171,1172],{"class":1096}," db ",[1082,1174,1175],{"class":1092},"=",[1082,1177,1178],{"class":1088}," await",[1082,1180,1097],{"class":1181},"s2Zo4",[1082,1183,1184],{"class":1096},"(",[1082,1186,1187],{"class":1092},"{\n",[1082,1189,1191,1195,1198,1200,1203],{"class":1084,"line":1190},6,[1082,1192,1194],{"class":1193},"swJcz","  store",[1082,1196,1197],{"class":1092},":",[1082,1199,1144],{"class":1181},[1082,1201,1202],{"class":1096},"()",[1082,1204,1205],{"class":1092},",\n",[1082,1207,1209,1212,1214,1216,1219,1222],{"class":1084,"line":1208},7,[1082,1210,1211],{"class":1193},"  user",[1082,1213,1197],{"class":1092},[1082,1215,1106],{"class":1092},[1082,1217,1218],{"class":1109},"alice",[1082,1220,1221],{"class":1092},"'",[1082,1223,1205],{"class":1092},[1082,1225,1227,1230,1232,1234,1237,1239],{"class":1084,"line":1226},8,[1082,1228,1229],{"class":1193},"  secret",[1082,1231,1197],{"class":1092},[1082,1233,1106],{"class":1092},[1082,1235,1236],{"class":1109},"a-strong-secret",[1082,1238,1221],{"class":1092},[1082,1240,1205],{"class":1092},[1082,1242,1244,1247,1249,1251,1253],{"class":1084,"line":1243},9,[1082,1245,1246],{"class":1193},"  transactionsStrategy",[1082,1248,1197],{"class":1092},[1082,1250,1123],{"class":1181},[1082,1252,1202],{"class":1096},[1082,1254,1205],{"class":1092},[1082,1256,1258,1261],{"class":1084,"line":1257},10,[1082,1259,1260],{"class":1092},"}",[1082,1262,1263],{"class":1096},")\n",[941,1265,1267],{"id":1266},"usage","Usage",[1073,1269,1271],{"className":1075,"code":1270,"language":1077,"meta":1078,"style":1078},"type Invoice = { amount: number; status: string }\ntype Payment = { invoiceId: string; amount: number; paidAt: string }\n\nawait db.openVault('acme')\n\nconst result = await db.transaction(async (tx) => {\n  const inv = tx.vault('acme').collection\u003CInvoice>('invoices')\n  const pay = tx.vault('acme').collection\u003CPayment>('payments')\n\n  inv.put('inv-1', { amount: 100, status: 'paid' })\n  pay.put('pay-1', { invoiceId: 'inv-1', amount: 100, paidAt: '2026-07-08T00:00:00Z' })\n\n  \u002F\u002F Read-your-writes: sees the staged put above even though nothing\n  \u002F\u002F has been committed yet.\n  const staged = await inv.get('inv-1')\n\n  return staged.amount \u002F\u002F the body's return value flows through\n})\n\u002F\u002F → 100\n",[950,1272,1273,1309,1346,1350,1374,1378,1417,1469,1516,1520,1568,1626,1631,1638,1644,1673,1678,1694,1701],{"__ignoreMap":1078},[1082,1274,1275,1278,1282,1285,1287,1290,1292,1295,1298,1301,1303,1306],{"class":1084,"line":1085},[1082,1276,1277],{"class":1168},"type",[1082,1279,1281],{"class":1280},"sBMFI"," Invoice",[1082,1283,1284],{"class":1092}," =",[1082,1286,1093],{"class":1092},[1082,1288,1289],{"class":1193}," amount",[1082,1291,1197],{"class":1092},[1082,1293,1294],{"class":1280}," number",[1082,1296,1297],{"class":1092},";",[1082,1299,1300],{"class":1193}," status",[1082,1302,1197],{"class":1092},[1082,1304,1305],{"class":1280}," string",[1082,1307,1308],{"class":1092}," }\n",[1082,1310,1311,1313,1316,1318,1320,1323,1325,1327,1329,1331,1333,1335,1337,1340,1342,1344],{"class":1084,"line":1116},[1082,1312,1277],{"class":1168},[1082,1314,1315],{"class":1280}," Payment",[1082,1317,1284],{"class":1092},[1082,1319,1093],{"class":1092},[1082,1321,1322],{"class":1193}," invoiceId",[1082,1324,1197],{"class":1092},[1082,1326,1305],{"class":1280},[1082,1328,1297],{"class":1092},[1082,1330,1289],{"class":1193},[1082,1332,1197],{"class":1092},[1082,1334,1294],{"class":1280},[1082,1336,1297],{"class":1092},[1082,1338,1339],{"class":1193}," paidAt",[1082,1341,1197],{"class":1092},[1082,1343,1305],{"class":1280},[1082,1345,1308],{"class":1092},[1082,1347,1348],{"class":1084,"line":1137},[1082,1349,1162],{"emptyLinePlaceholder":1161},[1082,1351,1352,1355,1358,1360,1363,1365,1367,1370,1372],{"class":1084,"line":1158},[1082,1353,1354],{"class":1280},"await",[1082,1356,1357],{"class":1280}," db",[1082,1359,1023],{"class":1092},[1082,1361,1362],{"class":1280},"openVault",[1082,1364,1184],{"class":1096},[1082,1366,1221],{"class":1092},[1082,1368,1369],{"class":1109},"acme",[1082,1371,1221],{"class":1092},[1082,1373,1263],{"class":1096},[1082,1375,1376],{"class":1084,"line":1165},[1082,1377,1162],{"emptyLinePlaceholder":1161},[1082,1379,1380,1382,1385,1387,1389,1391,1393,1396,1398,1401,1404,1408,1411,1414],{"class":1084,"line":1190},[1082,1381,1169],{"class":1168},[1082,1383,1384],{"class":1096}," result ",[1082,1386,1175],{"class":1092},[1082,1388,1178],{"class":1088},[1082,1390,1357],{"class":1096},[1082,1392,1023],{"class":1092},[1082,1394,1395],{"class":1181},"transaction",[1082,1397,1184],{"class":1096},[1082,1399,1400],{"class":1168},"async",[1082,1402,1403],{"class":1092}," (",[1082,1405,1407],{"class":1406},"sHdIc","tx",[1082,1409,1410],{"class":1092},")",[1082,1412,1413],{"class":1168}," =>",[1082,1415,1416],{"class":1092}," {\n",[1082,1418,1419,1422,1425,1427,1430,1432,1435,1437,1439,1441,1443,1445,1447,1449,1452,1455,1458,1460,1462,1465,1467],{"class":1084,"line":1208},[1082,1420,1421],{"class":1168},"  const",[1082,1423,1424],{"class":1096}," inv",[1082,1426,1284],{"class":1092},[1082,1428,1429],{"class":1096}," tx",[1082,1431,1023],{"class":1092},[1082,1433,1434],{"class":1181},"vault",[1082,1436,1184],{"class":1193},[1082,1438,1221],{"class":1092},[1082,1440,1369],{"class":1109},[1082,1442,1221],{"class":1092},[1082,1444,1410],{"class":1193},[1082,1446,1023],{"class":1092},[1082,1448,962],{"class":1181},[1082,1450,1451],{"class":1092},"\u003C",[1082,1453,1454],{"class":1280},"Invoice",[1082,1456,1457],{"class":1092},">",[1082,1459,1184],{"class":1193},[1082,1461,1221],{"class":1092},[1082,1463,1464],{"class":1109},"invoices",[1082,1466,1221],{"class":1092},[1082,1468,1263],{"class":1193},[1082,1470,1471,1473,1476,1478,1480,1482,1484,1486,1488,1490,1492,1494,1496,1498,1500,1503,1505,1507,1509,1512,1514],{"class":1084,"line":1226},[1082,1472,1421],{"class":1168},[1082,1474,1475],{"class":1096}," pay",[1082,1477,1284],{"class":1092},[1082,1479,1429],{"class":1096},[1082,1481,1023],{"class":1092},[1082,1483,1434],{"class":1181},[1082,1485,1184],{"class":1193},[1082,1487,1221],{"class":1092},[1082,1489,1369],{"class":1109},[1082,1491,1221],{"class":1092},[1082,1493,1410],{"class":1193},[1082,1495,1023],{"class":1092},[1082,1497,962],{"class":1181},[1082,1499,1451],{"class":1092},[1082,1501,1502],{"class":1280},"Payment",[1082,1504,1457],{"class":1092},[1082,1506,1184],{"class":1193},[1082,1508,1221],{"class":1092},[1082,1510,1511],{"class":1109},"payments",[1082,1513,1221],{"class":1092},[1082,1515,1263],{"class":1193},[1082,1517,1518],{"class":1084,"line":1243},[1082,1519,1162],{"emptyLinePlaceholder":1161},[1082,1521,1522,1525,1527,1529,1531,1533,1536,1538,1541,1543,1545,1547,1551,1553,1555,1557,1559,1562,1564,1566],{"class":1084,"line":1257},[1082,1523,1524],{"class":1096},"  inv",[1082,1526,1023],{"class":1092},[1082,1528,975],{"class":1181},[1082,1530,1184],{"class":1193},[1082,1532,1221],{"class":1092},[1082,1534,1535],{"class":1109},"inv-1",[1082,1537,1221],{"class":1092},[1082,1539,1540],{"class":1092},",",[1082,1542,1093],{"class":1092},[1082,1544,1289],{"class":1193},[1082,1546,1197],{"class":1092},[1082,1548,1550],{"class":1549},"sbssI"," 100",[1082,1552,1540],{"class":1092},[1082,1554,1300],{"class":1193},[1082,1556,1197],{"class":1092},[1082,1558,1106],{"class":1092},[1082,1560,1561],{"class":1109},"paid",[1082,1563,1221],{"class":1092},[1082,1565,1100],{"class":1092},[1082,1567,1263],{"class":1193},[1082,1569,1571,1574,1576,1578,1580,1582,1585,1587,1589,1591,1593,1595,1597,1599,1601,1603,1605,1607,1609,1611,1613,1615,1617,1620,1622,1624],{"class":1084,"line":1570},11,[1082,1572,1573],{"class":1096},"  pay",[1082,1575,1023],{"class":1092},[1082,1577,975],{"class":1181},[1082,1579,1184],{"class":1193},[1082,1581,1221],{"class":1092},[1082,1583,1584],{"class":1109},"pay-1",[1082,1586,1221],{"class":1092},[1082,1588,1540],{"class":1092},[1082,1590,1093],{"class":1092},[1082,1592,1322],{"class":1193},[1082,1594,1197],{"class":1092},[1082,1596,1106],{"class":1092},[1082,1598,1535],{"class":1109},[1082,1600,1221],{"class":1092},[1082,1602,1540],{"class":1092},[1082,1604,1289],{"class":1193},[1082,1606,1197],{"class":1092},[1082,1608,1550],{"class":1549},[1082,1610,1540],{"class":1092},[1082,1612,1339],{"class":1193},[1082,1614,1197],{"class":1092},[1082,1616,1106],{"class":1092},[1082,1618,1619],{"class":1109},"2026-07-08T00:00:00Z",[1082,1621,1221],{"class":1092},[1082,1623,1100],{"class":1092},[1082,1625,1263],{"class":1193},[1082,1627,1629],{"class":1084,"line":1628},12,[1082,1630,1162],{"emptyLinePlaceholder":1161},[1082,1632,1634],{"class":1084,"line":1633},13,[1082,1635,1637],{"class":1636},"sHwdD","  \u002F\u002F Read-your-writes: sees the staged put above even though nothing\n",[1082,1639,1641],{"class":1084,"line":1640},14,[1082,1642,1643],{"class":1636},"  \u002F\u002F has been committed yet.\n",[1082,1645,1647,1649,1652,1654,1656,1658,1660,1663,1665,1667,1669,1671],{"class":1084,"line":1646},15,[1082,1648,1421],{"class":1168},[1082,1650,1651],{"class":1096}," staged",[1082,1653,1284],{"class":1092},[1082,1655,1178],{"class":1088},[1082,1657,1424],{"class":1096},[1082,1659,1023],{"class":1092},[1082,1661,1662],{"class":1181},"get",[1082,1664,1184],{"class":1193},[1082,1666,1221],{"class":1092},[1082,1668,1535],{"class":1109},[1082,1670,1221],{"class":1092},[1082,1672,1263],{"class":1193},[1082,1674,1676],{"class":1084,"line":1675},16,[1082,1677,1162],{"emptyLinePlaceholder":1161},[1082,1679,1681,1684,1686,1688,1691],{"class":1084,"line":1680},17,[1082,1682,1683],{"class":1088},"  return",[1082,1685,1651],{"class":1096},[1082,1687,1023],{"class":1092},[1082,1689,1690],{"class":1096},"amount",[1082,1692,1693],{"class":1636}," \u002F\u002F the body's return value flows through\n",[1082,1695,1697,1699],{"class":1084,"line":1696},18,[1082,1698,1260],{"class":1092},[1082,1700,1263],{"class":1096},[1082,1702,1704],{"class":1084,"line":1703},19,[1082,1705,1706],{"class":1636},"\u002F\u002F → 100\n",[946,1708,1709,1710,1712,1713,1716],{},"If the body throws before returning, nothing is persisted. If a staged op carries an ",[950,1711,999],{}," that no longer matches the stored record, the transaction throws ",[950,1714,1715],{},"ConflictError"," before any writes happen (a pre-flight compare-and-swap check).",[1718,1719,1721],"h3",{"id":1720},"commit-time-invariants","Commit-time invariants",[946,1723,1724,1727,1728,1731,1732,1735,1736,1739],{},[950,1725,1726],{},"withTransactions({ invariants: [...] })"," declares set-level invariants that run at commit, over the change-set of an ordinary ",[950,1729,1730],{},"db.transaction()"," (and of amendment transactions — see ",[959,1733,693],{"href":1734},".\u002Fguards#amendment-flow","). There is no role gate: this generalizes the guard service's ",[950,1737,1738],{},"amendment.invariant"," to plain transactions.",[1073,1741,1743],{"className":1075,"code":1742,"language":1077,"meta":1078,"style":1078},"import { InvariantError } from '@noy-db\u002Fhub'\nimport { withTransactions } from '@noy-db\u002Fhub\u002Ftransactions'\n\nconst db = await createNoydb({\n  store: toMemory(),\n  user: 'alice',\n  secret: 'a-strong-secret',\n  transactionsStrategy: withTransactions({\n    invariants: [{\n      scope: 'lines', \u002F\u002F collection name\n      check: (changes, ctx) => {\n        const total = (side: 'before' | 'after') =>\n          changes.reduce((sum, c) => sum + ((c[side] as { amount?: number } | null)?.amount ?? 0), 0)\n        if (total('before') !== total('after')) {\n          throw new InvariantError('lines total must be preserved')\n        }\n      },\n    }],\n  }),\n})\n",[950,1744,1745,1764,1782,1786,1802,1814,1828,1842,1854,1866,1885,1908,1947,2032,2071,2092,2097,2102,2112,2121],{"__ignoreMap":1078},[1082,1746,1747,1749,1751,1754,1756,1758,1760,1762],{"class":1084,"line":1085},[1082,1748,1089],{"class":1088},[1082,1750,1093],{"class":1092},[1082,1752,1753],{"class":1096}," InvariantError",[1082,1755,1100],{"class":1092},[1082,1757,1103],{"class":1088},[1082,1759,1106],{"class":1092},[1082,1761,1110],{"class":1109},[1082,1763,1113],{"class":1092},[1082,1765,1766,1768,1770,1772,1774,1776,1778,1780],{"class":1084,"line":1116},[1082,1767,1089],{"class":1088},[1082,1769,1093],{"class":1092},[1082,1771,1123],{"class":1096},[1082,1773,1100],{"class":1092},[1082,1775,1103],{"class":1088},[1082,1777,1106],{"class":1092},[1082,1779,1132],{"class":1109},[1082,1781,1113],{"class":1092},[1082,1783,1784],{"class":1084,"line":1137},[1082,1785,1162],{"emptyLinePlaceholder":1161},[1082,1787,1788,1790,1792,1794,1796,1798,1800],{"class":1084,"line":1158},[1082,1789,1169],{"class":1168},[1082,1791,1172],{"class":1096},[1082,1793,1175],{"class":1092},[1082,1795,1178],{"class":1088},[1082,1797,1097],{"class":1181},[1082,1799,1184],{"class":1096},[1082,1801,1187],{"class":1092},[1082,1803,1804,1806,1808,1810,1812],{"class":1084,"line":1165},[1082,1805,1194],{"class":1193},[1082,1807,1197],{"class":1092},[1082,1809,1144],{"class":1181},[1082,1811,1202],{"class":1096},[1082,1813,1205],{"class":1092},[1082,1815,1816,1818,1820,1822,1824,1826],{"class":1084,"line":1190},[1082,1817,1211],{"class":1193},[1082,1819,1197],{"class":1092},[1082,1821,1106],{"class":1092},[1082,1823,1218],{"class":1109},[1082,1825,1221],{"class":1092},[1082,1827,1205],{"class":1092},[1082,1829,1830,1832,1834,1836,1838,1840],{"class":1084,"line":1208},[1082,1831,1229],{"class":1193},[1082,1833,1197],{"class":1092},[1082,1835,1106],{"class":1092},[1082,1837,1236],{"class":1109},[1082,1839,1221],{"class":1092},[1082,1841,1205],{"class":1092},[1082,1843,1844,1846,1848,1850,1852],{"class":1084,"line":1226},[1082,1845,1246],{"class":1193},[1082,1847,1197],{"class":1092},[1082,1849,1123],{"class":1181},[1082,1851,1184],{"class":1096},[1082,1853,1187],{"class":1092},[1082,1855,1856,1859,1861,1864],{"class":1084,"line":1243},[1082,1857,1858],{"class":1193},"    invariants",[1082,1860,1197],{"class":1092},[1082,1862,1863],{"class":1096}," [",[1082,1865,1187],{"class":1092},[1082,1867,1868,1871,1873,1875,1878,1880,1882],{"class":1084,"line":1257},[1082,1869,1870],{"class":1193},"      scope",[1082,1872,1197],{"class":1092},[1082,1874,1106],{"class":1092},[1082,1876,1877],{"class":1109},"lines",[1082,1879,1221],{"class":1092},[1082,1881,1540],{"class":1092},[1082,1883,1884],{"class":1636}," \u002F\u002F collection name\n",[1082,1886,1887,1890,1892,1894,1897,1899,1902,1904,1906],{"class":1084,"line":1570},[1082,1888,1889],{"class":1181},"      check",[1082,1891,1197],{"class":1092},[1082,1893,1403],{"class":1092},[1082,1895,1896],{"class":1406},"changes",[1082,1898,1540],{"class":1092},[1082,1900,1901],{"class":1406}," ctx",[1082,1903,1410],{"class":1092},[1082,1905,1413],{"class":1168},[1082,1907,1416],{"class":1092},[1082,1909,1910,1913,1916,1918,1920,1923,1925,1927,1930,1932,1935,1937,1940,1942,1944],{"class":1084,"line":1628},[1082,1911,1912],{"class":1168},"        const",[1082,1914,1915],{"class":1096}," total",[1082,1917,1284],{"class":1092},[1082,1919,1403],{"class":1092},[1082,1921,1922],{"class":1406},"side",[1082,1924,1197],{"class":1092},[1082,1926,1106],{"class":1092},[1082,1928,1929],{"class":1109},"before",[1082,1931,1221],{"class":1092},[1082,1933,1934],{"class":1092}," |",[1082,1936,1106],{"class":1092},[1082,1938,1939],{"class":1109},"after",[1082,1941,1221],{"class":1092},[1082,1943,1410],{"class":1092},[1082,1945,1946],{"class":1168}," =>\n",[1082,1948,1949,1952,1954,1956,1958,1960,1963,1965,1968,1970,1972,1975,1978,1981,1984,1987,1989,1992,1995,1997,1999,2002,2004,2006,2008,2011,2013,2016,2018,2021,2024,2026,2028,2030],{"class":1084,"line":1633},[1082,1950,1951],{"class":1096},"          changes",[1082,1953,1023],{"class":1092},[1082,1955,804],{"class":1181},[1082,1957,1184],{"class":1193},[1082,1959,1184],{"class":1092},[1082,1961,1962],{"class":1406},"sum",[1082,1964,1540],{"class":1092},[1082,1966,1967],{"class":1406}," c",[1082,1969,1410],{"class":1092},[1082,1971,1413],{"class":1168},[1082,1973,1974],{"class":1096}," sum",[1082,1976,1977],{"class":1092}," +",[1082,1979,1980],{"class":1193}," ((",[1082,1982,1983],{"class":1096},"c",[1082,1985,1986],{"class":1193},"[",[1082,1988,1922],{"class":1096},[1082,1990,1991],{"class":1193},"] ",[1082,1993,1994],{"class":1088},"as",[1082,1996,1093],{"class":1092},[1082,1998,1289],{"class":1193},[1082,2000,2001],{"class":1092},"?:",[1082,2003,1294],{"class":1280},[1082,2005,1100],{"class":1092},[1082,2007,1934],{"class":1092},[1082,2009,2010],{"class":1280}," null",[1082,2012,1410],{"class":1193},[1082,2014,2015],{"class":1092},"?.",[1082,2017,1690],{"class":1096},[1082,2019,2020],{"class":1092}," ??",[1082,2022,2023],{"class":1549}," 0",[1082,2025,1410],{"class":1193},[1082,2027,1540],{"class":1092},[1082,2029,2023],{"class":1549},[1082,2031,1263],{"class":1193},[1082,2033,2034,2037,2039,2042,2044,2046,2048,2050,2053,2056,2058,2060,2062,2064,2066,2069],{"class":1084,"line":1640},[1082,2035,2036],{"class":1088},"        if",[1082,2038,1403],{"class":1193},[1082,2040,2041],{"class":1181},"total",[1082,2043,1184],{"class":1193},[1082,2045,1221],{"class":1092},[1082,2047,1929],{"class":1109},[1082,2049,1221],{"class":1092},[1082,2051,2052],{"class":1193},") ",[1082,2054,2055],{"class":1092},"!==",[1082,2057,1915],{"class":1181},[1082,2059,1184],{"class":1193},[1082,2061,1221],{"class":1092},[1082,2063,1939],{"class":1109},[1082,2065,1221],{"class":1092},[1082,2067,2068],{"class":1193},")) ",[1082,2070,1187],{"class":1092},[1082,2072,2073,2076,2079,2081,2083,2085,2088,2090],{"class":1084,"line":1646},[1082,2074,2075],{"class":1088},"          throw",[1082,2077,2078],{"class":1092}," new",[1082,2080,1753],{"class":1181},[1082,2082,1184],{"class":1193},[1082,2084,1221],{"class":1092},[1082,2086,2087],{"class":1109},"lines total must be preserved",[1082,2089,1221],{"class":1092},[1082,2091,1263],{"class":1193},[1082,2093,2094],{"class":1084,"line":1675},[1082,2095,2096],{"class":1092},"        }\n",[1082,2098,2099],{"class":1084,"line":1680},[1082,2100,2101],{"class":1092},"      },\n",[1082,2103,2104,2107,2110],{"class":1084,"line":1696},[1082,2105,2106],{"class":1092},"    }",[1082,2108,2109],{"class":1096},"]",[1082,2111,1205],{"class":1092},[1082,2113,2114,2117,2119],{"class":1084,"line":1703},[1082,2115,2116],{"class":1092},"  }",[1082,2118,1410],{"class":1096},[1082,2120,1205],{"class":1092},[1082,2122,2124,2126],{"class":1084,"line":2123},20,[1082,2125,1260],{"class":1092},[1082,2127,1263],{"class":1096},[946,2129,2130,2133,2134,2137,2138,2141,2142,2145,2146,2148,2149,2152,2153,2155,2156,2158,2159,2161,2162,1023],{},[950,2131,2132],{},"scope"," is the collection name the invariant watches — ",[950,2135,2136],{},"check"," only fires when the committed transaction wrote at least one record in that collection. ",[950,2139,2140],{},"check(changes, ctx)"," receives a ",[950,2143,2144],{},"ReadonlyArray\u003CGuardChange>"," for that scope: ",[950,2147,1929],{}," is the plaintext prior record (",[950,2150,2151],{},"null"," on insert), ",[950,2154,1939],{}," is the written record (",[950,2157,2151],{}," on delete). The plaintext ",[950,2160,1929],{}," is captured before the writes execute, so invariants see the true prior state. A throw reverts the whole transaction and surfaces as ",[950,2163,2164],{},"InvariantError",[941,2166,1066],{"id":2167},"atomicity-guarantee",[946,2169,2170,2172,2173,2180,2181,2183,2184,2052,2187,2190,2191,2194,2195,2197],{},[950,2171,1022],{}," commits ",[965,2174,2175,2176,2179],{},"all-or-nothing through one ",[950,2177,2178],{},"store.tx()"," batch"," when the store declares ",[950,2182,1057],{}," (and implements ",[950,2185,2186],{},"tx()",[965,2188,2189],{},"and the batch is statically safe",". Otherwise it falls back to the per-record OCC executor described above, with best-effort unwind — unchanged from prior behavior. The fallback is ",[965,2192,2193],{},"silent by design",": nothing in the return value of ",[950,2196,1730],{}," tells you which path a given call took.",[946,2199,2200,2201,2204],{},"A batch is ",[965,2202,2203],{},"statically safe"," only when ALL of the following hold:",[985,2206,2207,2214,2240,2281],{},[988,2208,2209,2210,2213],{},"No touched collection has a ",[965,2211,2212],{},"derivation or materialized-view source",", at any lifecycle — lazy included.",[988,2215,2216,2217,2220,2221,2224,2225,2228,2229,2232,2233,2239],{},"No touched collection is ",[965,2218,2219],{},"CRDT-mode",", has ",[965,2222,2223],{},"unique constraints",", or has ",[965,2226,2227],{},"refs"," on the write direction. Since hub ",[950,2230,2231],{},"0.5.0",", a delete no longer forces the OCC path by itself (",[959,2234,2238],{"href":2235,"rel":2236},"https:\u002F\u002Fgithub.com\u002Fnoy-db\u002Fcore\u002Fissues\u002F922",[2237],"nofollow","noy-db#922","): the eligibility check consults every source a delete cascade can fire from — lookup-ref edges, classic inbound refs, and managed-link endpoints — and only a collection one of those touches falls back to OCC (the cascades run during prepare, which is not abortable). A genuinely refs-free collection's deletes commit all-or-nothing alongside puts.",[988,2241,2242,2243,2249,2250,2252,2253,2255,2256,2261,2262,2265,2266,953,2269,2272,2273,2276,2277,2280],{},"No live ",[965,2244,2245,2248],{},[950,2246,2247],{},"onBeforeWrite"," hook"," — the refusal-capable kind — is registered anywhere on the ",[950,2251,62],{}," instance (a db-global signal). Since hub ",[950,2254,2231],{},", after-write observers no longer forfeit the atomic path (",[959,2257,2260],{"href":2258,"rel":2259},"https:\u002F\u002Fgithub.com\u002Fnoy-db\u002Fcore\u002Fissues\u002F931",[2237],"noy-db#931","): user ",[950,2263,2264],{},"onAfterWrite"," hooks and the ",[950,2267,2268],{},"afterPut",[950,2270,2271],{},"afterDelete"," observe bus fire per op on the atomic path too, after each leg's finalize — so the auto-registered cross-tab write relay (",[950,2274,2275],{},"by-tabs",") or a ",[950,2278,2279],{},"withForget()"," subject index no longer pushes every batch onto OCC. Ordering note: on the atomic path these observers fire after the batch is durable (in staged order), where the OCC loop interleaves them per op.",[988,2282,2283,2284,2287,2288,2294],{},"The transaction is ",[965,2285,2286],{},"not amendment mode",", and the batch has no ",[965,2289,2290,2291],{},"duplicate ",[950,2292,2293],{},"(vault, collection, id)"," target.",[946,2296,2297],{},"Schema gates (update-gate + fence) are asserted per-op the same way on both paths.",[1718,2299,2301],{"id":2300},"what-differs-between-the-two-paths","What differs between the two paths",[985,2303,2304,2324,2345],{},[988,2305,2306,2309,2310,2312,2313,953,2315,2317,2318,2320,2321,2323],{},[965,2307,2308],{},"Commit ordering."," On the atomic path, history snapshots, ledger appends, change events, after-write observers (",[950,2311,2264],{}," hooks + the ",[950,2314,2268],{},[950,2316,2271],{}," bus, since hub ",[950,2319,2231],{},"), and dirty-marking all fire per-op in staged order ",[965,2322,1939],{}," the batch commits. On the OCC path they interleave with execution, per op, as before. Outcome-identical on success; observable to anything subscribing to events mid-transaction.",[988,2325,2326,2329,2330,2332,2333,2336,2337,2340,2341,1023],{},[965,2327,2328],{},"Failure behavior."," A rejected atomic batch — including a store-side ",[950,2331,999],{}," CAS rejection — applies ",[965,2334,2335],{},"nothing",": no ledger entries, no events, no revert pass, because nothing landed. A ",[1027,2338,2339],{},"post-commit"," failure (finalize\u002Finvariant) reverts through the atomic-revert path on stores that support it. The OCC path keeps its existing best-effort revert — see ",[959,2342,2344],{"href":2343},"#limits-gotchas","Limits & gotchas",[988,2346,2347,2350],{},[965,2348,2349],{},"Crash window."," The batch write itself is atomic on the atomic path, but the audit artifacts (history\u002Fledger) written after it are not covered by that same batch: a crash between commit and finalize can lose audit entries for a batch that already committed. That window is narrower than the OCC path's — where a crash mid-batch can leave a partially-applied write on disk — but it is a real window, not full audit atomicity, and worth stating plainly rather than implying otherwise.",[946,2352,2353,2354,2357,2358,2360],{},"Which stores currently qualify for the atomic path (and any per-store caveats) is tracked on the ",[959,2355,2356],{"href":861},"store capabilities matrix"," — treat \"all-or-nothing\" as a store-dependent property of ",[950,2359,1730],{},", not a blanket one.",[946,2362,2363,2364,1038,2366,2369,2370,2372,2373,2378,2379,1023],{},"Since hub ",[950,2365,2231],{},[950,2367,2368],{},"collection.putMany({ atomic: true })"," commits through the same one-batch ",[950,2371,2178],{}," path on an eligible batch (",[959,2374,2377],{"href":2375,"rel":2376},"https:\u002F\u002Fgithub.com\u002Fnoy-db\u002Fcore\u002Fissues\u002F921",[2237],"noy-db#921",") — see ",[959,2380,2382],{"href":2381},"..\u002Fcore\u002Fcollection\u002Fmethods#putmany",[950,2383,2384],{},"putMany()",[941,2386,2388],{"id":2387},"api","API",[1718,2390,2392],{"id":2391},"withtransactionsoptions",[950,2393,2394],{},"withTransactions(options?)",[1073,2396,2398],{"className":1075,"code":2397,"language":1077,"meta":1078,"style":1078},"withTransactions(options?: TransactionStrategyOptions): TxStrategy\n\u002F\u002F TransactionStrategyOptions = { invariants?: TransactionInvariant[] }\n",[950,2399,2400,2413],{"__ignoreMap":1078},[1082,2401,2402,2405,2408,2410],{"class":1084,"line":1085},[1082,2403,2404],{"class":1181},"withTransactions",[1082,2406,2407],{"class":1096},"(options",[1082,2409,2001],{"class":1092},[1082,2411,2412],{"class":1096}," TransactionStrategyOptions): TxStrategy\n",[1082,2414,2415],{"class":1084,"line":1116},[1082,2416,2417],{"class":1636},"\u002F\u002F TransactionStrategyOptions = { invariants?: TransactionInvariant[] }\n",[946,2419,2420,2421,2424,2425,2428],{},"Builds the strategy passed to ",[950,2422,2423],{},"createNoydb({ transactionsStrategy })",". ",[950,2426,2427],{},"options.invariants"," registers the commit-time changeset invariants described above; omit it for plain multi-record atomicity with no extra checks.",[1718,2430,2432],{"id":2431},"txcontext",[950,2433,2434],{},"TxContext",[946,2436,2437],{},"The handle passed into the transaction body.",[985,2439,2440,2446],{},[988,2441,2442,2445],{},[950,2443,2444],{},"tx.txId"," — a stable ULID shared by every write the transaction performs.",[988,2447,2448,2451,2452,2455,2456,2458,2459,2462],{},[950,2449,2450],{},"tx.vault(name)"," — scope subsequent calls to a named vault; returns a ",[950,2453,2454],{},"TxVault",". The vault must already be open on the ",[950,2457,62],{}," instance (via ",[950,2460,2461],{},"db.openVault()",").",[1718,2464,2466],{"id":2465},"txvault",[950,2467,2454],{},[985,2469,2470],{},[988,2471,2472,2475,2476,1023],{},[950,2473,2474],{},".collection\u003CT>(name)"," — scope subsequent calls to a named collection; returns a ",[950,2477,2478],{},"TxCollection\u003CT>",[1718,2480,2482],{"id":2481},"txcollectiont",[950,2483,2478],{},[985,2485,2486,2496,2506],{},[988,2487,2488,2491,2492,2495],{},[950,2489,2490],{},".get(id): Promise\u003CT | null>"," — reads the most recently staged value for ",[950,2493,2494],{},"id"," in this transaction if one exists, otherwise the current committed value.",[988,2497,2498,2501,2502,2505],{},[950,2499,2500],{},".put(id, record, options?: { expectedVersion?: number; reason?: string }): void"," — stages a put; nothing is written until the body returns. ",[950,2503,2504],{},"reason"," is forwarded to the resulting ledger entry.",[988,2507,2508,2511],{},[950,2509,2510],{},".delete(id, options?: { expectedVersion?: number }): void"," — stages a delete.",[1718,2513,2515],{"id":2514},"amendmenttxoptions",[950,2516,2517],{},"AmendmentTxOptions",[1073,2519,2521],{"className":1075,"code":2520,"language":1077,"meta":1078,"style":1078},"interface AmendmentTxOptions {\n  readonly amendment: true\n  readonly reason: string \u002F\u002F required, recorded in the ledger entry\n}\n",[950,2522,2523,2533,2546,2560],{"__ignoreMap":1078},[1082,2524,2525,2528,2531],{"class":1084,"line":1085},[1082,2526,2527],{"class":1168},"interface",[1082,2529,2530],{"class":1280}," AmendmentTxOptions",[1082,2532,1416],{"class":1092},[1082,2534,2535,2538,2541,2543],{"class":1084,"line":1116},[1082,2536,2537],{"class":1168},"  readonly",[1082,2539,2540],{"class":1193}," amendment",[1082,2542,1197],{"class":1092},[1082,2544,2545],{"class":1280}," true\n",[1082,2547,2548,2550,2553,2555,2557],{"class":1084,"line":1137},[1082,2549,2537],{"class":1168},[1082,2551,2552],{"class":1193}," reason",[1082,2554,1197],{"class":1092},[1082,2556,1305],{"class":1280},[1082,2558,2559],{"class":1636}," \u002F\u002F required, recorded in the ledger entry\n",[1082,2561,2562],{"class":1084,"line":1158},[1082,2563,2564],{"class":1092},"}\n",[946,2566,2567,2568,2571,2572,2574,2575,2577,2578,1038,2580,1042,2582,2584,2585,2587],{},"The options bag for ",[950,2569,2570],{},"db.transaction({ amendment: true, reason }, fn)"," — a privileged transaction form that skips ordinary guard checks in favor of a role-gated invariant review. Requires ",[950,2573,1018],{}," plus ",[950,2576,1033],{},", and ",[950,2579,1037],{},[950,2581,1041],{},[950,2583,1045],{}," role on every vault the body touches. Full walkthrough on the ",[959,2586,693],{"href":1734}," page.",[946,2589,2590,1038,2593,2577,2596,2599,2600,2602,2603,2605,2606,1023],{},[950,2591,2592],{},"runTransaction",[950,2594,2595],{},"TxStrategy",[950,2597,2598],{},"TransactionInvariant"," are also exported from ",[950,2601,1132],{}," for type annotations and custom strategy composition; application code normally only calls ",[950,2604,1022],{}," and ",[950,2607,1018],{},[941,2609,2611],{"id":2610},"behavior-when-not-opted-in","Behavior when NOT opted in",[985,2613,2614,2639,2659],{},[988,2615,2616,1038,2618,2577,2620,2623,2624],{},[950,2617,1022],{},[950,2619,2570],{},[950,2621,2622],{},"db.transaction({ dryRun: true }, fn)"," all throw immediately: ",[1027,2625,2626,2627,2630,2631,2634,2635,2638],{},"\"Multi-record transactions require the tx strategy. Import ",[950,2628,2629],{},"{ withTransactions }"," from ",[950,2632,2633],{},"\"@noy-db\u002Fhub\u002Ftransactions\""," and pass it to ",[950,2636,2637],{},"createNoydb({ transactionsStrategy: withTransactions() })",".\"",[988,2640,2641,2644,2645,2648,2649,2655,2656,2658],{},[950,2642,2643],{},"db.transaction(vaultName)"," — the sync-peer batch transaction (",[950,2646,2647],{},"SyncTransaction",") — is a distinct overload gated by ",[959,2650,2652],{"href":2651},".\u002Fsync",[950,2653,2654],{},"withSync()",", not by this service; it is unaffected by whether ",[950,2657,1018],{}," is opted in.",[988,2660,2661],{},"None of the ~280 lines of transaction-executor code reach the bundle until you opt in.",[941,2663,2344],{"id":2664},"limits-gotchas",[985,2666,2667,2678,2684,2694,2703,2714],{},[988,2668,2669,2672,2673,2675,2676,1023],{},[965,2670,2671],{},"Crash window (OCC path)",": on a store\u002Fbatch that doesn't qualify for the atomic path (see ",[959,2674,1066],{"href":1065},"), commit is pre-flight-check, then execute-each-op, then best-effort revert on failure — it is not a single storage-layer transaction. If the process dies between two already-executed ops, on-disk state can be left partial. The atomic path has its own, narrower crash window — audit artifacts written after the batch commits, not the batch itself — see ",[959,2677,1066],{"href":1065},[988,2679,2680,2683],{},[965,2681,2682],{},"Revert is best-effort, not audited (OCC path)",": a mid-commit failure restores each already-written record to its prior envelope, but the ledger is not rewritten to erase the intermediate writes — the audit trail preserves the partial commit and the revert.",[988,2685,2686,2689,2690,2693],{},[965,2687,2688],{},"Version numbers inside the body are pre-transaction",": ",[950,2691,2692],{},"tx.collection().get(id)"," returns the most-recently-staged value, but its version reflects the state before the transaction — staged puts don't have a version yet.",[988,2695,2696,2699,2700,2702],{},[965,2697,2698],{},"Cross-vault transactions need both vaults already open"," on the ",[950,2701,62],{}," instance before the body runs.",[988,2704,2705,2708,2709,1403,2711,2713],{},[965,2706,2707],{},"Not cross-peer",": a transaction commits against the primary store only; the sync engine still pushes on its normal schedule. For atomic writes across sync peers, use ",[950,2710,2643],{},[950,2712,2647],{},") instead.",[988,2715,2716],{},"Body errors propagate — wrap the call in try\u002Fcatch if you want a graceful UI response instead of an unhandled rejection.",[941,2718,2720],{"id":2719},"pairs-well-with","Pairs well with",[985,2722,2723,2731,2738,2746,2758],{},[988,2724,2725,2730],{},[965,2726,2727],{},[959,2728,697],{"href":2729},".\u002Fhistory"," — every committed op fires a ledger entry per op after commit",[988,2732,2733,2737],{},[965,2734,2735],{},[959,2736,864],{"href":2651}," — staged ops still flow through dirty tracking once committed",[988,2739,2740,2745],{},[965,2741,2742],{},[959,2743,653],{"href":2744},".\u002Fcrdt"," — staged ops on CRDT collections merge through the CRDT strategy",[988,2747,2748,2753,2754,2757],{},[965,2749,2750],{},[959,2751,693],{"href":2752},".\u002Fguards"," — amendment-mode transactions (",[950,2755,2756],{},"db.transaction({ amendment: true }, fn)",") are the privileged override path for guard-locked records",[988,2759,2760,2762,2763,2766,2767,1023],{},[965,2761,2227],{}," — cascade-delete (ref mode ",[950,2764,2765],{},"'cascade'",") is transaction-atomic: cascaded child deletes register onto the active transaction and roll back with the parent on a mid-batch failure. See ",[959,2768,681],{"href":2769},".\u002Fforeign-refs",[941,2771,2773],{"id":2772},"see-also","See also",[985,2775,2776,2781,2785,2790,2795,2802,2810],{},[988,2777,2778],{},[959,2779,2780],{"href":961},"Vault & Collection model",[988,2782,2783],{},[959,2784,681],{"href":2769},[988,2786,2787,2789],{},[959,2788,693],{"href":2752}," — amendment transactions, record locks, invariants",[988,2791,2792,2794],{},[959,2793,697],{"href":2729}," — the audit ledger transactions write to",[988,2796,2797,1015,2799,2801],{},[959,2798,864],{"href":2651},[950,2800,2643],{}," cross-peer batches",[988,2803,2804,2807,2808],{},[959,2805,860],{"href":2806},".\u002Fstorage-capability-matrix"," — which stores declare ",[950,2809,1057],{},[988,2811,2812,2813,1023],{},"Proven by showcase ",[959,2814,2817],{"href":2815,"rel":2816},"https:\u002F\u002Fgithub.com\u002Fnoy-db\u002Fdocs\u002Fblob\u002Fmain\u002Fshowcases\u002Fsrc\u002F20-with-transactions.showcase.test.ts",[2237],[950,2818,2819],{},"20-with-transactions",[2821,2822,2823],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":1078,"searchDepth":1137,"depth":1137,"links":2825},[2826,2827,2828,2829,2830,2833,2836,2843,2844,2845,2846],{"id":943,"depth":1116,"text":944},{"id":982,"depth":1116,"text":983},{"id":1006,"depth":1116,"text":1007},{"id":1070,"depth":1116,"text":1071},{"id":1266,"depth":1116,"text":1267,"children":2831},[2832],{"id":1720,"depth":1137,"text":1721},{"id":2167,"depth":1116,"text":1066,"children":2834},[2835],{"id":2300,"depth":1137,"text":2301},{"id":2387,"depth":1116,"text":2388,"children":2837},[2838,2839,2840,2841,2842],{"id":2391,"depth":1137,"text":2394},{"id":2431,"depth":1137,"text":2434},{"id":2465,"depth":1137,"text":2454},{"id":2481,"depth":1137,"text":2478},{"id":2514,"depth":1137,"text":2517},{"id":2610,"depth":1116,"text":2611},{"id":2664,"depth":1116,"text":2344},{"id":2719,"depth":1116,"text":2720},{"id":2772,"depth":1116,"text":2773},null,"Multi-record atomic writes: db.transaction() stages puts\u002Fdeletes across collections and commits all-or-nothing, with optional changeset invariants.","md",{},"service",{"title":876,"description":2848},"stable","important","tdSNHR92JlGVjZ6Dwxc1ou7nJ8-JaV3oo4qcR_G1H-w",{"data":2857,"body":2858},{},{"type":2859,"children":2860},"root",[2861],{"type":2862,"tag":946,"props":2863,"children":2864},"element",{},[2865],{"type":2862,"tag":950,"props":2866,"children":2868},{"className":2867},[],[2869],{"type":2870,"value":1132},"text",{"data":2872,"body":2873},{},{"type":2859,"children":2874},[2875],{"type":2862,"tag":946,"props":2876,"children":2877},{},[2878],{"type":2862,"tag":950,"props":2879,"children":2881},{"className":2880},[],[2882],{"type":2870,"value":1018},{"data":2884,"body":2885},{},{"type":2859,"children":2886},[2887],{"type":2862,"tag":946,"props":2888,"children":2889},{},[2890],{"type":2862,"tag":950,"props":2891,"children":2893},{"className":2892},[],[2894],{"type":2870,"value":2895},"with-commit",1791896583604]