[{"data":1,"prerenderedAt":678},["ShallowReactive",2],{"versions":3,"plugin-sqlspec":6,"readme-sqlspec":48},{"v3":4,"v4":5},"3.21.10","4.5.1",{"id":7,"title":8,"body":9,"category":10,"changelog":9,"compatibility":11,"created_at":13,"description":14,"documentation":15,"extension":16,"github":17,"icon":18,"issues":19,"key":20,"latest_version":21,"license":9,"maintainers":22,"meta":27,"monthly_downloads":28,"name":29,"navigation":30,"path":31,"pypi":20,"python_compatibility":32,"python_compatibility_raw":33,"repo":40,"seo":41,"sponsor":42,"stars":43,"stem":44,"type":45,"updated_at":46,"website":15,"__hash__":47},"plugins\u002Fplugins\u002Fsqlspec.yml","Sqlspec",null,"Database",{"litestar":12},">=2.22.0","2024-10-30T00:48:46","SQL Experiments in Python","https:\u002F\u002Fsqlspec.dev\u002F","yml","https:\u002F\u002Fgithub.com\u002Flitestar-org\u002Fsqlspec","_default_icon.svg","https:\u002F\u002Fgithub.com\u002Flitestar-org\u002Fsqlspec\u002Fissues\u002F","sqlspec","0.56.2",[23],{"name":24,"github":25,"avatar":26},"Cody Fincher","cofin","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F204685?v=4",{},21302,"SQLSpec",true,"\u002Fplugins\u002Fsqlspec",{"raw":33,"specifier_set":33,"compatible":34},"\u003C4.0,>=3.10",[35,36,37,38,39],"3.10","3.11","3.12","3.13","3.14","litestar-org\u002Fsqlspec",{"description":14},false,94,"plugins\u002Fsqlspec","official","2026-07-26T16:55:54","b6yj6rzpTZxSjxR5abuouset3GIGQZpII4bV2vEjjxQ",{"id":49,"extension":50,"meta":51,"stem":676,"__hash__":677},"readme\u002Freadmes\u002Fsqlspec.md","md",{"body":52},{"type":53,"value":54,"toc":667},"minimark",[55,101,110,170,175,201,485,494,498,560,564,605,609,618,622,644,648,657,660,663],[56,57,59,66],"div",{"align":58},"center",[60,61,62],"p",{},[63,64,65],"strong",{},"Type-safe SQL execution for Python, without an ORM.",[60,67,68,79,86,94],{},[69,70,74],"a",{"href":71,"rel":72},"https:\u002F\u002Fpypi.org\u002Fproject\u002Fsqlspec\u002F",[73],"nofollow",[75,76],"img",{"alt":77,"src":78},"PyPI","https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fsqlspec",[69,80,82],{"href":71,"rel":81},[73],[75,83],{"alt":84,"src":85},"Python","https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fsqlspec",[69,87,90],{"href":88,"rel":89},"https:\u002F\u002Fgithub.com\u002Flitestar-org\u002Fsqlspec\u002Fblob\u002Fmain\u002FLICENSE",[73],[75,91],{"alt":92,"src":93},"License","https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fl\u002Fsqlspec",[69,95,97],{"href":15,"rel":96},[73],[75,98],{"alt":99,"src":100},"Docs","https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-sqlspec.dev-blue",[60,102,103,104,109],{},"SQLSpec is a SQL execution layer for Python. You write the SQL -- as strings, through a builder API, or loaded from files. SQLSpec handles connections, parameter binding, and dialect translation. It maps results back to typed Python objects. It uses ",[69,105,108],{"href":106,"rel":107},"https:\u002F\u002Fgithub.com\u002Ftobymao\u002Fsqlglot",[73],"sqlglot"," under the hood. Queries are parsed, validated, and optimized before they hit the database.",[111,112,113,126],"table",{},[114,115,116],"thead",{},[117,118,119,123],"tr",{},[120,121,122],"th",{},"Area",[120,124,125],{},"Support",[127,128,129,140,150,160],"tbody",{},[117,130,131,137],{},[132,133,134],"td",{},[63,135,136],{},"One API",[132,138,139],{},"The same session and result APIs with sync or async drivers.",[117,141,142,147],{},[132,143,144],{},[63,145,146],{},"Databases",[132,148,149],{},"PostgreSQL, SQLite, DuckDB, MySQL, SQL Server, Oracle, CockroachDB, BigQuery, Spanner, and supported Arrow Database Connectivity backends such as Snowflake, Flight SQL, and GizmoSQL.",[117,151,152,157],{},[132,153,154],{},[63,155,156],{},"Data tools",[132,158,159],{},"Typed result mapping, Arrow export, built-in storage, and native bulk ingest where the adapter supports it.",[117,161,162,167],{},[132,163,164],{},[63,165,166],{},"Frameworks",[132,168,169],{},"Litestar, FastAPI, Flask, Sanic, and Starlette.",[171,172,174],"h2",{"id":173},"quick-start","Quick Start",[176,177,182],"pre",{"className":178,"code":179,"language":180,"meta":181,"style":181},"language-bash shiki shiki-themes material-theme-lighter material-theme-lighter material-theme-palenight","pip install sqlspec\n","bash","",[183,184,185],"code",{"__ignoreMap":181},[186,187,190,194,198],"span",{"class":188,"line":189},"line",1,[186,191,193],{"class":192},"s52Pk","pip",[186,195,197],{"class":196},"sGFVr"," install",[186,199,200],{"class":196}," sqlspec\n",[176,202,206],{"className":203,"code":204,"language":205,"meta":181,"style":181},"language-python shiki shiki-themes material-theme-lighter material-theme-lighter material-theme-palenight","from dataclasses import dataclass\n\nfrom sqlspec import SQLSpec\nfrom sqlspec.adapters.sqlite import SqliteConfig\n\n\n@dataclass\nclass Greeting:\n    message: str\n\n\nspec = SQLSpec()\ndb = spec.add_config(SqliteConfig(connection_config={\"database\": \":memory:\"}))\n\nwith spec.provide_session(db) as session:\n    greeting = session.select_one(\"SELECT 'Hello, SQLSpec!' AS message\", schema_type=Greeting)\n    print(greeting.message)  # Output: Hello, SQLSpec!\n","python",[183,207,208,224,230,243,268,273,278,288,301,313,318,323,338,390,395,424,462],{"__ignoreMap":181},[186,209,210,214,218,221],{"class":188,"line":189},[186,211,213],{"class":212},"s8R28","from",[186,215,217],{"class":216},"sZSNi"," dataclasses ",[186,219,220],{"class":212},"import",[186,222,223],{"class":216}," dataclass\n",[186,225,227],{"class":188,"line":226},2,[186,228,229],{"emptyLinePlaceholder":30},"\n",[186,231,233,235,238,240],{"class":188,"line":232},3,[186,234,213],{"class":212},[186,236,237],{"class":216}," sqlspec ",[186,239,220],{"class":212},[186,241,242],{"class":216}," SQLSpec\n",[186,244,246,248,251,255,258,260,263,265],{"class":188,"line":245},4,[186,247,213],{"class":212},[186,249,250],{"class":216}," sqlspec",[186,252,254],{"class":253},"sDfIl",".",[186,256,257],{"class":216},"adapters",[186,259,254],{"class":253},[186,261,262],{"class":216},"sqlite ",[186,264,220],{"class":212},[186,266,267],{"class":216}," SqliteConfig\n",[186,269,271],{"class":188,"line":270},5,[186,272,229],{"emptyLinePlaceholder":30},[186,274,276],{"class":188,"line":275},6,[186,277,229],{"emptyLinePlaceholder":30},[186,279,281,284],{"class":188,"line":280},7,[186,282,283],{"class":253},"@",[186,285,287],{"class":286},"s3cPz","dataclass\n",[186,289,291,295,298],{"class":188,"line":290},8,[186,292,294],{"class":293},"smZ93","class",[186,296,297],{"class":192}," Greeting",[186,299,300],{"class":253},":\n",[186,302,304,307,310],{"class":188,"line":303},9,[186,305,306],{"class":216},"    message",[186,308,309],{"class":253},":",[186,311,312],{"class":192}," str\n",[186,314,316],{"class":188,"line":315},10,[186,317,229],{"emptyLinePlaceholder":30},[186,319,321],{"class":188,"line":320},11,[186,322,229],{"emptyLinePlaceholder":30},[186,324,326,329,332,335],{"class":188,"line":325},12,[186,327,328],{"class":216},"spec ",[186,330,331],{"class":253},"=",[186,333,334],{"class":286}," SQLSpec",[186,336,337],{"class":253},"()\n",[186,339,341,344,346,349,351,354,357,360,362,366,369,372,375,377,379,382,385,387],{"class":188,"line":340},13,[186,342,343],{"class":216},"db ",[186,345,331],{"class":253},[186,347,348],{"class":216}," spec",[186,350,254],{"class":253},[186,352,353],{"class":286},"add_config",[186,355,356],{"class":253},"(",[186,358,359],{"class":286},"SqliteConfig",[186,361,356],{"class":253},[186,363,365],{"class":364},"s1nJG","connection_config",[186,367,368],{"class":253},"={",[186,370,371],{"class":253},"\"",[186,373,374],{"class":196},"database",[186,376,371],{"class":253},[186,378,309],{"class":253},[186,380,381],{"class":253}," \"",[186,383,384],{"class":196},":memory:",[186,386,371],{"class":253},[186,388,389],{"class":253},"}))\n",[186,391,393],{"class":188,"line":392},14,[186,394,229],{"emptyLinePlaceholder":30},[186,396,398,401,403,405,408,410,413,416,419,422],{"class":188,"line":397},15,[186,399,400],{"class":212},"with",[186,402,348],{"class":216},[186,404,254],{"class":253},[186,406,407],{"class":286},"provide_session",[186,409,356],{"class":253},[186,411,412],{"class":286},"db",[186,414,415],{"class":253},")",[186,417,418],{"class":212}," as",[186,420,421],{"class":216}," session",[186,423,300],{"class":253},[186,425,427,430,432,434,436,439,441,443,446,448,451,454,456,459],{"class":188,"line":426},16,[186,428,429],{"class":216},"    greeting ",[186,431,331],{"class":253},[186,433,421],{"class":216},[186,435,254],{"class":253},[186,437,438],{"class":286},"select_one",[186,440,356],{"class":253},[186,442,371],{"class":253},[186,444,445],{"class":196},"SELECT 'Hello, SQLSpec!' AS message",[186,447,371],{"class":253},[186,449,450],{"class":253},",",[186,452,453],{"class":364}," schema_type",[186,455,331],{"class":253},[186,457,458],{"class":286},"Greeting",[186,460,461],{"class":253},")\n",[186,463,465,468,470,473,475,479,481],{"class":188,"line":464},17,[186,466,467],{"class":286},"    print",[186,469,356],{"class":253},[186,471,472],{"class":286},"greeting",[186,474,254],{"class":253},[186,476,478],{"class":477},"sRlkE","message",[186,480,415],{"class":253},[186,482,484],{"class":483},"sWuyu","  # Output: Hello, SQLSpec!\n",[60,486,487,488,493],{},"Write SQL, define a schema, get typed objects back. The ",[69,489,492],{"href":490,"rel":491},"https:\u002F\u002Fsqlspec.dev\u002Fgetting_started\u002F",[73],"getting started guide"," covers adapter installation and the query builder.",[171,495,497],{"id":496},"features","Features",[499,500,501,508,518,524,530,536,542,548,554],"ul",{},[502,503,504,507],"li",{},[63,505,506],{},"Session lifecycle"," -- sync and async sessions with pooling where the adapter supports it",[502,509,510,513,514,517],{},[63,511,512],{},"Parameter binding and dialect translation"," -- powered by sqlglot, with a fluent query builder and ",[183,515,516],{},".sql"," file loader",[502,519,520,523],{},[63,521,522],{},"Result mapping"," -- map rows to Pydantic, msgspec, attrs, or dataclass models, or export to Arrow tables for pandas and Polars",[502,525,526,529],{},[63,527,528],{},"Storage layer"," -- read and write Arrow tables to local files, fsspec, or object stores",[502,531,532,535],{},[63,533,534],{},"Framework integrations"," -- Litestar plugin with DI, Starlette\u002FFastAPI\u002FSanic middleware, Flask extension",[502,537,538,541],{},[63,539,540],{},"Google ADK"," -- SQLSpec-backed session, event, memory, and artifact services",[502,543,544,547],{},[63,545,546],{},"Observability"," -- OpenTelemetry and Prometheus instrumentation, structured logging with correlation IDs",[502,549,550,553],{},[63,551,552],{},"Event channels"," -- LISTEN\u002FNOTIFY, Oracle AQ\u002FTxEventQ, and durable table-backed queues with polling fallback",[502,555,556,559],{},[63,557,558],{},"Migrations"," -- native schema migration CLI backed by SQLSpec's SQL file loader",[171,561,563],{"id":562},"documentation","Documentation",[499,565,566,573,581,589,597],{},[502,567,568,572],{},[69,569,571],{"href":490,"rel":570},[73],"Getting Started"," -- installation, adapter selection, first steps",[502,574,575,580],{},[69,576,579],{"href":577,"rel":578},"https:\u002F\u002Fsqlspec.dev\u002Fusage\u002F",[73],"Usage Guides"," -- adapters, configuration, SQL file loader, and more",[502,582,583,588],{},[69,584,587],{"href":585,"rel":586},"https:\u002F\u002Fsqlspec.dev\u002Fexamples\u002F",[73],"Examples Gallery"," -- working code for common patterns",[502,590,591,596],{},[69,592,595],{"href":593,"rel":594},"https:\u002F\u002Fsqlspec.dev\u002Freference\u002F",[73],"API Reference"," -- full API docs",[502,598,599,604],{},[69,600,603],{"href":601,"rel":602},"https:\u002F\u002Fsqlspec.dev\u002Fusage\u002Fcli.html",[73],"CLI Reference"," -- migration and management commands",[171,606,608],{"id":607},"playground","Playground",[60,610,611,612,617],{},"Want to try it without installing anything? The ",[69,613,616],{"href":614,"rel":615},"https:\u002F\u002Fsqlspec.dev\u002Fplayground",[73],"interactive playground"," runs SQLSpec in your browser with a sandboxed Python runtime.",[171,619,621],{"id":620},"reference-applications","Reference Applications",[499,623,624,634],{},[502,625,626,633],{},[63,627,628],{},[69,629,632],{"href":630,"rel":631},"https:\u002F\u002Fgithub.com\u002Fcofin\u002Fpostgres-vertexai-demo",[73],"PostgreSQL + Vertex AI Demo"," -- Vector search with pgvector and real-time chat using Litestar and Google ADK. Shows connection pooling, migrations, type-safe result mapping, vector embeddings, and response caching.",[502,635,636,643],{},[63,637,638],{},[69,639,642],{"href":640,"rel":641},"https:\u002F\u002Fgithub.com\u002Fcofin\u002Foracledb-vertexai-demo",[73],"Oracle + Vertex AI Demo"," -- Oracle 23ai vector search with semantic similarity using HNSW indexes. Demonstrates NumPy array conversion, large object handling, and real-time performance metrics.",[171,645,647],{"id":646},"contributing","Contributing",[60,649,650,651,656],{},"Contributions are welcome -- whether that's bug reports, new adapter ideas, or pull requests. Take a look at the ",[69,652,655],{"href":653,"rel":654},"https:\u002F\u002Fsqlspec.dev\u002Fcontributing\u002F",[73],"contributor guide"," to get started.",[171,658,92],{"id":659},"license",[60,661,662],{},"MIT",[664,665,666],"style",{},"html pre.shiki code .s52Pk, html code.shiki .s52Pk{--shiki-light:#E2931D;--shiki-default:#E2931D;--shiki-dark:#FFCB6B}html pre.shiki code .sGFVr, html code.shiki .sGFVr{--shiki-light:#91B859;--shiki-default:#91B859;--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 .s8R28, html code.shiki .s8R28{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#39ADB5;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sZSNi, html code.shiki .sZSNi{--shiki-light:#90A4AE;--shiki-default:#90A4AE;--shiki-dark:#BABED8}html pre.shiki code .sDfIl, html code.shiki .sDfIl{--shiki-light:#39ADB5;--shiki-default:#39ADB5;--shiki-dark:#89DDFF}html pre.shiki code .s3cPz, html code.shiki .s3cPz{--shiki-light:#6182B8;--shiki-default:#6182B8;--shiki-dark:#82AAFF}html pre.shiki code .smZ93, html code.shiki .smZ93{--shiki-light:#9C3EDA;--shiki-default:#9C3EDA;--shiki-dark:#C792EA}html pre.shiki code .s1nJG, html code.shiki .s1nJG{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#90A4AE;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sRlkE, html code.shiki .sRlkE{--shiki-light:#E53935;--shiki-default:#E53935;--shiki-dark:#F07178}html pre.shiki code .sWuyu, html code.shiki .sWuyu{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#90A4AE;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":181,"searchDepth":226,"depth":226,"links":668},[669,670,671,672,673,674,675],{"id":173,"depth":226,"text":174},{"id":496,"depth":226,"text":497},{"id":562,"depth":226,"text":563},{"id":607,"depth":226,"text":608},{"id":620,"depth":226,"text":621},{"id":646,"depth":226,"text":647},{"id":659,"depth":226,"text":92},"readmes\u002Fsqlspec","El9JBZQNDIVAAnnKu-M4K2LV12vGkILkN85JAyeOg7g",1785155664236]