[{"data":1,"prerenderedAt":1370},["ShallowReactive",2],{"navigation_docs_en":3,"-en-tauri-sqlite-orm-advanced-topics-transactions":237,"-en-tauri-sqlite-orm-advanced-topics-transactions-surround":1365},[4,15,69,122],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":14},"Getting Started with Docs","i-lucide-home","/en/getting-started","en/1.getting-started",[10],{"title":11,"path":12,"stem":13,"icon":6},"Introduction","/en/getting-started/introduction","en/1.getting-started/1.introduction",false,{"title":16,"path":17,"stem":18,"children":19,"page":14},"owo-ui Components","/en/owo-ui-components","en/2.owo-ui-components",[20,23],{"title":11,"path":21,"stem":22,"icon":6},"/en/owo-ui-components/introduction","en/2.owo-ui-components/2.introduction",{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":14},"Components","i-lucide-layout","/en/owo-ui-components/components","en/2.owo-ui-components/3.components",[29,33,37,41,45,49,53,57,61,65],{"title":30,"path":31,"stem":32},"Button","/en/owo-ui-components/components/button","en/2.owo-ui-components/3.components/button",{"title":34,"path":35,"stem":36},"Checkbox","/en/owo-ui-components/components/checkbox","en/2.owo-ui-components/3.components/checkbox",{"title":38,"path":39,"stem":40},"Collapsible Container","/en/owo-ui-components/components/collapsible-container","en/2.owo-ui-components/3.components/collapsible-container",{"title":42,"path":43,"stem":44},"Dropdown","/en/owo-ui-components/components/dropdown","en/2.owo-ui-components/3.components/dropdown",{"title":46,"path":47,"stem":48},"Flow Layout","/en/owo-ui-components/components/flow-layout","en/2.owo-ui-components/3.components/flow-layout",{"title":50,"path":51,"stem":52},"Grid Layout","/en/owo-ui-components/components/grid-layout","en/2.owo-ui-components/3.components/grid-layout",{"title":54,"path":55,"stem":56},"Label","/en/owo-ui-components/components/label","en/2.owo-ui-components/3.components/label",{"title":58,"path":59,"stem":60},"Scroll Container","/en/owo-ui-components/components/scroll-container","en/2.owo-ui-components/3.components/scroll-container",{"title":62,"path":63,"stem":64},"Slider","/en/owo-ui-components/components/slider","en/2.owo-ui-components/3.components/slider",{"title":66,"path":67,"stem":68},"Templates","/en/owo-ui-components/components/templates","en/2.owo-ui-components/3.components/templates",{"title":70,"path":71,"stem":72,"children":73,"page":14},"Nexus","/en/nexus","en/3.nexus",[74,77,82],{"title":11,"path":75,"stem":76,"icon":6},"/en/nexus/introduction","en/3.nexus/2.introduction",{"title":78,"path":79,"stem":80,"icon":81},"Deployment","/en/nexus/deployment","en/3.nexus/3.deployment","i-lucide-rocket",{"title":83,"path":84,"stem":85,"children":86,"page":14},"Endpoints","/en/nexus/endpoints","en/3.nexus/endpoints",[87,91,95,99,102,106,110,114,118],{"title":88,"path":89,"stem":90},"Authentication","/en/nexus/endpoints/authentication","en/3.nexus/endpoints/1.authentication",{"title":92,"path":93,"stem":94},"Rate Limiting","/en/nexus/endpoints/rate-limiting","en/3.nexus/endpoints/2.rate-limiting",{"title":96,"path":97,"stem":98},"Error Handling","/en/nexus/endpoints/error-handling","en/3.nexus/endpoints/3.error-handling",{"title":83,"path":100,"stem":101},"/en/nexus/endpoints/_dir","en/3.nexus/endpoints/_dir",{"title":103,"path":104,"stem":105},"Album","/en/nexus/endpoints/albums","en/3.nexus/endpoints/albums",{"title":107,"path":108,"stem":109},"Blog","/en/nexus/endpoints/blog","en/3.nexus/endpoints/blog",{"title":111,"path":112,"stem":113},"Comments","/en/nexus/endpoints/comments","en/3.nexus/endpoints/comments",{"title":115,"path":116,"stem":117},"File Management","/en/nexus/endpoints/file-management","en/3.nexus/endpoints/file-management",{"title":119,"path":120,"stem":121},"Photo Management","/en/nexus/endpoints/photos","en/3.nexus/endpoints/photos",{"title":123,"icon":124,"path":125,"stem":126,"children":127,"page":14},"Tauri SQLite ORM","i-lucide-database","/en/tauri-sqlite-orm","en/4.tauri-sqlite-orm",[128,132,137,141,162,187,232],{"title":11,"path":129,"stem":130,"icon":131},"/en/tauri-sqlite-orm/introduction","en/4.tauri-sqlite-orm/1.introduction","i-lucide-book-open",{"title":133,"path":134,"stem":135,"icon":136},"Installation & Setup","/en/tauri-sqlite-orm/installation-and-setup","en/4.tauri-sqlite-orm/2.installation-and-setup","i-lucide-download",{"title":138,"path":139,"stem":140,"icon":81},"Your First Schema & Query","/en/tauri-sqlite-orm/your-first-schema-and-query","en/4.tauri-sqlite-orm/3.your-first-schema-and-query",{"title":142,"path":143,"stem":144,"children":145,"page":14},"Core Concepts","/en/tauri-sqlite-orm/core-concepts","en/4.tauri-sqlite-orm/4.core-concepts",[146,150,154,158],{"title":147,"path":148,"stem":149},"Defining Schemas","/en/tauri-sqlite-orm/core-concepts/defining-schemas","en/4.tauri-sqlite-orm/4.core-concepts/1.defining-schemas",{"title":151,"path":152,"stem":153},"Column Types & Modifiers","/en/tauri-sqlite-orm/core-concepts/column-types-and-modifiers","en/4.tauri-sqlite-orm/4.core-concepts/2.column-types-and-modifiers",{"title":155,"path":156,"stem":157},"The ORM Instance","/en/tauri-sqlite-orm/core-concepts/the-orm-instance","en/4.tauri-sqlite-orm/4.core-concepts/3.the-orm-instance",{"title":159,"path":160,"stem":161},"Migrations","/en/tauri-sqlite-orm/core-concepts/migrations","en/4.tauri-sqlite-orm/4.core-concepts/4.migrations",{"title":163,"path":164,"stem":165,"children":166,"page":14},"Querying Data","/en/tauri-sqlite-orm/querying-data","en/4.tauri-sqlite-orm/5.querying-data",[167,171,175,179,183],{"title":168,"path":169,"stem":170},"Select","/en/tauri-sqlite-orm/querying-data/selecting-data","en/4.tauri-sqlite-orm/5.querying-data/1.selecting-data",{"title":172,"path":173,"stem":174},"Insert","/en/tauri-sqlite-orm/querying-data/inserting-data","en/4.tauri-sqlite-orm/5.querying-data/2.inserting-data",{"title":176,"path":177,"stem":178},"Update","/en/tauri-sqlite-orm/querying-data/updating-data","en/4.tauri-sqlite-orm/5.querying-data/3.updating-data",{"title":180,"path":181,"stem":182},"Delete","/en/tauri-sqlite-orm/querying-data/deleting-data","en/4.tauri-sqlite-orm/5.querying-data/4.deleting-data",{"title":184,"path":185,"stem":186},"Conditions & Operators","/en/tauri-sqlite-orm/querying-data/conditions-and-operators","en/4.tauri-sqlite-orm/5.querying-data/5.conditions-and-operators",{"title":188,"path":189,"stem":190,"children":191,"page":14},"Advanced Topics","/en/tauri-sqlite-orm/advanced-topics","en/4.tauri-sqlite-orm/6.advanced-topics",[192,196,200,204,208,212,216,220,224,228],{"title":193,"path":194,"stem":195},"Relations","/en/tauri-sqlite-orm/advanced-topics/working-with-relations","en/4.tauri-sqlite-orm/6.advanced-topics/1.working-with-relations",{"title":197,"path":198,"stem":199},"Error Handling & Safety","/en/tauri-sqlite-orm/advanced-topics/error-handling-and-safety","en/4.tauri-sqlite-orm/6.advanced-topics/10.error-handling-and-safety",{"title":201,"path":202,"stem":203},"Joins","/en/tauri-sqlite-orm/advanced-topics/joins","en/4.tauri-sqlite-orm/6.advanced-topics/2.joins",{"title":205,"path":206,"stem":207},"Transactions","/en/tauri-sqlite-orm/advanced-topics/transactions","en/4.tauri-sqlite-orm/6.advanced-topics/3.transactions",{"title":209,"path":210,"stem":211},"Common Table Expressions","/en/tauri-sqlite-orm/advanced-topics/common-table-expressions","en/4.tauri-sqlite-orm/6.advanced-topics/4.common-table-expressions",{"title":213,"path":214,"stem":215},"Raw SQL","/en/tauri-sqlite-orm/advanced-topics/raw-sql","en/4.tauri-sqlite-orm/6.advanced-topics/5.raw-sql",{"title":217,"path":218,"stem":219},"Type Safety & Inference","/en/tauri-sqlite-orm/advanced-topics/type-safety-and-inference","en/4.tauri-sqlite-orm/6.advanced-topics/6.type-safety-and-inference",{"title":221,"path":222,"stem":223},"Schema Management","/en/tauri-sqlite-orm/advanced-topics/manual-schema-management","en/4.tauri-sqlite-orm/6.advanced-topics/7.manual-schema-management",{"title":225,"path":226,"stem":227},"Query Debugging","/en/tauri-sqlite-orm/advanced-topics/query-debugging","en/4.tauri-sqlite-orm/6.advanced-topics/8.query-debugging",{"title":229,"path":230,"stem":231},"Subqueries & Aggregates","/en/tauri-sqlite-orm/advanced-topics/subqueries-and-aggregates","en/4.tauri-sqlite-orm/6.advanced-topics/9.subqueries-and-aggregates",{"title":233,"path":234,"stem":235,"icon":236},"API Reference","/en/tauri-sqlite-orm/api-reference","en/4.tauri-sqlite-orm/7.api-reference","i-lucide-book",{"id":238,"title":205,"body":239,"description":1359,"extension":1360,"links":1361,"meta":1362,"navigation":637,"path":206,"seo":1363,"stem":207,"__hash__":1364},"docs_en/en/4.tauri-sqlite-orm/6.advanced-topics/3.transactions.md",{"type":240,"value":241,"toc":1353},"minimark",[242,260,263,272,282,477,481,547,551,554,1349],[243,244,245,246,250,251,255,256,259],"p",{},"A transaction is a sequence of operations performed as a single logical unit of work. The key property of a transaction is ",[247,248,249],"strong",{},"atomicity",": either all of its operations succeed and are saved (",[252,253,254],"code",{},"COMMIT","), or none of them are (",[252,257,258],{},"ROLLBACK","). This guarantees that your database is never left in a partially updated, inconsistent state.",[243,261,262],{},"This is essential for operations like transferring funds between two accounts, where you must both debit one account and credit another. If the credit operation fails, the debit must be undone.",[264,265,267,268,271],"h2",{"id":266},"the-dbtransaction-method","The ",[252,269,270],{},"db.transaction()"," Method",[243,273,274,275,277,278,281],{},"The ORM provides a ",[252,276,270],{}," method that makes managing transactions straightforward and safe. It takes a single argument: an ",[252,279,280],{},"async"," callback function.",[283,284,289],"pre",{"className":285,"code":286,"language":287,"meta":288,"style":288},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","try {\n  const result = await db.transaction(async (tx) => {\n    // All your database logic goes here\n    // ...\n    return 'Success!';\n  });\n  console.log('Transaction committed:', result);\n} catch (error) {\n  console.error('Transaction rolled back:', error.message);\n}\n","typescript","",[252,290,291,304,352,359,365,384,394,423,438,471],{"__ignoreMap":288},[292,293,296,300],"span",{"class":294,"line":295},"line",1,[292,297,299],{"class":298},"s7zQu","try",[292,301,303],{"class":302},"sMK4o"," {\n",[292,305,307,311,315,318,321,324,327,331,335,337,340,344,347,350],{"class":294,"line":306},2,[292,308,310],{"class":309},"spNyl","  const",[292,312,314],{"class":313},"sTEyZ"," result",[292,316,317],{"class":302}," =",[292,319,320],{"class":298}," await",[292,322,323],{"class":313}," db",[292,325,326],{"class":302},".",[292,328,330],{"class":329},"s2Zo4","transaction",[292,332,334],{"class":333},"swJcz","(",[292,336,280],{"class":309},[292,338,339],{"class":302}," (",[292,341,343],{"class":342},"sHdIc","tx",[292,345,346],{"class":302},")",[292,348,349],{"class":309}," =>",[292,351,303],{"class":302},[292,353,355],{"class":294,"line":354},3,[292,356,358],{"class":357},"sHwdD","    // All your database logic goes here\n",[292,360,362],{"class":294,"line":361},4,[292,363,364],{"class":357},"    // ...\n",[292,366,368,371,374,378,381],{"class":294,"line":367},5,[292,369,370],{"class":298},"    return",[292,372,373],{"class":302}," '",[292,375,377],{"class":376},"sfazB","Success!",[292,379,380],{"class":302},"'",[292,382,383],{"class":302},";\n",[292,385,387,390,392],{"class":294,"line":386},6,[292,388,389],{"class":302},"  }",[292,391,346],{"class":333},[292,393,383],{"class":302},[292,395,397,400,402,405,407,409,412,414,417,419,421],{"class":294,"line":396},7,[292,398,399],{"class":313},"  console",[292,401,326],{"class":302},[292,403,404],{"class":329},"log",[292,406,334],{"class":333},[292,408,380],{"class":302},[292,410,411],{"class":376},"Transaction committed:",[292,413,380],{"class":302},[292,415,416],{"class":302},",",[292,418,314],{"class":313},[292,420,346],{"class":333},[292,422,383],{"class":302},[292,424,426,429,432,435],{"class":294,"line":425},8,[292,427,428],{"class":302},"}",[292,430,431],{"class":298}," catch",[292,433,434],{"class":313}," (error) ",[292,436,437],{"class":302},"{\n",[292,439,441,443,445,448,450,452,455,457,459,462,464,467,469],{"class":294,"line":440},9,[292,442,399],{"class":313},[292,444,326],{"class":302},[292,446,447],{"class":329},"error",[292,449,334],{"class":333},[292,451,380],{"class":302},[292,453,454],{"class":376},"Transaction rolled back:",[292,456,380],{"class":302},[292,458,416],{"class":302},[292,460,461],{"class":313}," error",[292,463,326],{"class":302},[292,465,466],{"class":313},"message",[292,468,346],{"class":333},[292,470,383],{"class":302},[292,472,474],{"class":294,"line":473},10,[292,475,476],{"class":302},"}\n",[264,478,480],{"id":479},"how-it-works","How It Works",[482,483,484,494,523,535],"ol",{},[485,486,487,490,491,493],"li",{},[247,488,489],{},"BEGIN TRANSACTION",": Before your callback is executed, the ORM issues a ",[252,492,489],{}," command.",[485,495,496,501,502,504,505,508,509,339,515,518,519,522],{},[247,497,267,498,500],{},[252,499,343],{}," Object",": Your callback receives a special ",[252,503,343],{}," object. This object is a transactional version of the main ",[252,506,507],{},"db"," instance. ",[247,510,511,512,514],{},"You must use ",[252,513,343],{}," for all queries inside the callback",[252,516,517],{},"tx.select",", ",[252,520,521],{},"tx.update",", etc.) to ensure they are part of the transaction.",[485,524,525,527,528,531,532,534],{},[247,526,254],{},": If your callback function runs to completion and returns a value (or a resolving ",[252,529,530],{},"Promise","), the ORM automatically issues a ",[252,533,254],{}," command, making all changes permanent.",[485,536,537,539,540,542,543,546],{},[247,538,258],{},": If your callback function throws an error, the ORM catches it and issues a ",[252,541,258],{}," command, undoing all changes made since the transaction began. The error is then re-thrown so you can handle it in a ",[252,544,545],{},"catch"," block.",[264,548,550],{"id":549},"example-a-safe-bank-transfer","Example: A Safe Bank Transfer",[243,552,553],{},"Here is a practical example of transferring a balance between two user accounts.",[283,555,557],{"className":285,"code":556,"language":287,"meta":288,"style":288},"import { db } from '$lib/db';\nimport { users } from '$lib/db/schema';\nimport { eq, sql } from '@type32/tauri-sqlite-orm';\n\nasync function transferFunds(fromUserId: number, toUserId: number, amount: number) {\n  if (amount \u003C= 0) {\n    throw new Error('Transfer amount must be positive.');\n  }\n\n  try {\n    await db.transaction(async (tx) => {\n      // 1. Debit the sender's account using decrement\n      const result = await tx.update(users)\n        .decrement('balance', amount)\n        .where(eq(users._.columns.id, fromUserId))\n        .execute();\n\n      // If the sender didn't exist, rowsAffected will be 0\n      if (result[0].rowsAffected === 0) {\n        throw new Error(`Sender with ID ${fromUserId} not found.`);\n      }\n\n      // 2. Check if the sender has sufficient funds\n      const sender = await tx.select(users, ['balance'])\n        .where(eq(users._.columns.id, fromUserId))\n        .get();\n      \n      if (sender.balance \u003C 0) {\n        // This error will trigger an automatic rollback!\n        throw new Error('Insufficient funds.');\n      }\n      \n      // 3. Credit the receiver's account using increment\n      await tx.update(users)\n        .increment('balance', amount)\n        .where(eq(users._.columns.id, toUserId))\n        .execute();\n      \n      console.log('Transfer steps completed within transaction.');\n    });\n    \n    console.log('Transaction successful! Funds have been transferred.');\n\n  } catch (error) {\n    console.error(`Transaction failed: ${error.message}. All changes were rolled back.`);\n  }\n}\n",[252,558,559,584,606,633,639,683,705,729,734,738,745,771,777,805,829,869,882,887,893,927,961,967,972,978,1015,1048,1060,1066,1089,1095,1117,1122,1127,1133,1151,1173,1206,1217,1222,1245,1255,1261,1284,1289,1304,1339,1344],{"__ignoreMap":288},[292,560,561,564,567,569,572,575,577,580,582],{"class":294,"line":295},[292,562,563],{"class":298},"import",[292,565,566],{"class":302}," {",[292,568,323],{"class":313},[292,570,571],{"class":302}," }",[292,573,574],{"class":298}," from",[292,576,373],{"class":302},[292,578,579],{"class":376},"$lib/db",[292,581,380],{"class":302},[292,583,383],{"class":302},[292,585,586,588,590,593,595,597,599,602,604],{"class":294,"line":306},[292,587,563],{"class":298},[292,589,566],{"class":302},[292,591,592],{"class":313}," users",[292,594,571],{"class":302},[292,596,574],{"class":298},[292,598,373],{"class":302},[292,600,601],{"class":376},"$lib/db/schema",[292,603,380],{"class":302},[292,605,383],{"class":302},[292,607,608,610,612,615,617,620,622,624,626,629,631],{"class":294,"line":354},[292,609,563],{"class":298},[292,611,566],{"class":302},[292,613,614],{"class":313}," eq",[292,616,416],{"class":302},[292,618,619],{"class":313}," sql",[292,621,571],{"class":302},[292,623,574],{"class":298},[292,625,373],{"class":302},[292,627,628],{"class":376},"@type32/tauri-sqlite-orm",[292,630,380],{"class":302},[292,632,383],{"class":302},[292,634,635],{"class":294,"line":361},[292,636,638],{"emptyLinePlaceholder":637},true,"\n",[292,640,641,643,646,649,651,654,657,661,663,666,668,670,672,675,677,679,681],{"class":294,"line":367},[292,642,280],{"class":309},[292,644,645],{"class":309}," function",[292,647,648],{"class":329}," transferFunds",[292,650,334],{"class":302},[292,652,653],{"class":342},"fromUserId",[292,655,656],{"class":302},":",[292,658,660],{"class":659},"sBMFI"," number",[292,662,416],{"class":302},[292,664,665],{"class":342}," toUserId",[292,667,656],{"class":302},[292,669,660],{"class":659},[292,671,416],{"class":302},[292,673,674],{"class":342}," amount",[292,676,656],{"class":302},[292,678,660],{"class":659},[292,680,346],{"class":302},[292,682,303],{"class":302},[292,684,685,688,690,693,696,700,703],{"class":294,"line":386},[292,686,687],{"class":298},"  if",[292,689,339],{"class":333},[292,691,692],{"class":313},"amount",[292,694,695],{"class":302}," \u003C=",[292,697,699],{"class":698},"sbssI"," 0",[292,701,702],{"class":333},") ",[292,704,437],{"class":302},[292,706,707,710,713,716,718,720,723,725,727],{"class":294,"line":396},[292,708,709],{"class":298},"    throw",[292,711,712],{"class":302}," new",[292,714,715],{"class":329}," Error",[292,717,334],{"class":333},[292,719,380],{"class":302},[292,721,722],{"class":376},"Transfer amount must be positive.",[292,724,380],{"class":302},[292,726,346],{"class":333},[292,728,383],{"class":302},[292,730,731],{"class":294,"line":425},[292,732,733],{"class":302},"  }\n",[292,735,736],{"class":294,"line":440},[292,737,638],{"emptyLinePlaceholder":637},[292,739,740,743],{"class":294,"line":473},[292,741,742],{"class":298},"  try",[292,744,303],{"class":302},[292,746,748,751,753,755,757,759,761,763,765,767,769],{"class":294,"line":747},11,[292,749,750],{"class":298},"    await",[292,752,323],{"class":313},[292,754,326],{"class":302},[292,756,330],{"class":329},[292,758,334],{"class":333},[292,760,280],{"class":309},[292,762,339],{"class":302},[292,764,343],{"class":342},[292,766,346],{"class":302},[292,768,349],{"class":309},[292,770,303],{"class":302},[292,772,774],{"class":294,"line":773},12,[292,775,776],{"class":357},"      // 1. Debit the sender's account using decrement\n",[292,778,780,783,785,787,789,792,794,797,799,802],{"class":294,"line":779},13,[292,781,782],{"class":309},"      const",[292,784,314],{"class":313},[292,786,317],{"class":302},[292,788,320],{"class":298},[292,790,791],{"class":313}," tx",[292,793,326],{"class":302},[292,795,796],{"class":329},"update",[292,798,334],{"class":333},[292,800,801],{"class":313},"users",[292,803,804],{"class":333},")\n",[292,806,808,811,814,816,818,821,823,825,827],{"class":294,"line":807},14,[292,809,810],{"class":302},"        .",[292,812,813],{"class":329},"decrement",[292,815,334],{"class":333},[292,817,380],{"class":302},[292,819,820],{"class":376},"balance",[292,822,380],{"class":302},[292,824,416],{"class":302},[292,826,674],{"class":313},[292,828,804],{"class":333},[292,830,832,834,837,839,842,844,846,848,851,853,856,858,861,863,866],{"class":294,"line":831},15,[292,833,810],{"class":302},[292,835,836],{"class":329},"where",[292,838,334],{"class":333},[292,840,841],{"class":329},"eq",[292,843,334],{"class":333},[292,845,801],{"class":313},[292,847,326],{"class":302},[292,849,850],{"class":313},"_",[292,852,326],{"class":302},[292,854,855],{"class":313},"columns",[292,857,326],{"class":302},[292,859,860],{"class":313},"id",[292,862,416],{"class":302},[292,864,865],{"class":313}," fromUserId",[292,867,868],{"class":333},"))\n",[292,870,872,874,877,880],{"class":294,"line":871},16,[292,873,810],{"class":302},[292,875,876],{"class":329},"execute",[292,878,879],{"class":333},"()",[292,881,383],{"class":302},[292,883,885],{"class":294,"line":884},17,[292,886,638],{"emptyLinePlaceholder":637},[292,888,890],{"class":294,"line":889},18,[292,891,892],{"class":357},"      // If the sender didn't exist, rowsAffected will be 0\n",[292,894,896,899,901,904,907,910,913,915,918,921,923,925],{"class":294,"line":895},19,[292,897,898],{"class":298},"      if",[292,900,339],{"class":333},[292,902,903],{"class":313},"result",[292,905,906],{"class":333},"[",[292,908,909],{"class":698},"0",[292,911,912],{"class":333},"]",[292,914,326],{"class":302},[292,916,917],{"class":313},"rowsAffected",[292,919,920],{"class":302}," ===",[292,922,699],{"class":698},[292,924,702],{"class":333},[292,926,437],{"class":302},[292,928,930,933,935,937,939,942,945,948,950,952,955,957,959],{"class":294,"line":929},20,[292,931,932],{"class":298},"        throw",[292,934,712],{"class":302},[292,936,715],{"class":329},[292,938,334],{"class":333},[292,940,941],{"class":302},"`",[292,943,944],{"class":376},"Sender with ID ",[292,946,947],{"class":302},"${",[292,949,653],{"class":313},[292,951,428],{"class":302},[292,953,954],{"class":376}," not found.",[292,956,941],{"class":302},[292,958,346],{"class":333},[292,960,383],{"class":302},[292,962,964],{"class":294,"line":963},21,[292,965,966],{"class":302},"      }\n",[292,968,970],{"class":294,"line":969},22,[292,971,638],{"emptyLinePlaceholder":637},[292,973,975],{"class":294,"line":974},23,[292,976,977],{"class":357},"      // 2. Check if the sender has sufficient funds\n",[292,979,981,983,986,988,990,992,994,997,999,1001,1003,1006,1008,1010,1012],{"class":294,"line":980},24,[292,982,782],{"class":309},[292,984,985],{"class":313}," sender",[292,987,317],{"class":302},[292,989,320],{"class":298},[292,991,791],{"class":313},[292,993,326],{"class":302},[292,995,996],{"class":329},"select",[292,998,334],{"class":333},[292,1000,801],{"class":313},[292,1002,416],{"class":302},[292,1004,1005],{"class":333}," [",[292,1007,380],{"class":302},[292,1009,820],{"class":376},[292,1011,380],{"class":302},[292,1013,1014],{"class":333},"])\n",[292,1016,1018,1020,1022,1024,1026,1028,1030,1032,1034,1036,1038,1040,1042,1044,1046],{"class":294,"line":1017},25,[292,1019,810],{"class":302},[292,1021,836],{"class":329},[292,1023,334],{"class":333},[292,1025,841],{"class":329},[292,1027,334],{"class":333},[292,1029,801],{"class":313},[292,1031,326],{"class":302},[292,1033,850],{"class":313},[292,1035,326],{"class":302},[292,1037,855],{"class":313},[292,1039,326],{"class":302},[292,1041,860],{"class":313},[292,1043,416],{"class":302},[292,1045,865],{"class":313},[292,1047,868],{"class":333},[292,1049,1051,1053,1056,1058],{"class":294,"line":1050},26,[292,1052,810],{"class":302},[292,1054,1055],{"class":329},"get",[292,1057,879],{"class":333},[292,1059,383],{"class":302},[292,1061,1063],{"class":294,"line":1062},27,[292,1064,1065],{"class":333},"      \n",[292,1067,1069,1071,1073,1076,1078,1080,1083,1085,1087],{"class":294,"line":1068},28,[292,1070,898],{"class":298},[292,1072,339],{"class":333},[292,1074,1075],{"class":313},"sender",[292,1077,326],{"class":302},[292,1079,820],{"class":313},[292,1081,1082],{"class":302}," \u003C",[292,1084,699],{"class":698},[292,1086,702],{"class":333},[292,1088,437],{"class":302},[292,1090,1092],{"class":294,"line":1091},29,[292,1093,1094],{"class":357},"        // This error will trigger an automatic rollback!\n",[292,1096,1098,1100,1102,1104,1106,1108,1111,1113,1115],{"class":294,"line":1097},30,[292,1099,932],{"class":298},[292,1101,712],{"class":302},[292,1103,715],{"class":329},[292,1105,334],{"class":333},[292,1107,380],{"class":302},[292,1109,1110],{"class":376},"Insufficient funds.",[292,1112,380],{"class":302},[292,1114,346],{"class":333},[292,1116,383],{"class":302},[292,1118,1120],{"class":294,"line":1119},31,[292,1121,966],{"class":302},[292,1123,1125],{"class":294,"line":1124},32,[292,1126,1065],{"class":333},[292,1128,1130],{"class":294,"line":1129},33,[292,1131,1132],{"class":357},"      // 3. Credit the receiver's account using increment\n",[292,1134,1136,1139,1141,1143,1145,1147,1149],{"class":294,"line":1135},34,[292,1137,1138],{"class":298},"      await",[292,1140,791],{"class":313},[292,1142,326],{"class":302},[292,1144,796],{"class":329},[292,1146,334],{"class":333},[292,1148,801],{"class":313},[292,1150,804],{"class":333},[292,1152,1154,1156,1159,1161,1163,1165,1167,1169,1171],{"class":294,"line":1153},35,[292,1155,810],{"class":302},[292,1157,1158],{"class":329},"increment",[292,1160,334],{"class":333},[292,1162,380],{"class":302},[292,1164,820],{"class":376},[292,1166,380],{"class":302},[292,1168,416],{"class":302},[292,1170,674],{"class":313},[292,1172,804],{"class":333},[292,1174,1176,1178,1180,1182,1184,1186,1188,1190,1192,1194,1196,1198,1200,1202,1204],{"class":294,"line":1175},36,[292,1177,810],{"class":302},[292,1179,836],{"class":329},[292,1181,334],{"class":333},[292,1183,841],{"class":329},[292,1185,334],{"class":333},[292,1187,801],{"class":313},[292,1189,326],{"class":302},[292,1191,850],{"class":313},[292,1193,326],{"class":302},[292,1195,855],{"class":313},[292,1197,326],{"class":302},[292,1199,860],{"class":313},[292,1201,416],{"class":302},[292,1203,665],{"class":313},[292,1205,868],{"class":333},[292,1207,1209,1211,1213,1215],{"class":294,"line":1208},37,[292,1210,810],{"class":302},[292,1212,876],{"class":329},[292,1214,879],{"class":333},[292,1216,383],{"class":302},[292,1218,1220],{"class":294,"line":1219},38,[292,1221,1065],{"class":333},[292,1223,1225,1228,1230,1232,1234,1236,1239,1241,1243],{"class":294,"line":1224},39,[292,1226,1227],{"class":313},"      console",[292,1229,326],{"class":302},[292,1231,404],{"class":329},[292,1233,334],{"class":333},[292,1235,380],{"class":302},[292,1237,1238],{"class":376},"Transfer steps completed within transaction.",[292,1240,380],{"class":302},[292,1242,346],{"class":333},[292,1244,383],{"class":302},[292,1246,1248,1251,1253],{"class":294,"line":1247},40,[292,1249,1250],{"class":302},"    }",[292,1252,346],{"class":333},[292,1254,383],{"class":302},[292,1256,1258],{"class":294,"line":1257},41,[292,1259,1260],{"class":333},"    \n",[292,1262,1264,1267,1269,1271,1273,1275,1278,1280,1282],{"class":294,"line":1263},42,[292,1265,1266],{"class":313},"    console",[292,1268,326],{"class":302},[292,1270,404],{"class":329},[292,1272,334],{"class":333},[292,1274,380],{"class":302},[292,1276,1277],{"class":376},"Transaction successful! Funds have been transferred.",[292,1279,380],{"class":302},[292,1281,346],{"class":333},[292,1283,383],{"class":302},[292,1285,1287],{"class":294,"line":1286},43,[292,1288,638],{"emptyLinePlaceholder":637},[292,1290,1292,1294,1296,1298,1300,1302],{"class":294,"line":1291},44,[292,1293,389],{"class":302},[292,1295,431],{"class":298},[292,1297,339],{"class":333},[292,1299,447],{"class":313},[292,1301,702],{"class":333},[292,1303,437],{"class":302},[292,1305,1307,1309,1311,1313,1315,1317,1320,1322,1324,1326,1328,1330,1333,1335,1337],{"class":294,"line":1306},45,[292,1308,1266],{"class":313},[292,1310,326],{"class":302},[292,1312,447],{"class":329},[292,1314,334],{"class":333},[292,1316,941],{"class":302},[292,1318,1319],{"class":376},"Transaction failed: ",[292,1321,947],{"class":302},[292,1323,447],{"class":313},[292,1325,326],{"class":302},[292,1327,466],{"class":313},[292,1329,428],{"class":302},[292,1331,1332],{"class":376},". All changes were rolled back.",[292,1334,941],{"class":302},[292,1336,346],{"class":333},[292,1338,383],{"class":302},[292,1340,1342],{"class":294,"line":1341},46,[292,1343,733],{"class":302},[292,1345,1347],{"class":294,"line":1346},47,[292,1348,476],{"class":302},[1350,1351,1352],"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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}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 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 .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}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":288,"searchDepth":306,"depth":306,"links":1354},[1355,1357,1358],{"id":266,"depth":306,"text":1356},"The db.transaction() Method",{"id":479,"depth":306,"text":480},{"id":549,"depth":306,"text":550},"Transactions in Tauri SQLite ORM.","md",null,{},{"title":205,"description":1359},"S50C1I8aCVSYL7ojGlzSGy9E7TrbR_DoFiU_6JrBXLI",[1366,1368],{"title":201,"path":202,"stem":203,"description":1367,"children":-1},"Joins in Tauri SQLite ORM.",{"title":209,"path":210,"stem":211,"description":1369,"children":-1},"CTEs in Tauri SQLite ORM.",1773317304274]