mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
1 line
6.0 KiB
JSON
1 line
6.0 KiB
JSON
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"detached"},{"kind":"text","text":": "},{"kind":"typeIdentifier","identifier":"doc:\/\/GRDB\/documentation\/GRDB\/SQLExpression","preciseIdentifier":"s:4GRDB13SQLExpressionV","text":"SQLExpression"},{"kind":"text","text":" { "},{"kind":"keyword","text":"get"},{"kind":"text","text":" }"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"discussion","level":2,"type":"heading","text":"Discussion"},{"type":"paragraph","inlineContent":[{"type":"text","text":"Once detached, a column is never qualified with any table name in the"},{"type":"text","text":" "},{"type":"text","text":"SQL generated by the query interface."}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"For example, see how "},{"type":"codeVoice","code":"Column(\"total\").detached"},{"type":"text","text":" makes it possible to"},{"type":"text","text":" "},{"type":"text","text":"sort this query, when a raw "},{"type":"codeVoice","code":"Column(\"total\")"},{"type":"text","text":" could not:"}]},{"type":"codeListing","syntax":"swift","code":["\/\/ SELECT player.*,","\/\/ (player.score + player.bonus) AS total,","\/\/ team.*","\/\/ FROM player","\/\/ JOIN team ON team.id = player.teamID","\/\/ ORDER BY total, player.name","\/\/ ~~~~~","let request = Player"," .annotated(with: (Column(\"score\") + Column(\"bonus\")).forKey(\"total\"))"," .including(required: Player.team)"," .order(Column(\"total\").detached, Column(\"name\"))"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/grdb\/column\/detached"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/GRDB\/documentation\/GRDB\/Column\/detached","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"An SQL expression that refers to an aliased column"},{"type":"text","text":" "},{"type":"text","text":"("},{"type":"codeVoice","code":"expression AS alias"},{"type":"text","text":")."}],"kind":"symbol","metadata":{"role":"symbol","title":"detached","roleHeading":"Instance Property","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"detached"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"SQLExpression","preciseIdentifier":"s:4GRDB13SQLExpressionV"}],"symbolKind":"property","externalID":"s:4GRDB16ColumnExpressionPAAE8detachedAA13SQLExpressionVvp::SYNTHESIZED::s:4GRDB6ColumnV","extendedModule":"GRDB","modules":[{"name":"GRDB"}]},"hierarchy":{"paths":[["doc:\/\/GRDB\/documentation\/GRDB","doc:\/\/GRDB\/documentation\/GRDB\/QueryInterface","doc:\/\/GRDB\/documentation\/GRDB\/SQLSpecificExpressible","doc:\/\/GRDB\/documentation\/GRDB\/Column","doc:\/\/GRDB\/documentation\/GRDB\/Column\/ColumnExpression-Implementations"]]},"references":{"doc://GRDB/documentation/GRDB/Column/ColumnExpression-Implementations":{"role":"collectionGroup","title":"ColumnExpression Implementations","abstract":[],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/Column\/ColumnExpression-Implementations","kind":"article","type":"topic","url":"\/documentation\/grdb\/column\/columnexpression-implementations"},"doc://GRDB/documentation/GRDB/QueryInterface":{"role":"collectionGroup","title":"Record Types and the Query Interface","abstract":[{"type":"text","text":"Record types and the query interface build SQL queries for you"}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/QueryInterface","kind":"article","type":"topic","url":"\/documentation\/grdb\/queryinterface"},"doc://GRDB/documentation/GRDB/SQLSpecificExpressible":{"role":"symbol","title":"SQLSpecificExpressible","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"SQLSpecificExpressible"}],"abstract":[{"type":"text","text":"A database-specific type that can be used as an SQL expression."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/SQLSpecificExpressible","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SQLSpecificExpressible"}],"url":"\/documentation\/grdb\/sqlspecificexpressible"},"doc://GRDB/documentation/GRDB/Column":{"role":"symbol","title":"Column","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Column"}],"abstract":[{"type":"text","text":"A column in a database table."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/Column","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"Column"}],"url":"\/documentation\/grdb\/column"},"doc://GRDB/documentation/GRDB":{"role":"collection","title":"GRDB","abstract":[{"type":"text","text":"A toolkit for SQLite databases, with a focus on application development"}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB","kind":"symbol","type":"topic","url":"\/documentation\/grdb"},"doc://GRDB/documentation/GRDB/SQLExpression":{"role":"symbol","title":"SQLExpression","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"SQLExpression"}],"abstract":[{"type":"text","text":"An SQL expression."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/SQLExpression","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SQLExpression"}],"url":"\/documentation\/grdb\/sqlexpression"},"doc://GRDB/documentation/GRDB/Column/detached":{"role":"symbol","title":"detached","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"detached"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"SQLExpression","preciseIdentifier":"s:4GRDB13SQLExpressionV"}],"abstract":[{"type":"text","text":"An SQL expression that refers to an aliased column"},{"type":"text","text":" "},{"type":"text","text":"("},{"type":"codeVoice","code":"expression AS alias"},{"type":"text","text":")."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/Column\/detached","kind":"symbol","type":"topic","url":"\/documentation\/grdb\/column\/detached"}}} |