GOLF(2gg)
πΈ GOLF(2gg) β the current-row page, bestie edition πΈ
okay so this is a page from the 2gg manual (yep, that's the manual name, and it lives in the Development section), and it's about a little cutie called current-row. let's get into it π
β¨ NAME β¨
current-row β a database thing ποΈπ
π PURPOSE π
bestie, this is how you get the row number of the current row inside a query's result-set, or print it out. that's the whole job. iconic behavior honestly π«Ά
π SYNTAX π
current-row [ to <current row> ]
like, that's it. that's the whole thing. no cap β¨
π DESCRIPTION π
If you call current-row without the to clause, it just prints out the current row number. and the first row is numbered 1 β so it's 1-indexed, we love a girl who starts at 1 π
If you do use the to clause, then the row number gets stored into the variable <current row> instead. like, you're catching it and keeping it π
β οΈ important one, bestie:current-rowmust be within arun-queryloop, and it always refers to the most inner one. so if you've got loops inside loops inside loops, she's only ever talking about the innermost one. periodt. π
πΈ EXAMPLES πΈ
okay so here's the vibe β displaying the row number right before a line that has the first and last name of each employee π§β¨
run-query @mydb="select firstName, lastName from employee" output firstName, lastName
@Row #<<current-row>><br/>
print-out firstName
@,
print-out lastName
@<br/>
end-query
look at her go. the row number, then the name, every single time. ate. π
π₯ SEE ALSO π₯
Database β and literally all of these besties:
begin-transactioncommit-transactioncurrent-rowdatabase-config-filedb-errormariadb-databasepostgresql-databaserollback-transactionrun-querysqlite-database
and hey β See all documentation if you want the whole tour ππ
and that's the page!! this version was dated $DATE and tagged $VERSION, and yeah, it's still GOLF(2gg) at the end of the day π¦ mwah, go run some queries bestie πβ¨
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms