[{"data":1,"prerenderedAt":1140},["ShallowReactive",2],{"navigation_docs_en":3,"-en-tauri-sqlite-orm-advanced-topics-type-safety-and-inference":237,"-en-tauri-sqlite-orm-advanced-topics-type-safety-and-inference-surround":1135},[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":217,"body":239,"description":1129,"extension":1130,"links":1131,"meta":1132,"navigation":354,"path":218,"seo":1133,"stem":219,"__hash__":1134},"docs_en/en/4.tauri-sqlite-orm/6.advanced-topics/6.type-safety-and-inference.md",{"type":240,"value":241,"toc":1124},"minimark",[242,246,260,271,278,281,558,564,581,584,782,788,795,979,982,1117,1120],[243,244,217],"h1",{"id":245},"type-safety-inference",[247,248,249,250,254,255,259],"p",{},"One of the most powerful features of this ORM is its deep integration with TypeScript. The schema you define in ",[251,252,253],"code",{},"schema.ts"," is not just a blueprint for your database; it's a ",[256,257,258],"strong",{},"single source of truth"," that the ORM uses to generate precise TypeScript types for all your data.",[247,261,262,263,266,267,270],{},"This means you get robust autocompletion, compile-time error checking, and less boilerplate code, as you rarely need to write your own ",[251,264,265],{},"interface"," or ",[251,268,269],{},"type"," definitions for your database models.",[272,273,275],"h2",{"id":274},"inferselectmodel",[251,276,277],{},"InferSelectModel",[247,279,280],{},"This is the most common helper type. It infers the type of a record as it would be selected from the database. This is the type you'll use when you're working with data fetched from a query.",[282,283,288],"pre",{"className":284,"code":285,"language":286,"meta":287,"style":287},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { InferSelectModel } from '@type32/tauri-sqlite-orm';\nimport { users } from '$lib/db/schema';\n\n// This creates a `User` type directly from the schema.\nexport type User = InferSelectModel\u003Ctypeof users>;\n\n/*\nIf the `users` schema is:\n{\n  id: integer('id').primaryKey(),\n  fullName: text('full_name').notNull(),\n  createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),\n  bio: text('bio') // nullable\n}\n\nThe inferred `User` type will be:\n{\n  id: number;\n  fullName: string;\n  createdAt: Date; // Correctly inferred from the 'timestamp' mode\n  bio: string | null | undefined; // Correctly inferred as optional\n}\n*/\n\nfunction displayUser(user: User) {\n  console.log(user.fullName);\n}\n","ts","",[251,289,290,326,349,356,363,390,395,401,407,413,419,425,431,437,443,448,454,459,465,471,477,483,488,494,499,527,553],{"__ignoreMap":287},[291,292,295,299,303,307,310,313,316,320,323],"span",{"class":293,"line":294},"line",1,[291,296,298],{"class":297},"s7zQu","import",[291,300,302],{"class":301},"sMK4o"," {",[291,304,306],{"class":305},"sTEyZ"," InferSelectModel",[291,308,309],{"class":301}," }",[291,311,312],{"class":297}," from",[291,314,315],{"class":301}," '",[291,317,319],{"class":318},"sfazB","@type32/tauri-sqlite-orm",[291,321,322],{"class":301},"'",[291,324,325],{"class":301},";\n",[291,327,329,331,333,336,338,340,342,345,347],{"class":293,"line":328},2,[291,330,298],{"class":297},[291,332,302],{"class":301},[291,334,335],{"class":305}," users",[291,337,309],{"class":301},[291,339,312],{"class":297},[291,341,315],{"class":301},[291,343,344],{"class":318},"$lib/db/schema",[291,346,322],{"class":301},[291,348,325],{"class":301},[291,350,352],{"class":293,"line":351},3,[291,353,355],{"emptyLinePlaceholder":354},true,"\n",[291,357,359],{"class":293,"line":358},4,[291,360,362],{"class":361},"sHwdD","// This creates a `User` type directly from the schema.\n",[291,364,366,369,373,377,380,382,385,387],{"class":293,"line":365},5,[291,367,368],{"class":297},"export",[291,370,372],{"class":371},"spNyl"," type",[291,374,376],{"class":375},"sBMFI"," User",[291,378,379],{"class":301}," =",[291,381,306],{"class":375},[291,383,384],{"class":301},"\u003Ctypeof",[291,386,335],{"class":305},[291,388,389],{"class":301},">;\n",[291,391,393],{"class":293,"line":392},6,[291,394,355],{"emptyLinePlaceholder":354},[291,396,398],{"class":293,"line":397},7,[291,399,400],{"class":361},"/*\n",[291,402,404],{"class":293,"line":403},8,[291,405,406],{"class":361},"If the `users` schema is:\n",[291,408,410],{"class":293,"line":409},9,[291,411,412],{"class":361},"{\n",[291,414,416],{"class":293,"line":415},10,[291,417,418],{"class":361},"  id: integer('id').primaryKey(),\n",[291,420,422],{"class":293,"line":421},11,[291,423,424],{"class":361},"  fullName: text('full_name').notNull(),\n",[291,426,428],{"class":293,"line":427},12,[291,429,430],{"class":361},"  createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),\n",[291,432,434],{"class":293,"line":433},13,[291,435,436],{"class":361},"  bio: text('bio') // nullable\n",[291,438,440],{"class":293,"line":439},14,[291,441,442],{"class":361},"}\n",[291,444,446],{"class":293,"line":445},15,[291,447,355],{"emptyLinePlaceholder":354},[291,449,451],{"class":293,"line":450},16,[291,452,453],{"class":361},"The inferred `User` type will be:\n",[291,455,457],{"class":293,"line":456},17,[291,458,412],{"class":361},[291,460,462],{"class":293,"line":461},18,[291,463,464],{"class":361},"  id: number;\n",[291,466,468],{"class":293,"line":467},19,[291,469,470],{"class":361},"  fullName: string;\n",[291,472,474],{"class":293,"line":473},20,[291,475,476],{"class":361},"  createdAt: Date; // Correctly inferred from the 'timestamp' mode\n",[291,478,480],{"class":293,"line":479},21,[291,481,482],{"class":361},"  bio: string | null | undefined; // Correctly inferred as optional\n",[291,484,486],{"class":293,"line":485},22,[291,487,442],{"class":361},[291,489,491],{"class":293,"line":490},23,[291,492,493],{"class":361},"*/\n",[291,495,497],{"class":293,"line":496},24,[291,498,355],{"emptyLinePlaceholder":354},[291,500,502,505,509,512,516,519,521,524],{"class":293,"line":501},25,[291,503,504],{"class":371},"function",[291,506,508],{"class":507},"s2Zo4"," displayUser",[291,510,511],{"class":301},"(",[291,513,515],{"class":514},"sHdIc","user",[291,517,518],{"class":301},":",[291,520,376],{"class":375},[291,522,523],{"class":301},")",[291,525,526],{"class":301}," {\n",[291,528,530,533,536,539,542,544,546,549,551],{"class":293,"line":529},26,[291,531,532],{"class":305},"  console",[291,534,535],{"class":301},".",[291,537,538],{"class":507},"log",[291,540,511],{"class":541},"swJcz",[291,543,515],{"class":305},[291,545,535],{"class":301},[291,547,548],{"class":305},"fullName",[291,550,523],{"class":541},[291,552,325],{"class":301},[291,554,556],{"class":293,"line":555},27,[291,557,442],{"class":301},[272,559,561],{"id":560},"inferinsertmodel",[251,562,563],{},"InferInsertModel",[247,565,566,567,570,571,574,575,577,578,535],{},"This helper type infers the shape of an object that can be passed to the ",[251,568,569],{},".values()"," method of an ",[251,572,573],{},"insert"," query. It's different from ",[251,576,277],{}," in one key way: it makes any column that is nullable, has a default value, or is auto-incrementing ",[256,579,580],{},"optional",[247,582,583],{},"This is crucial because you don't need to provide these values when creating a new record.",[282,585,587],{"className":284,"code":586,"language":286,"meta":287,"style":287},"import { InferInsertModel } from '@type32/tauri-sqlite-orm';\nimport { users } from '$lib/db/schema';\n\nexport type NewUser = InferInsertModel\u003Ctypeof users>;\n\n/*\nUsing the same schema as above, the `NewUser` type will be:\n{\n  id?: number; // Optional, because it's an auto-incrementing PK\n  fullName: string; // Required, because it's NOT NULL and has no default\n  createdAt?: Date; // Optional, because it likely has a .$defaultFn\n  bio?: string | null | undefined; // Optional, because it's nullable\n}\n*/\n\n// This is a valid object of type NewUser.\nconst userToInsert: NewUser = {\n  fullName: 'John Doe',\n};\n\nawait db.insert(users).values(userToInsert).execute();\n",[251,588,589,610,630,634,653,657,661,666,670,675,680,685,690,694,698,702,707,723,740,745,749],{"__ignoreMap":287},[291,590,591,593,595,598,600,602,604,606,608],{"class":293,"line":294},[291,592,298],{"class":297},[291,594,302],{"class":301},[291,596,597],{"class":305}," InferInsertModel",[291,599,309],{"class":301},[291,601,312],{"class":297},[291,603,315],{"class":301},[291,605,319],{"class":318},[291,607,322],{"class":301},[291,609,325],{"class":301},[291,611,612,614,616,618,620,622,624,626,628],{"class":293,"line":328},[291,613,298],{"class":297},[291,615,302],{"class":301},[291,617,335],{"class":305},[291,619,309],{"class":301},[291,621,312],{"class":297},[291,623,315],{"class":301},[291,625,344],{"class":318},[291,627,322],{"class":301},[291,629,325],{"class":301},[291,631,632],{"class":293,"line":351},[291,633,355],{"emptyLinePlaceholder":354},[291,635,636,638,640,643,645,647,649,651],{"class":293,"line":358},[291,637,368],{"class":297},[291,639,372],{"class":371},[291,641,642],{"class":375}," NewUser",[291,644,379],{"class":301},[291,646,597],{"class":375},[291,648,384],{"class":301},[291,650,335],{"class":305},[291,652,389],{"class":301},[291,654,655],{"class":293,"line":365},[291,656,355],{"emptyLinePlaceholder":354},[291,658,659],{"class":293,"line":392},[291,660,400],{"class":361},[291,662,663],{"class":293,"line":397},[291,664,665],{"class":361},"Using the same schema as above, the `NewUser` type will be:\n",[291,667,668],{"class":293,"line":403},[291,669,412],{"class":361},[291,671,672],{"class":293,"line":409},[291,673,674],{"class":361},"  id?: number; // Optional, because it's an auto-incrementing PK\n",[291,676,677],{"class":293,"line":415},[291,678,679],{"class":361},"  fullName: string; // Required, because it's NOT NULL and has no default\n",[291,681,682],{"class":293,"line":421},[291,683,684],{"class":361},"  createdAt?: Date; // Optional, because it likely has a .$defaultFn\n",[291,686,687],{"class":293,"line":427},[291,688,689],{"class":361},"  bio?: string | null | undefined; // Optional, because it's nullable\n",[291,691,692],{"class":293,"line":433},[291,693,442],{"class":361},[291,695,696],{"class":293,"line":439},[291,697,493],{"class":361},[291,699,700],{"class":293,"line":445},[291,701,355],{"emptyLinePlaceholder":354},[291,703,704],{"class":293,"line":450},[291,705,706],{"class":361},"// This is a valid object of type NewUser.\n",[291,708,709,712,715,717,719,721],{"class":293,"line":456},[291,710,711],{"class":371},"const",[291,713,714],{"class":305}," userToInsert",[291,716,518],{"class":301},[291,718,642],{"class":375},[291,720,379],{"class":301},[291,722,526],{"class":301},[291,724,725,728,730,732,735,737],{"class":293,"line":461},[291,726,727],{"class":541},"  fullName",[291,729,518],{"class":301},[291,731,315],{"class":301},[291,733,734],{"class":318},"John Doe",[291,736,322],{"class":301},[291,738,739],{"class":301},",\n",[291,741,742],{"class":293,"line":467},[291,743,744],{"class":301},"};\n",[291,746,747],{"class":293,"line":473},[291,748,355],{"emptyLinePlaceholder":354},[291,750,751,754,757,759,761,764,766,769,772,774,777,780],{"class":293,"line":479},[291,752,753],{"class":297},"await",[291,755,756],{"class":305}," db",[291,758,535],{"class":301},[291,760,573],{"class":507},[291,762,763],{"class":305},"(users)",[291,765,535],{"class":301},[291,767,768],{"class":507},"values",[291,770,771],{"class":305},"(userToInsert)",[291,773,535],{"class":301},[291,775,776],{"class":507},"execute",[291,778,779],{"class":305},"()",[291,781,325],{"class":301},[272,783,785],{"id":784},"inferrelationalselectmodel",[251,786,787],{},"InferRelationalSelectModel",[247,789,790,791,794],{},"Use this helper to infer the result type of a select query that includes relations via ",[251,792,793],{},".include(with)",". This lets you type variables that hold results from relational queries without manually defining intersection types.",[282,796,798],{"className":284,"code":797,"language":286,"meta":287,"style":287},"import { InferSelectModel, InferRelationalSelectModel } from '@type32/tauri-sqlite-orm';\nimport { schema } from '$lib/db/schema';\n\nexport type User = InferSelectModel\u003Ctypeof schema.user>;\n\nconst withRelationalObject = { sessions: true, accounts: true } as const;\nexport type UserWithRelations = InferRelationalSelectModel\u003C\n  typeof schema.user,\n  typeof schema.userRelations,\n  typeof withRelationalObject\n>;\n\n// UserWithRelations = User & { sessions: Session[]; accounts: Account[] }\n",[251,799,800,826,847,851,873,877,917,933,946,959,966,970,974],{"__ignoreMap":287},[291,801,802,804,806,808,811,814,816,818,820,822,824],{"class":293,"line":294},[291,803,298],{"class":297},[291,805,302],{"class":301},[291,807,306],{"class":305},[291,809,810],{"class":301},",",[291,812,813],{"class":305}," InferRelationalSelectModel",[291,815,309],{"class":301},[291,817,312],{"class":297},[291,819,315],{"class":301},[291,821,319],{"class":318},[291,823,322],{"class":301},[291,825,325],{"class":301},[291,827,828,830,832,835,837,839,841,843,845],{"class":293,"line":328},[291,829,298],{"class":297},[291,831,302],{"class":301},[291,833,834],{"class":305}," schema",[291,836,309],{"class":301},[291,838,312],{"class":297},[291,840,315],{"class":301},[291,842,344],{"class":318},[291,844,322],{"class":301},[291,846,325],{"class":301},[291,848,849],{"class":293,"line":351},[291,850,355],{"emptyLinePlaceholder":354},[291,852,853,855,857,859,861,863,865,867,869,871],{"class":293,"line":358},[291,854,368],{"class":297},[291,856,372],{"class":371},[291,858,376],{"class":375},[291,860,379],{"class":301},[291,862,306],{"class":375},[291,864,384],{"class":301},[291,866,834],{"class":305},[291,868,535],{"class":301},[291,870,515],{"class":305},[291,872,389],{"class":301},[291,874,875],{"class":293,"line":365},[291,876,355],{"emptyLinePlaceholder":354},[291,878,879,881,884,887,889,892,894,898,900,903,905,907,909,912,915],{"class":293,"line":392},[291,880,711],{"class":371},[291,882,883],{"class":305}," withRelationalObject ",[291,885,886],{"class":301},"=",[291,888,302],{"class":301},[291,890,891],{"class":541}," sessions",[291,893,518],{"class":301},[291,895,897],{"class":896},"sfNiH"," true",[291,899,810],{"class":301},[291,901,902],{"class":541}," accounts",[291,904,518],{"class":301},[291,906,897],{"class":896},[291,908,309],{"class":301},[291,910,911],{"class":297}," as",[291,913,914],{"class":371}," const",[291,916,325],{"class":301},[291,918,919,921,923,926,928,930],{"class":293,"line":397},[291,920,368],{"class":297},[291,922,372],{"class":371},[291,924,925],{"class":375}," UserWithRelations",[291,927,379],{"class":301},[291,929,813],{"class":375},[291,931,932],{"class":301},"\u003C\n",[291,934,935,938,940,942,944],{"class":293,"line":403},[291,936,937],{"class":301},"  typeof",[291,939,834],{"class":305},[291,941,535],{"class":301},[291,943,515],{"class":305},[291,945,739],{"class":301},[291,947,948,950,952,954,957],{"class":293,"line":409},[291,949,937],{"class":301},[291,951,834],{"class":305},[291,953,535],{"class":301},[291,955,956],{"class":305},"userRelations",[291,958,739],{"class":301},[291,960,961,963],{"class":293,"line":415},[291,962,937],{"class":301},[291,964,965],{"class":305}," withRelationalObject\n",[291,967,968],{"class":293,"line":421},[291,969,389],{"class":301},[291,971,972],{"class":293,"line":427},[291,973,355],{"emptyLinePlaceholder":354},[291,975,976],{"class":293,"line":433},[291,977,978],{"class":361},"// UserWithRelations = User & { sessions: Session[]; accounts: Account[] }\n",[247,980,981],{},"For nested includes, pass a map of table name → relations as the fourth parameter:",[282,983,985],{"className":284,"code":984,"language":286,"meta":287,"style":287},"const withNested = { sessions: { with: { user: true } } } as const;\ntype UserWithSessionsAndUser = InferRelationalSelectModel\u003C\n  typeof schema.user,\n  typeof schema.userRelations,\n  typeof withNested,\n  { user: typeof schema.userRelations; session: typeof schema.sessionRelations }\n>;\n",[251,986,987,1030,1043,1055,1067,1076,1113],{"__ignoreMap":287},[291,988,989,991,994,996,998,1000,1002,1004,1007,1009,1011,1014,1016,1018,1020,1022,1024,1026,1028],{"class":293,"line":294},[291,990,711],{"class":371},[291,992,993],{"class":305}," withNested ",[291,995,886],{"class":301},[291,997,302],{"class":301},[291,999,891],{"class":541},[291,1001,518],{"class":301},[291,1003,302],{"class":301},[291,1005,1006],{"class":541}," with",[291,1008,518],{"class":301},[291,1010,302],{"class":301},[291,1012,1013],{"class":541}," user",[291,1015,518],{"class":301},[291,1017,897],{"class":896},[291,1019,309],{"class":301},[291,1021,309],{"class":301},[291,1023,309],{"class":301},[291,1025,911],{"class":297},[291,1027,914],{"class":371},[291,1029,325],{"class":301},[291,1031,1032,1034,1037,1039,1041],{"class":293,"line":328},[291,1033,269],{"class":371},[291,1035,1036],{"class":375}," UserWithSessionsAndUser",[291,1038,379],{"class":301},[291,1040,813],{"class":375},[291,1042,932],{"class":301},[291,1044,1045,1047,1049,1051,1053],{"class":293,"line":351},[291,1046,937],{"class":301},[291,1048,834],{"class":305},[291,1050,535],{"class":301},[291,1052,515],{"class":305},[291,1054,739],{"class":301},[291,1056,1057,1059,1061,1063,1065],{"class":293,"line":358},[291,1058,937],{"class":301},[291,1060,834],{"class":305},[291,1062,535],{"class":301},[291,1064,956],{"class":305},[291,1066,739],{"class":301},[291,1068,1069,1071,1074],{"class":293,"line":365},[291,1070,937],{"class":301},[291,1072,1073],{"class":305}," withNested",[291,1075,739],{"class":301},[291,1077,1078,1081,1083,1085,1088,1090,1092,1094,1097,1100,1102,1104,1106,1108,1111],{"class":293,"line":392},[291,1079,1080],{"class":301},"  {",[291,1082,1013],{"class":541},[291,1084,518],{"class":301},[291,1086,1087],{"class":301}," typeof",[291,1089,834],{"class":305},[291,1091,535],{"class":301},[291,1093,956],{"class":305},[291,1095,1096],{"class":301},";",[291,1098,1099],{"class":541}," session",[291,1101,518],{"class":301},[291,1103,1087],{"class":301},[291,1105,834],{"class":305},[291,1107,535],{"class":301},[291,1109,1110],{"class":305},"sessionRelations ",[291,1112,442],{"class":301},[291,1114,1115],{"class":293,"line":397},[291,1116,389],{"class":301},[247,1118,1119],{},"By leveraging these inferred types, your IDE becomes a powerful partner, guiding you to write correct, type-safe database code and catching potential bugs before you even run your application.",[1121,1122,1123],"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 .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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":287,"searchDepth":328,"depth":328,"links":1125},[1126,1127,1128],{"id":274,"depth":328,"text":277},{"id":560,"depth":328,"text":563},{"id":784,"depth":328,"text":787},"Type Safety & Inference in Tauri SQLite ORM.","md",null,{},{"title":217,"description":1129},"0kglsjpwOATU_TYL9AD-OzTHcMStgHIGAU44AUDc_34",[1136,1138],{"title":213,"path":214,"stem":215,"description":1137,"children":-1},"Raw SQL in Tauri SQLite ORM.",{"title":221,"path":222,"stem":223,"description":1139,"children":-1},"Schema Management in Tauri SQLite ORM.",1773317304369]