[{"data":1,"prerenderedAt":745},["ShallowReactive",2],{"navigation_docs_en":3,"-en-tauri-sqlite-orm-advanced-topics-manual-schema-management":237,"-en-tauri-sqlite-orm-advanced-topics-manual-schema-management-surround":740},[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":221,"body":239,"description":734,"extension":735,"links":736,"meta":737,"navigation":440,"path":222,"seo":738,"stem":223,"__hash__":739},"docs_en/en/4.tauri-sqlite-orm/6.advanced-topics/7.manual-schema-management.md",{"type":240,"value":241,"toc":729},"minimark",[242,247,251,254,259,339,343,410,414,417,725],[243,244,246],"h1",{"id":245},"manual-schema-management","Manual Schema Management",[248,249,250],"p",{},"For complex database migrations like renaming a column or for use in custom migration scripts, the ORM provides a suite of low-level helper methods. These give you direct, granular control over your database schema.",[248,252,253],{},"These methods should be used with caution, as they directly manipulate the database structure and can lead to data loss if used improperly. They are excellent tools for tasks that the automatic migrator does not handle.",[255,256,258],"h2",{"id":257},"table-helpers","Table Helpers",[260,261,262,278],"table",{},[263,264,265],"thead",{},[266,267,268,272,275],"tr",{},[269,270,271],"th",{},"Method",[269,273,274],{},"Description",[269,276,277],{},"Example",[279,280,281,305,322],"tbody",{},[266,282,283,293,300],{},[284,285,286],"td",{},[287,288,289],"strong",{},[290,291,292],"code",{},"db.doesTableExist(tableName)",[284,294,295,296,299],{},"Checks if a table with the given name exists. Returns a ",[290,297,298],{},"Promise\u003Cboolean>",".",[284,301,302],{},[290,303,304],{},"const exists = await db.doesTableExist('logs');",[266,306,307,314,317],{},[284,308,309],{},[287,310,311],{},[290,312,313],{},"db.dropTable(tableName)",[284,315,316],{},"Drops a table from the database.",[284,318,319],{},[290,320,321],{},"await db.dropTable('old_settings');",[266,323,324,331,334],{},[284,325,326],{},[287,327,328],{},[290,329,330],{},"db.renameTable(from, to)",[284,332,333],{},"Renames an existing table.",[284,335,336],{},[290,337,338],{},"await db.renameTable('users', 'app_users');",[255,340,342],{"id":341},"column-helpers","Column Helpers",[260,344,345,355],{},[263,346,347],{},[266,348,349,351,353],{},[269,350,271],{},[269,352,274],{},[269,354,277],{},[279,356,357,376,393],{},[266,358,359,366,371],{},[284,360,361],{},[287,362,363],{},[290,364,365],{},"db.doesColumnExist(tbl, col)",[284,367,368,369,299],{},"Checks if a column exists on a given table. Returns ",[290,370,298],{},[284,372,373],{},[290,374,375],{},"const exists = await db.doesColumnExist('users', 'last_login');",[266,377,378,385,388],{},[284,379,380],{},[287,381,382],{},[290,383,384],{},"db.dropColumn(tableName, colName)",[284,386,387],{},"Drops a column from a table. Requires a modern SQLite version.",[284,389,390],{},[290,391,392],{},"await db.dropColumn('posts', 'legacy_views');",[266,394,395,402,405],{},[284,396,397],{},[287,398,399],{},[290,400,401],{},"db.renameColumn(tbl, from, to)",[284,403,404],{},"Renames a column on an existing table.",[284,406,407],{},[290,408,409],{},"await db.renameColumn('users', 'fullName', 'full_name');",[255,411,413],{"id":412},"example-a-custom-migration-script","Example: A Custom Migration Script",[248,415,416],{},"You can combine these helpers to create sophisticated, versioned migration scripts that handle changes the automatic system cannot.",[418,419,424],"pre",{"className":420,"code":421,"language":422,"meta":423,"style":423},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","// my-migration-script.ts\n\nasync function runMigrationV2() {\n  console.log('Running migration to version 2...');\n  \n  // V2 changes the 'posts.title' column to 'headline'\n  const columnExists = await db.doesColumnExist('posts', 'title');\n  \n  if (columnExists) {\n    console.log(\"Renaming 'posts.title' to 'headline'...\");\n    await db.renameColumn('posts', 'title', 'headline');\n    console.log('Rename complete.');\n  } else {\n    console.log(\"Column 'posts.title' not found, skipping rename.\");\n  }\n}\n\nrunMigrationV2();\n","ts","",[290,425,426,435,442,463,494,500,506,554,559,577,601,643,665,676,698,704,710,715],{"__ignoreMap":423},[427,428,431],"span",{"class":429,"line":430},"line",1,[427,432,434],{"class":433},"sHwdD","// my-migration-script.ts\n",[427,436,438],{"class":429,"line":437},2,[427,439,441],{"emptyLinePlaceholder":440},true,"\n",[427,443,445,449,452,456,460],{"class":429,"line":444},3,[427,446,448],{"class":447},"spNyl","async",[427,450,451],{"class":447}," function",[427,453,455],{"class":454},"s2Zo4"," runMigrationV2",[427,457,459],{"class":458},"sMK4o","()",[427,461,462],{"class":458}," {\n",[427,464,466,470,472,475,479,482,486,488,491],{"class":429,"line":465},4,[427,467,469],{"class":468},"sTEyZ","  console",[427,471,299],{"class":458},[427,473,474],{"class":454},"log",[427,476,478],{"class":477},"swJcz","(",[427,480,481],{"class":458},"'",[427,483,485],{"class":484},"sfazB","Running migration to version 2...",[427,487,481],{"class":458},[427,489,490],{"class":477},")",[427,492,493],{"class":458},";\n",[427,495,497],{"class":429,"line":496},5,[427,498,499],{"class":477},"  \n",[427,501,503],{"class":429,"line":502},6,[427,504,505],{"class":433},"  // V2 changes the 'posts.title' column to 'headline'\n",[427,507,509,512,515,518,522,525,527,530,532,534,537,539,542,545,548,550,552],{"class":429,"line":508},7,[427,510,511],{"class":447},"  const",[427,513,514],{"class":468}," columnExists",[427,516,517],{"class":458}," =",[427,519,521],{"class":520},"s7zQu"," await",[427,523,524],{"class":468}," db",[427,526,299],{"class":458},[427,528,529],{"class":454},"doesColumnExist",[427,531,478],{"class":477},[427,533,481],{"class":458},[427,535,536],{"class":484},"posts",[427,538,481],{"class":458},[427,540,541],{"class":458},",",[427,543,544],{"class":458}," '",[427,546,547],{"class":484},"title",[427,549,481],{"class":458},[427,551,490],{"class":477},[427,553,493],{"class":458},[427,555,557],{"class":429,"line":556},8,[427,558,499],{"class":477},[427,560,562,565,568,571,574],{"class":429,"line":561},9,[427,563,564],{"class":520},"  if",[427,566,567],{"class":477}," (",[427,569,570],{"class":468},"columnExists",[427,572,573],{"class":477},") ",[427,575,576],{"class":458},"{\n",[427,578,580,583,585,587,589,592,595,597,599],{"class":429,"line":579},10,[427,581,582],{"class":468},"    console",[427,584,299],{"class":458},[427,586,474],{"class":454},[427,588,478],{"class":477},[427,590,591],{"class":458},"\"",[427,593,594],{"class":484},"Renaming 'posts.title' to 'headline'...",[427,596,591],{"class":458},[427,598,490],{"class":477},[427,600,493],{"class":458},[427,602,604,607,609,611,614,616,618,620,622,624,626,628,630,632,634,637,639,641],{"class":429,"line":603},11,[427,605,606],{"class":520},"    await",[427,608,524],{"class":468},[427,610,299],{"class":458},[427,612,613],{"class":454},"renameColumn",[427,615,478],{"class":477},[427,617,481],{"class":458},[427,619,536],{"class":484},[427,621,481],{"class":458},[427,623,541],{"class":458},[427,625,544],{"class":458},[427,627,547],{"class":484},[427,629,481],{"class":458},[427,631,541],{"class":458},[427,633,544],{"class":458},[427,635,636],{"class":484},"headline",[427,638,481],{"class":458},[427,640,490],{"class":477},[427,642,493],{"class":458},[427,644,646,648,650,652,654,656,659,661,663],{"class":429,"line":645},12,[427,647,582],{"class":468},[427,649,299],{"class":458},[427,651,474],{"class":454},[427,653,478],{"class":477},[427,655,481],{"class":458},[427,657,658],{"class":484},"Rename complete.",[427,660,481],{"class":458},[427,662,490],{"class":477},[427,664,493],{"class":458},[427,666,668,671,674],{"class":429,"line":667},13,[427,669,670],{"class":458},"  }",[427,672,673],{"class":520}," else",[427,675,462],{"class":458},[427,677,679,681,683,685,687,689,692,694,696],{"class":429,"line":678},14,[427,680,582],{"class":468},[427,682,299],{"class":458},[427,684,474],{"class":454},[427,686,478],{"class":477},[427,688,591],{"class":458},[427,690,691],{"class":484},"Column 'posts.title' not found, skipping rename.",[427,693,591],{"class":458},[427,695,490],{"class":477},[427,697,493],{"class":458},[427,699,701],{"class":429,"line":700},15,[427,702,703],{"class":458},"  }\n",[427,705,707],{"class":429,"line":706},16,[427,708,709],{"class":458},"}\n",[427,711,713],{"class":429,"line":712},17,[427,714,441],{"emptyLinePlaceholder":440},[427,716,718,721,723],{"class":429,"line":717},18,[427,719,720],{"class":454},"runMigrationV2",[427,722,459],{"class":468},[427,724,493],{"class":458},[726,727,728],"style",{},"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 .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 .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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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);}",{"title":423,"searchDepth":437,"depth":437,"links":730},[731,732,733],{"id":257,"depth":437,"text":258},{"id":341,"depth":437,"text":342},{"id":412,"depth":437,"text":413},"Schema Management in Tauri SQLite ORM.","md",null,{},{"title":221,"description":734},"ME7_35LpfV6Pn6vruyJDdbA_kgfIXvS7wpnjB5H6lKM",[741,743],{"title":217,"path":218,"stem":219,"description":742,"children":-1},"Type Safety & Inference in Tauri SQLite ORM.",{"title":225,"path":226,"stem":227,"description":744,"children":-1},"Debug your queries using .toSQL()",1773317304382]