[{"data":1,"prerenderedAt":1574},["ShallowReactive",2],{"navigation":3,"\u002Fadapters\u002Fpostgresql":123,"\u002Fadapters\u002Fpostgresql-surround":1569},[4,9,31,107,118],{"title":5,"path":6,"stem":7,"icon":8},"Getting started","\u002Fgetting-started","01.getting-started","i-tabler-rocket",{"title":10,"icon":11,"path":12,"stem":13,"children":14,"page":30},"Concepts","i-tabler-code","\u002Fconcepts","02.concepts",[15,20,25],{"title":16,"path":17,"stem":18,"icon":19},"Architecture","\u002Fconcepts\u002Farchitecture","02.concepts\u002Farchitecture","i-tabler-sitemap",{"title":21,"path":22,"stem":23,"icon":24},"Metadata and registry","\u002Fconcepts\u002Fmetadata-and-registry","02.concepts\u002Fmetadata-and-registry","i-tabler-schema",{"title":26,"path":27,"stem":28,"icon":29},"Query Engine","\u002Fconcepts\u002Fquery-engine","02.concepts\u002Fquery-engine","i-tabler-engine",false,{"title":32,"icon":33,"path":34,"stem":35,"children":36,"page":30},"Guide","i-tabler-arrow-ramp-right","\u002Fguides","03.guides",[37,42,47,52,57,62,67,72,77,82,87,92,97,102],{"title":38,"path":39,"stem":40,"icon":41},"Aggregate queries","\u002Fguides\u002Faggregate-queries","03.guides\u002Faggregate-queries","i-tabler-chart-histogram",{"title":43,"path":44,"stem":45,"icon":46},"Audit Log","\u002Fguides\u002Faudit-log","03.guides\u002Faudit-log","i-tabler-history",{"title":48,"path":49,"stem":50,"icon":51},"Cursor pagination","\u002Fguides\u002Fcursor-pagination","03.guides\u002Fcursor-pagination","i-tabler-arrow-bar-to-down",{"title":53,"path":54,"stem":55,"icon":56},"Domain Events","\u002Fguides\u002Fdomain-events","03.guides\u002Fdomain-events","i-tabler-broadcast",{"title":58,"path":59,"stem":60,"icon":61},"Field transforms","\u002Fguides\u002Ffield-transforms","03.guides\u002Ffield-transforms","i-tabler-transform",{"title":63,"path":64,"stem":65,"icon":66},"Field visibility","\u002Fguides\u002Ffield-visibility","03.guides\u002Ffield-visibility","i-tabler-eye-off",{"title":68,"path":69,"stem":70,"icon":71},"Lifecycle hooks","\u002Fguides\u002Flifecycle-hooks","03.guides\u002Flifecycle-hooks","i-tabler-arrows-split",{"title":73,"path":74,"stem":75,"icon":76},"Migrations","\u002Fguides\u002Fmigrations","03.guides\u002Fmigrations","i-tabler-database-export",{"title":78,"path":79,"stem":80,"icon":81},"Optimistic locking","\u002Fguides\u002Foptimistic-locking","03.guides\u002Foptimistic-locking","i-tabler-lock-check",{"title":83,"path":84,"stem":85,"icon":86},"Production playground","\u002Fguides\u002Fplayground","03.guides\u002Fplayground","i-tabler-flask",{"title":88,"path":89,"stem":90,"icon":91},"Queries and filters","\u002Fguides\u002Fqueries-and-filters","03.guides\u002Fqueries-and-filters","i-tabler-filter",{"title":93,"path":94,"stem":95,"icon":96},"Relations","\u002Fguides\u002Frelations","03.guides\u002Frelations","i-tabler-link",{"title":98,"path":99,"stem":100,"icon":101},"Schema consistency","\u002Fguides\u002Fschema-consistency","03.guides\u002Fschema-consistency","i-tabler-database-search",{"title":103,"path":104,"stem":105,"icon":106},"Validation","\u002Fguides\u002Fvalidation","03.guides\u002Fvalidation","i-tabler-checkup-list",{"title":108,"icon":109,"path":110,"stem":111,"children":112,"page":30},"Adapters","i-tabler-plug","\u002Fadapters","04.adapters",[113],{"title":114,"path":115,"stem":116,"icon":117},"PostgreSQL adapter","\u002Fadapters\u002Fpostgresql","04.adapters\u002Fpostgresql","i-simple-icons-postgresql",{"title":119,"path":120,"stem":121,"icon":122},"Current limitations","\u002Fcurrent-limitations","05.current-limitations","i-tabler-circle-dashed-x",{"id":124,"title":114,"body":125,"description":1562,"extension":1563,"links":1564,"meta":1565,"navigation":1566,"path":115,"seo":1567,"stem":116,"__hash__":1568},"docs\u002F04.adapters\u002Fpostgresql.md",{"type":126,"value":127,"toc":1549},"minimark",[128,140,145,213,216,220,286,289,299,302,307,360,367,370,417,421,477,491,507,511,670,673,677,684,744,1121,1125,1128,1155,1158,1162,1302,1305,1309,1334,1343,1390,1394,1523,1534,1538,1545],[129,130,131,135,136,139],"p",{},[132,133,134],"code",{},"PostgreAdapter"," implements ",[132,137,138],{},"DatabaseAdapter"," for Drizzle's asynchronous PostgreSQL database.",[141,142,144],"h2",{"id":143},"create-an-adapter","Create an adapter",[146,147,152],"pre",{"className":148,"code":149,"language":150,"meta":151,"style":151},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createPostgreAdapter } from '@opensya\u002Fpersistence'\n\nconst adapter = createPostgreAdapter(db)\n","ts","",[132,153,154,187,194],{"__ignoreMap":151},[155,156,159,163,167,171,174,177,180,184],"span",{"class":157,"line":158},"line",1,[155,160,162],{"class":161},"s7zQu","import",[155,164,166],{"class":165},"sMK4o"," {",[155,168,170],{"class":169},"sTEyZ"," createPostgreAdapter",[155,172,173],{"class":165}," }",[155,175,176],{"class":161}," from",[155,178,179],{"class":165}," '",[155,181,183],{"class":182},"sfazB","@opensya\u002Fpersistence",[155,185,186],{"class":165},"'\n",[155,188,190],{"class":157,"line":189},2,[155,191,193],{"emptyLinePlaceholder":192},true,"\n",[155,195,197,201,204,207,210],{"class":157,"line":196},3,[155,198,200],{"class":199},"spNyl","const",[155,202,203],{"class":169}," adapter ",[155,205,206],{"class":165},"=",[155,208,170],{"class":209},"s2Zo4",[155,211,212],{"class":169},"(db)\n",[129,214,215],{},"The database must support Drizzle's select, insert, update, delete, execute, and transaction APIs.",[141,217,219],{"id":218},"schema-creation","Schema creation",[146,221,223],{"className":148,"code":222,"language":150,"meta":151,"style":151},"const engine = createQueryEngine({ registry, adapter })\nconst result = await engine.schema.createTables()\n",[132,224,225,257],{"__ignoreMap":151},[155,226,227,229,232,234,237,240,243,246,249,251,254],{"class":157,"line":158},[155,228,200],{"class":199},[155,230,231],{"class":169}," engine ",[155,233,206],{"class":165},[155,235,236],{"class":209}," createQueryEngine",[155,238,239],{"class":169},"(",[155,241,242],{"class":165},"{",[155,244,245],{"class":169}," registry",[155,247,248],{"class":165},",",[155,250,203],{"class":169},[155,252,253],{"class":165},"}",[155,255,256],{"class":169},")\n",[155,258,259,261,264,266,269,272,275,278,280,283],{"class":157,"line":189},[155,260,200],{"class":199},[155,262,263],{"class":169}," result ",[155,265,206],{"class":165},[155,267,268],{"class":161}," await",[155,270,271],{"class":169}," engine",[155,273,274],{"class":165},".",[155,276,277],{"class":169},"schema",[155,279,274],{"class":165},[155,281,282],{"class":209},"createTables",[155,284,285],{"class":169},"()\n",[129,287,288],{},"The adapter creates missing tables, static database defaults, primary keys,\nsingle-column unique constraints, declared indexes and owning-side foreign keys\ninside a PostgreSQL transaction. Function defaults remain runtime defaults and\nare not converted into frozen database values.",[129,290,291,292,295,296,298],{},"Tables are created with ",[132,293,294],{},"IF NOT EXISTS",", indexes with ",[132,297,294],{},", and\nexisting foreign keys are detected before creation. Running the operation more\nthan once is safe and existing data is not modified.",[141,300,73],{"id":301},"migrations",[129,303,304,306],{},[132,305,134],{}," renders logical migration operations as PostgreSQL DDL and\nexecutes pending migrations inside a transaction.",[146,308,310],{"className":148,"code":309,"language":150,"meta":151,"style":151},"const plan = await engine.migrations.plan(migrations)\nconst result = await engine.migrations.apply(migrations)\n",[132,311,312,337],{"__ignoreMap":151},[155,313,314,316,319,321,323,325,327,329,331,334],{"class":157,"line":158},[155,315,200],{"class":199},[155,317,318],{"class":169}," plan ",[155,320,206],{"class":165},[155,322,268],{"class":161},[155,324,271],{"class":169},[155,326,274],{"class":165},[155,328,301],{"class":169},[155,330,274],{"class":165},[155,332,333],{"class":209},"plan",[155,335,336],{"class":169},"(migrations)\n",[155,338,339,341,343,345,347,349,351,353,355,358],{"class":157,"line":189},[155,340,200],{"class":199},[155,342,263],{"class":169},[155,344,206],{"class":165},[155,346,268],{"class":161},[155,348,271],{"class":169},[155,350,274],{"class":165},[155,352,301],{"class":169},[155,354,274],{"class":165},[155,356,357],{"class":209},"apply",[155,359,336],{"class":169},[129,361,362,363,366],{},"Applied migrations are stored in ",[132,364,365],{},"_opensya_migrations",". A PostgreSQL advisory\nlock prevents concurrent deployment processes from applying the same migration.\nChecksums protect applied artifacts from later modification.",[129,368,369],{},"Destructive and irreversible plans require explicit approval:",[146,371,373],{"className":148,"code":372,"language":150,"meta":151,"style":151},"await engine.migrations.apply(migrations, {\n  allowDestructive: true\n})\n",[132,374,375,398,411],{"__ignoreMap":151},[155,376,377,380,382,384,386,388,390,393,395],{"class":157,"line":158},[155,378,379],{"class":161},"await",[155,381,271],{"class":169},[155,383,274],{"class":165},[155,385,301],{"class":169},[155,387,274],{"class":165},[155,389,357],{"class":209},[155,391,392],{"class":169},"(migrations",[155,394,248],{"class":165},[155,396,397],{"class":165}," {\n",[155,399,400,404,407],{"class":157,"line":189},[155,401,403],{"class":402},"swJcz","  allowDestructive",[155,405,406],{"class":165},":",[155,408,410],{"class":409},"sfNiH"," true\n",[155,412,413,415],{"class":157,"line":196},[155,414,253],{"class":165},[155,416,256],{"class":169},[141,418,420],{"id":419},"runtime-tables","Runtime tables",[146,422,424],{"className":148,"code":423,"language":150,"meta":151,"style":151},"for (const metadata of registry.getAll()) {\n  adapter.buildTable(metadata)\n}\n",[132,425,426,455,472],{"__ignoreMap":151},[155,427,428,431,434,436,439,442,444,446,449,452],{"class":157,"line":158},[155,429,430],{"class":161},"for",[155,432,433],{"class":169}," (",[155,435,200],{"class":199},[155,437,438],{"class":169}," metadata ",[155,440,441],{"class":165},"of",[155,443,245],{"class":169},[155,445,274],{"class":165},[155,447,448],{"class":209},"getAll",[155,450,451],{"class":169},"()) ",[155,453,454],{"class":165},"{\n",[155,456,457,460,462,465,467,470],{"class":157,"line":189},[155,458,459],{"class":169},"  adapter",[155,461,274],{"class":165},[155,463,464],{"class":209},"buildTable",[155,466,239],{"class":402},[155,468,469],{"class":169},"metadata",[155,471,256],{"class":402},[155,473,474],{"class":157,"line":196},[155,475,476],{"class":165},"}\n",[129,478,479,482,483,486,487,490],{},[132,480,481],{},"buildTable()"," converts each ",[132,484,485],{},"TableMetadata"," into a Drizzle ",[132,488,489],{},"pgTable"," and indexes it by the logical metadata name.",[492,493,497],"callout",{"color":494,"icon":495,"variant":496},"warning","i-tabler-alert-triangle","subtle",[129,498,499,500,503,504,506],{},"Query operations fail when the logical table has not been built. Calling\n",[132,501,502],{},"engine.schema.createTables()"," builds every registered runtime table\nautomatically. Applications that manage DDL separately can continue calling\n",[132,505,481],{}," directly.",[141,508,510],{"id":509},"column-mapping","Column mapping",[512,513,514,530],"table",{},[515,516,517],"thead",{},[518,519,520,524,527],"tr",{},[521,522,523],"th",{},"Metadata",[521,525,526],{},"PostgreSQL builder",[521,528,529],{},"Runtime validation",[531,532,533,548,561,573,587,601,614,628,641,655],"tbody",{},[518,534,535,541,545],{},[536,537,538],"td",{},[132,539,540],{},"uuid",[536,542,543],{},[132,544,540],{},[536,546,547],{},"string",[518,549,550,554,559],{},[536,551,552],{},[132,553,547],{},[536,555,556],{},[132,557,558],{},"text",[536,560,547],{},[518,562,563,567,571],{},[536,564,565],{},[132,566,558],{},[536,568,569],{},[132,570,558],{},[536,572,547],{},[518,574,575,580,584],{},[536,576,577],{},[132,578,579],{},"integer",[536,581,582],{},[132,583,579],{},[536,585,586],{},"integer number",[518,588,589,594,599],{},[536,590,591],{},[132,592,593],{},"bigint",[536,595,596],{},[132,597,598],{},"bigint({ mode: 'bigint' })",[536,600,593],{},[518,602,603,608,612],{},[536,604,605],{},[132,606,607],{},"boolean",[536,609,610],{},[132,611,607],{},[536,613,607],{},[518,615,616,621,625],{},[536,617,618],{},[132,619,620],{},"timestamp",[536,622,623],{},[132,624,620],{},[536,626,627],{},"Date",[518,629,630,635,639],{},[536,631,632],{},[132,633,634],{},"date",[536,636,637],{},[132,638,634],{},[536,640,547],{},[518,642,643,648,652],{},[536,644,645],{},[132,646,647],{},"json",[536,649,650],{},[132,651,647],{},[536,653,654],{},"any value",[518,656,657,662,667],{},[536,658,659],{},[132,660,661],{},"decimal",[536,663,664],{},[132,665,666],{},"numeric",[536,668,669],{},"string or number",[129,671,672],{},"The adapter maps primary keys, nullability, uniqueness, and static or factory defaults to the corresponding Drizzle builder methods.",[141,674,676],{"id":675},"query-translation","Query translation",[129,678,679,680,683],{},"The adapter compiles ",[132,681,682],{},"QueryFilter"," recursively:",[685,686,687,695,705,714,720],"ul",{},[688,689,690,691,694],"li",{},"conditions at the same level are joined with ",[132,692,693],{},"AND",";",[688,696,697,698,701,702,694],{},"nested ",[132,699,700],{},"and"," groups use Drizzle ",[132,703,704],{},"and()",[688,706,697,707,710,711,694],{},[132,708,709],{},"or"," groups use ",[132,712,713],{},"or()",[688,715,716,719],{},[132,717,718],{},"not"," wraps the compiled nested expression;",[688,721,722,723,726,727,726,730,726,733,736,737,740,741,274],{},"operators map to ",[132,724,725],{},"eq",", ",[132,728,729],{},"ne",[132,731,732],{},"inArray",[132,734,735],{},"notInArray",", comparisons, ",[132,738,739],{},"isNull",", and ",[132,742,743],{},"isNotNull",[146,745,747],{"className":148,"code":746,"language":150,"meta":151,"style":151},"await adapter.findMany('users', {\n  where: {\n    and: [\n      {\n        conditions: [\n          { field: 'active', operator: 'eq', value: true }\n        ]\n      },\n      {\n        or: [\n          {\n            conditions: [\n              { field: 'role', operator: 'eq', value: 'admin' }\n            ]\n          },\n          {\n            conditions: [\n              { field: 'role', operator: 'eq', value: 'owner' }\n            ]\n          }\n        ]\n      }\n    ]\n  },\n  orderBy: [{ field: 'createdAt', direction: 'desc' }],\n  limit: 20,\n  offset: 0\n})\n",[132,748,749,775,784,794,800,810,854,860,866,871,881,887,897,941,947,953,958,967,1009,1014,1020,1025,1031,1037,1043,1089,1103,1114],{"__ignoreMap":151},[155,750,751,753,756,758,761,763,766,769,771,773],{"class":157,"line":158},[155,752,379],{"class":161},[155,754,755],{"class":169}," adapter",[155,757,274],{"class":165},[155,759,760],{"class":209},"findMany",[155,762,239],{"class":169},[155,764,765],{"class":165},"'",[155,767,768],{"class":182},"users",[155,770,765],{"class":165},[155,772,248],{"class":165},[155,774,397],{"class":165},[155,776,777,780,782],{"class":157,"line":189},[155,778,779],{"class":402},"  where",[155,781,406],{"class":165},[155,783,397],{"class":165},[155,785,786,789,791],{"class":157,"line":196},[155,787,788],{"class":402},"    and",[155,790,406],{"class":165},[155,792,793],{"class":169}," [\n",[155,795,797],{"class":157,"line":796},4,[155,798,799],{"class":165},"      {\n",[155,801,803,806,808],{"class":157,"line":802},5,[155,804,805],{"class":402},"        conditions",[155,807,406],{"class":165},[155,809,793],{"class":169},[155,811,813,816,819,821,823,826,828,830,833,835,837,839,841,843,846,848,851],{"class":157,"line":812},6,[155,814,815],{"class":165},"          {",[155,817,818],{"class":402}," field",[155,820,406],{"class":165},[155,822,179],{"class":165},[155,824,825],{"class":182},"active",[155,827,765],{"class":165},[155,829,248],{"class":165},[155,831,832],{"class":402}," operator",[155,834,406],{"class":165},[155,836,179],{"class":165},[155,838,725],{"class":182},[155,840,765],{"class":165},[155,842,248],{"class":165},[155,844,845],{"class":402}," value",[155,847,406],{"class":165},[155,849,850],{"class":409}," true",[155,852,853],{"class":165}," }\n",[155,855,857],{"class":157,"line":856},7,[155,858,859],{"class":169},"        ]\n",[155,861,863],{"class":157,"line":862},8,[155,864,865],{"class":165},"      },\n",[155,867,869],{"class":157,"line":868},9,[155,870,799],{"class":165},[155,872,874,877,879],{"class":157,"line":873},10,[155,875,876],{"class":402},"        or",[155,878,406],{"class":165},[155,880,793],{"class":169},[155,882,884],{"class":157,"line":883},11,[155,885,886],{"class":165},"          {\n",[155,888,890,893,895],{"class":157,"line":889},12,[155,891,892],{"class":402},"            conditions",[155,894,406],{"class":165},[155,896,793],{"class":169},[155,898,900,903,905,907,909,912,914,916,918,920,922,924,926,928,930,932,934,937,939],{"class":157,"line":899},13,[155,901,902],{"class":165},"              {",[155,904,818],{"class":402},[155,906,406],{"class":165},[155,908,179],{"class":165},[155,910,911],{"class":182},"role",[155,913,765],{"class":165},[155,915,248],{"class":165},[155,917,832],{"class":402},[155,919,406],{"class":165},[155,921,179],{"class":165},[155,923,725],{"class":182},[155,925,765],{"class":165},[155,927,248],{"class":165},[155,929,845],{"class":402},[155,931,406],{"class":165},[155,933,179],{"class":165},[155,935,936],{"class":182},"admin",[155,938,765],{"class":165},[155,940,853],{"class":165},[155,942,944],{"class":157,"line":943},14,[155,945,946],{"class":169},"            ]\n",[155,948,950],{"class":157,"line":949},15,[155,951,952],{"class":165},"          },\n",[155,954,956],{"class":157,"line":955},16,[155,957,886],{"class":165},[155,959,961,963,965],{"class":157,"line":960},17,[155,962,892],{"class":402},[155,964,406],{"class":165},[155,966,793],{"class":169},[155,968,970,972,974,976,978,980,982,984,986,988,990,992,994,996,998,1000,1002,1005,1007],{"class":157,"line":969},18,[155,971,902],{"class":165},[155,973,818],{"class":402},[155,975,406],{"class":165},[155,977,179],{"class":165},[155,979,911],{"class":182},[155,981,765],{"class":165},[155,983,248],{"class":165},[155,985,832],{"class":402},[155,987,406],{"class":165},[155,989,179],{"class":165},[155,991,725],{"class":182},[155,993,765],{"class":165},[155,995,248],{"class":165},[155,997,845],{"class":402},[155,999,406],{"class":165},[155,1001,179],{"class":165},[155,1003,1004],{"class":182},"owner",[155,1006,765],{"class":165},[155,1008,853],{"class":165},[155,1010,1012],{"class":157,"line":1011},19,[155,1013,946],{"class":169},[155,1015,1017],{"class":157,"line":1016},20,[155,1018,1019],{"class":165},"          }\n",[155,1021,1023],{"class":157,"line":1022},21,[155,1024,859],{"class":169},[155,1026,1028],{"class":157,"line":1027},22,[155,1029,1030],{"class":165},"      }\n",[155,1032,1034],{"class":157,"line":1033},23,[155,1035,1036],{"class":169},"    ]\n",[155,1038,1040],{"class":157,"line":1039},24,[155,1041,1042],{"class":165},"  },\n",[155,1044,1046,1049,1051,1054,1056,1058,1060,1062,1065,1067,1069,1072,1074,1076,1079,1081,1083,1086],{"class":157,"line":1045},25,[155,1047,1048],{"class":402},"  orderBy",[155,1050,406],{"class":165},[155,1052,1053],{"class":169}," [",[155,1055,242],{"class":165},[155,1057,818],{"class":402},[155,1059,406],{"class":165},[155,1061,179],{"class":165},[155,1063,1064],{"class":182},"createdAt",[155,1066,765],{"class":165},[155,1068,248],{"class":165},[155,1070,1071],{"class":402}," direction",[155,1073,406],{"class":165},[155,1075,179],{"class":165},[155,1077,1078],{"class":182},"desc",[155,1080,765],{"class":165},[155,1082,173],{"class":165},[155,1084,1085],{"class":169},"]",[155,1087,1088],{"class":165},",\n",[155,1090,1092,1095,1097,1101],{"class":157,"line":1091},26,[155,1093,1094],{"class":402},"  limit",[155,1096,406],{"class":165},[155,1098,1100],{"class":1099},"sbssI"," 20",[155,1102,1088],{"class":165},[155,1104,1106,1109,1111],{"class":157,"line":1105},27,[155,1107,1108],{"class":402},"  offset",[155,1110,406],{"class":165},[155,1112,1113],{"class":1099}," 0\n",[155,1115,1117,1119],{"class":157,"line":1116},28,[155,1118,253],{"class":165},[155,1120,256],{"class":169},[141,1122,1124],{"id":1123},"adapter-level-guards","Adapter-level guards",[129,1126,1127],{},"Before executing SQL, the adapter verifies:",[685,1129,1130,1133,1143,1152],{},[688,1131,1132],{},"filter, sort, insert, and update fields exist on the built table;",[688,1134,1135,1138,1139,1142],{},[132,1136,1137],{},"limit"," and ",[132,1140,1141],{},"offset"," are not negative;",[688,1144,1145,1138,1148,1151],{},[132,1146,1147],{},"in",[132,1149,1150],{},"notIn"," receive non-empty arrays;",[688,1153,1154],{},"update and delete filters contain at least one effective constraint.",[129,1156,1157],{},"These checks also apply when the adapter is used directly. Direct calls do not, however, run Query Engine validators or lifecycle hooks.",[141,1159,1161],{"id":1160},"transactions","Transactions",[146,1163,1165],{"className":148,"code":1164,"language":150,"meta":151,"style":151},"await adapter.transaction(async tx => {\n  const user = await tx.insert('users', input)\n\n  await tx.insert('profiles', {\n    id: crypto.randomUUID(),\n    userId: user.id\n  })\n})\n",[132,1166,1167,1192,1227,1231,1255,1275,1289,1296],{"__ignoreMap":151},[155,1168,1169,1171,1173,1175,1178,1180,1183,1187,1190],{"class":157,"line":158},[155,1170,379],{"class":161},[155,1172,755],{"class":169},[155,1174,274],{"class":165},[155,1176,1177],{"class":209},"transaction",[155,1179,239],{"class":169},[155,1181,1182],{"class":199},"async",[155,1184,1186],{"class":1185},"sHdIc"," tx",[155,1188,1189],{"class":199}," =>",[155,1191,397],{"class":165},[155,1193,1194,1197,1200,1203,1205,1207,1209,1212,1214,1216,1218,1220,1222,1225],{"class":157,"line":189},[155,1195,1196],{"class":199},"  const",[155,1198,1199],{"class":169}," user",[155,1201,1202],{"class":165}," =",[155,1204,268],{"class":161},[155,1206,1186],{"class":169},[155,1208,274],{"class":165},[155,1210,1211],{"class":209},"insert",[155,1213,239],{"class":402},[155,1215,765],{"class":165},[155,1217,768],{"class":182},[155,1219,765],{"class":165},[155,1221,248],{"class":165},[155,1223,1224],{"class":169}," input",[155,1226,256],{"class":402},[155,1228,1229],{"class":157,"line":196},[155,1230,193],{"emptyLinePlaceholder":192},[155,1232,1233,1236,1238,1240,1242,1244,1246,1249,1251,1253],{"class":157,"line":796},[155,1234,1235],{"class":161},"  await",[155,1237,1186],{"class":169},[155,1239,274],{"class":165},[155,1241,1211],{"class":209},[155,1243,239],{"class":402},[155,1245,765],{"class":165},[155,1247,1248],{"class":182},"profiles",[155,1250,765],{"class":165},[155,1252,248],{"class":165},[155,1254,397],{"class":165},[155,1256,1257,1260,1262,1265,1267,1270,1273],{"class":157,"line":802},[155,1258,1259],{"class":402},"    id",[155,1261,406],{"class":165},[155,1263,1264],{"class":169}," crypto",[155,1266,274],{"class":165},[155,1268,1269],{"class":209},"randomUUID",[155,1271,1272],{"class":402},"()",[155,1274,1088],{"class":165},[155,1276,1277,1280,1282,1284,1286],{"class":157,"line":812},[155,1278,1279],{"class":402},"    userId",[155,1281,406],{"class":165},[155,1283,1199],{"class":169},[155,1285,274],{"class":165},[155,1287,1288],{"class":169},"id\n",[155,1290,1291,1294],{"class":157,"line":856},[155,1292,1293],{"class":165},"  }",[155,1295,256],{"class":402},[155,1297,1298,1300],{"class":157,"line":862},[155,1299,253],{"class":165},[155,1301,256],{"class":169},[129,1303,1304],{},"The callback receives a new adapter bound to the Drizzle transaction while sharing the previously built table map.",[141,1306,1308],{"id":1307},"postgresql-introspection","PostgreSQL introspection",[146,1310,1312],{"className":148,"code":1311,"language":150,"meta":151,"style":151},"const actualSchema = await adapter.introspect()\n",[132,1313,1314],{"__ignoreMap":151},[155,1315,1316,1318,1321,1323,1325,1327,1329,1332],{"class":157,"line":158},[155,1317,200],{"class":199},[155,1319,1320],{"class":169}," actualSchema ",[155,1322,206],{"class":165},[155,1324,268],{"class":161},[155,1326,755],{"class":169},[155,1328,274],{"class":165},[155,1330,1331],{"class":209},"introspect",[155,1333,285],{"class":169},[129,1335,1336,1337,1340,1341,274],{},"The adapter queries ",[132,1338,1339],{},"information_schema"," directly. Introspection does not depend on the tables previously passed to ",[132,1342,481],{},[1344,1345,1347,1352,1362,1366,1372,1376,1379,1383],"steps",{"level":1346},"3",[1348,1349,1351],"h3",{"id":1350},"discover-tables","Discover tables",[129,1353,1354,1355,1358,1359,274],{},"Reads base tables from ",[132,1356,1357],{},"information_schema.tables"," where ",[132,1360,1361],{},"table_schema = 'public'",[1348,1363,1365],{"id":1364},"discover-columns","Discover columns",[129,1367,1368,1369,274],{},"Reads column name, SQL data type, nullability, and ordinal position from ",[132,1370,1371],{},"information_schema.columns",[1348,1373,1375],{"id":1374},"discover-keys-and-indexes","Discover keys and indexes",[129,1377,1378],{},"Reads primary keys, unique indexes and standalone indexes from PostgreSQL\ncatalogs, preserving composite field order and uniqueness.",[1348,1380,1382],{"id":1381},"produce-metadata","Produce metadata",[129,1384,1385,1386,1389],{},"Returns ",[132,1387,1388],{},"TableMetadata[]"," with physical names used as both logical and collection names.",[141,1391,1393],{"id":1392},"introspected-sql-types","Introspected SQL types",[512,1395,1396,1409],{},[515,1397,1398],{},[518,1399,1400,1406],{},[521,1401,1402,1403],{},"PostgreSQL ",[132,1404,1405],{},"data_type",[521,1407,1408],{},"Metadata type",[531,1410,1411,1421,1432,1442,1452,1462,1472,1481,1491,1504,1514],{},[518,1412,1413,1417],{},[536,1414,1415],{},[132,1416,540],{},[536,1418,1419],{},[132,1420,540],{},[518,1422,1423,1428],{},[536,1424,1425],{},[132,1426,1427],{},"character varying",[536,1429,1430],{},[132,1431,547],{},[518,1433,1434,1438],{},[536,1435,1436],{},[132,1437,558],{},[536,1439,1440],{},[132,1441,558],{},[518,1443,1444,1448],{},[536,1445,1446],{},[132,1447,579],{},[536,1449,1450],{},[132,1451,579],{},[518,1453,1454,1458],{},[536,1455,1456],{},[132,1457,593],{},[536,1459,1460],{},[132,1461,593],{},[518,1463,1464,1468],{},[536,1465,1466],{},[132,1467,607],{},[536,1469,1470],{},[132,1471,607],{},[518,1473,1474,1477],{},[536,1475,1476],{},"timestamp with or without time zone",[536,1478,1479],{},[132,1480,620],{},[518,1482,1483,1487],{},[536,1484,1485],{},[132,1486,634],{},[536,1488,1489],{},[132,1490,634],{},[518,1492,1493,1500],{},[536,1494,1495,726,1497],{},[132,1496,647],{},[132,1498,1499],{},"jsonb",[536,1501,1502],{},[132,1503,647],{},[518,1505,1506,1510],{},[536,1507,1508],{},[132,1509,666],{},[536,1511,1512],{},[132,1513,661],{},[518,1515,1516,1519],{},[536,1517,1518],{},"any unrecognized type",[536,1520,1521],{},[132,1522,558],{},[492,1524,1528],{"color":1525,"icon":1526,"variant":496,"title":1527},"info","i-tabler-info-circle","Introspection boundaries",[129,1529,1530,1531,1533],{},"Foreign keys and relations are returned as empty arrays. Defaults, check\nconstraints and custom validators are not introspected. Unknown SQL types\ndeliberately fall back to ",[132,1532,558],{}," so consistency checking reports drift instead\nof crashing.",[141,1535,1537],{"id":1536},"when-to-use-the-adapter-directly","When to use the adapter directly",[129,1539,1540,1541,1544],{},"Use ",[132,1542,1543],{},"QueryEngine"," for domain operations. Use the adapter directly for infrastructure code that intentionally needs lower-level access, such as schema inspection or transaction-scoped operations inside hooks.",[1546,1547,1548],"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 .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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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}",{"title":151,"searchDepth":158,"depth":189,"links":1550},[1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561],{"id":143,"depth":189,"text":144},{"id":218,"depth":189,"text":219},{"id":301,"depth":189,"text":73},{"id":419,"depth":189,"text":420},{"id":509,"depth":189,"text":510},{"id":675,"depth":189,"text":676},{"id":1123,"depth":189,"text":1124},{"id":1160,"depth":189,"text":1161},{"id":1307,"depth":189,"text":1308},{"id":1392,"depth":189,"text":1393},{"id":1536,"depth":189,"text":1537},"PostgreSQL query execution, schema creation, transactions, and introspection.","md",null,{},{"icon":117},{"title":114,"description":1562},"gg1Uu4fvohI9La-kFylUx2KEu95n9p9-iV2SuMq9Hqo",[1570,1572],{"title":103,"path":104,"stem":105,"description":1571,"icon":106,"children":-1},"Validate structure and domain rules before data reaches the adapter.",{"title":119,"path":120,"stem":121,"description":1573,"icon":122,"children":-1},"The current technical boundaries of OpenSya Persistence.",1783964087188]